From 351f519c2e1a2424a9a09c7a6b0f5c075198b3f0 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 5 Jan 2018 08:10:44 -0800 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1632681 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Seshendra Gadagottu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c') 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: return err; } -static void dump_ctx_switch_stats(struct gk20a *g, struct vm_gk20a *vm, - struct gr_ctx_desc *gr_ctx) +void gr_gp10b_dump_ctxsw_stats(struct gk20a *g, struct vm_gk20a *vm, + struct gr_ctx_desc *gr_ctx) { struct nvgpu_mem *mem = &gr_ctx->mem; @@ -1175,8 +1175,9 @@ void gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, if (!gr_ctx) return; - if (g->gr.ctx_vars.dump_ctxsw_stats_on_channel_close) - dump_ctx_switch_stats(g, vm, gr_ctx); + if (g->ops.gr.dump_ctxsw_stats && + g->gr.ctx_vars.dump_ctxsw_stats_on_channel_close) + g->ops.gr.dump_ctxsw_stats(g, vm, gr_ctx); nvgpu_dma_unmap_free(vm, &gr_ctx->pagepool_ctxsw_buffer); nvgpu_dma_unmap_free(vm, &gr_ctx->betacb_ctxsw_buffer); -- cgit v1.2.2