summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-01-05 11:10:44 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-12 15:42:31 -0500
commit351f519c2e1a2424a9a09c7a6b0f5c075198b3f0 (patch)
treea6036da05341de5dc903892964490f78b661eba9 /drivers/gpu/nvgpu/gp10b/gr_gp10b.c
parent5b10690479d016dd27d4592d94e7bd12a9277a34 (diff)
gpu: nvgpu: Add HAL for dumping ctxsw statistics
Add HAL for dumping ctxsw statistics. The statistics are dependent on the architecture, and the function that calls this operation needs to be moved to gk20a. Bug 1842197 Change-Id: I285c74b8ddc8c7854c85b3fef4cbfc582098919e Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1632681 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 68d18aa1..ca2bc52b 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -1115,8 +1115,8 @@ fail_free_gk20a_ctx:
1115 return err; 1115 return err;
1116} 1116}
1117 1117
1118static void dump_ctx_switch_stats(struct gk20a *g, struct vm_gk20a *vm, 1118void gr_gp10b_dump_ctxsw_stats(struct gk20a *g, struct vm_gk20a *vm,
1119 struct gr_ctx_desc *gr_ctx) 1119 struct gr_ctx_desc *gr_ctx)
1120{ 1120{
1121 struct nvgpu_mem *mem = &gr_ctx->mem; 1121 struct nvgpu_mem *mem = &gr_ctx->mem;
1122 1122
@@ -1175,8 +1175,9 @@ void gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm,
1175 if (!gr_ctx) 1175 if (!gr_ctx)
1176 return; 1176 return;
1177 1177
1178 if (g->gr.ctx_vars.dump_ctxsw_stats_on_channel_close) 1178 if (g->ops.gr.dump_ctxsw_stats &&
1179 dump_ctx_switch_stats(g, vm, gr_ctx); 1179 g->gr.ctx_vars.dump_ctxsw_stats_on_channel_close)
1180 g->ops.gr.dump_ctxsw_stats(g, vm, gr_ctx);
1180 1181
1181 nvgpu_dma_unmap_free(vm, &gr_ctx->pagepool_ctxsw_buffer); 1182 nvgpu_dma_unmap_free(vm, &gr_ctx->pagepool_ctxsw_buffer);
1182 nvgpu_dma_unmap_free(vm, &gr_ctx->betacb_ctxsw_buffer); 1183 nvgpu_dma_unmap_free(vm, &gr_ctx->betacb_ctxsw_buffer);