summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c
diff options
context:
space:
mode:
authorDebarshi Dutta <ddutta@nvidia.com>2018-08-22 00:27:01 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-29 20:46:51 -0400
commit74639b444251d7adc222400625eb59a3d53d0c0a (patch)
tree19373fbe8ee522863c990fdfa0db24e6474f5167 /drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c
parente3710e5431d8f14f1b8c2812f5c1aeeb7bdaac1c (diff)
gpu: nvgpu: invoke calls to methods in pmu_gk20a.h via HAL
In nvgpu repository, we have multiple accesses to methods in pmu_gk20a.h which have register accesses. Instead of directly invoking these methods, these are now called via HALs. Some common methods such as pmu_wait_message_cond which donot have any register accesses are moved to pmu_ipc.c and the method declarations are moved to pmu.h. Also, changed gm20b_pmu_dbg to nvgpu_dbg_pmu all across the code base. This would remove all indirect dependencies via gk20a.h into pmu_gk20a.h. As a result pmu_gk20a.h is now removed from gk20a.h JIRA-597 Change-Id: Id54b2684ca39362fda7626238c3116cd49e92080 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1804283 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c')
-rw-r--r--drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c b/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c
index 5d736591..a99e86ce 100644
--- a/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c
+++ b/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c
@@ -73,7 +73,7 @@ int nvgpu_pmu_init_perfmon(struct nvgpu_pmu *pmu)
73 73
74 pmu->perfmon_ready = 0; 74 pmu->perfmon_ready = 0;
75 75
76 gk20a_pmu_init_perfmon_counter(g); 76 g->ops.pmu.pmu_init_perfmon_counter(g);
77 77
78 if (!pmu->sample_buffer) { 78 if (!pmu->sample_buffer) {
79 pmu->sample_buffer = nvgpu_alloc(&pmu->dmem, 79 pmu->sample_buffer = nvgpu_alloc(&pmu->dmem,
@@ -246,8 +246,8 @@ void nvgpu_pmu_get_load_counters(struct gk20a *g, u32 *busy_cycles,
246 return; 246 return;
247 } 247 }
248 248
249 *busy_cycles = gk20a_pmu_read_idle_counter(g, 1); 249 *busy_cycles = g->ops.pmu.pmu_read_idle_counter(g, 1);
250 *total_cycles = gk20a_pmu_read_idle_counter(g, 2); 250 *total_cycles = g->ops.pmu.pmu_read_idle_counter(g, 2);
251 251
252 gk20a_idle(g); 252 gk20a_idle(g);
253} 253}
@@ -258,8 +258,8 @@ void nvgpu_pmu_reset_load_counters(struct gk20a *g)
258 return; 258 return;
259 } 259 }
260 260
261 gk20a_pmu_reset_idle_counter(g, 2); 261 g->ops.pmu.pmu_reset_idle_counter(g, 2);
262 gk20a_pmu_reset_idle_counter(g, 1); 262 g->ops.pmu.pmu_reset_idle_counter(g, 1);
263 263
264 gk20a_idle(g); 264 gk20a_idle(g);
265} 265}
@@ -316,7 +316,7 @@ int nvgpu_pmu_init_perfmon_rpc(struct nvgpu_pmu *pmu)
316 memset(&rpc, 0, sizeof(struct nv_pmu_rpc_struct_perfmon_init)); 316 memset(&rpc, 0, sizeof(struct nv_pmu_rpc_struct_perfmon_init));
317 pmu->perfmon_ready = 0; 317 pmu->perfmon_ready = 0;
318 318
319 gk20a_pmu_init_perfmon_counter(g); 319 g->ops.pmu.pmu_init_perfmon_counter(g);
320 320
321 /* microseconds interval between pmu polls perf counters */ 321 /* microseconds interval between pmu polls perf counters */
322 rpc.sample_periodus = 16700; 322 rpc.sample_periodus = 16700;