diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2014-05-12 06:38:49 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:09:49 -0400 |
commit | 2b48263b1f2757cda9690a5959853f72295c96de (patch) | |
tree | bd0057dada7692554b45871cd8a902698b6dd1cb /drivers/gpu | |
parent | 66bb831f44312b8490470e3ea4fee2947167bc7f (diff) |
gpu: nvgpu: Do not realloc perfmon sample buffer
Allocate perfmon sample buffer only once.
Bug 1512840
Change-Id: I3f2a62b0fa28e6ba984ae3068a1d56ba461a0c29
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/408180
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 9b8602c5..c12496bb 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -2156,7 +2156,7 @@ static int pmu_init_perfmon(struct pmu_gk20a *pmu) | |||
2156 | struct pmu_payload payload; | 2156 | struct pmu_payload payload; |
2157 | u32 seq; | 2157 | u32 seq; |
2158 | u32 data; | 2158 | u32 data; |
2159 | int err; | 2159 | int err = 0; |
2160 | 2160 | ||
2161 | gk20a_dbg_fn(""); | 2161 | gk20a_dbg_fn(""); |
2162 | 2162 | ||
@@ -2206,8 +2206,9 @@ static int pmu_init_perfmon(struct pmu_gk20a *pmu) | |||
2206 | pwr_pmu_idle_ctrl_filter_disabled_f()); | 2206 | pwr_pmu_idle_ctrl_filter_disabled_f()); |
2207 | gk20a_writel(g, pwr_pmu_idle_ctrl_r(2), data); | 2207 | gk20a_writel(g, pwr_pmu_idle_ctrl_r(2), data); |
2208 | 2208 | ||
2209 | pmu->sample_buffer = 0; | 2209 | if (!pmu->sample_buffer) |
2210 | err = pmu->dmem.alloc(&pmu->dmem, &pmu->sample_buffer, 2 * sizeof(u16)); | 2210 | err = pmu->dmem.alloc(&pmu->dmem, |
2211 | &pmu->sample_buffer, 2 * sizeof(u16)); | ||
2211 | if (err) { | 2212 | if (err) { |
2212 | gk20a_err(dev_from_gk20a(g), | 2213 | gk20a_err(dev_from_gk20a(g), |
2213 | "failed to allocate perfmon sample buffer"); | 2214 | "failed to allocate perfmon sample buffer"); |