diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2018-01-05 11:10:44 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-12 15:42:31 -0500 |
commit | 351f519c2e1a2424a9a09c7a6b0f5c075198b3f0 (patch) | |
tree | a6036da05341de5dc903892964490f78b661eba9 | |
parent | 5b10690479d016dd27d4592d94e7bd12a9277a34 (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>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 9 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 1 |
5 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 4f05ba8f..070b26b6 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -439,6 +439,8 @@ struct gpu_ops { | |||
439 | void (*ecc_init_scrub_reg)(struct gk20a *g); | 439 | void (*ecc_init_scrub_reg)(struct gk20a *g); |
440 | u32 (*get_gpcs_swdx_dss_zbc_c_format_reg)(struct gk20a *g); | 440 | u32 (*get_gpcs_swdx_dss_zbc_c_format_reg)(struct gk20a *g); |
441 | u32 (*get_gpcs_swdx_dss_zbc_z_format_reg)(struct gk20a *g); | 441 | u32 (*get_gpcs_swdx_dss_zbc_z_format_reg)(struct gk20a *g); |
442 | void (*dump_ctxsw_stats)(struct gk20a *g, struct vm_gk20a *vm, | ||
443 | struct gr_ctx_desc *gr_ctx); | ||
442 | } gr; | 444 | } gr; |
443 | struct { | 445 | struct { |
444 | void (*init_hw)(struct gk20a *g); | 446 | void (*init_hw)(struct gk20a *g); |
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 | ||
1118 | static void dump_ctx_switch_stats(struct gk20a *g, struct vm_gk20a *vm, | 1118 | void 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); |
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h index 1d39a38b..64a076ef 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h | |||
@@ -108,6 +108,8 @@ void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g, | |||
108 | struct nvgpu_mem *mem); | 108 | struct nvgpu_mem *mem); |
109 | int gr_gp10b_dump_gr_status_regs(struct gk20a *g, | 109 | int gr_gp10b_dump_gr_status_regs(struct gk20a *g, |
110 | struct gk20a_debug_output *o); | 110 | struct gk20a_debug_output *o); |
111 | void gr_gp10b_dump_ctxsw_stats(struct gk20a *g, struct vm_gk20a *vm, | ||
112 | struct gr_ctx_desc *gr_ctx); | ||
111 | int gr_gp10b_wait_empty(struct gk20a *g, unsigned long duration_ms, | 113 | int gr_gp10b_wait_empty(struct gk20a *g, unsigned long duration_ms, |
112 | u32 expect_delay); | 114 | u32 expect_delay); |
113 | void gr_gp10b_commit_global_attrib_cb(struct gk20a *g, | 115 | void gr_gp10b_commit_global_attrib_cb(struct gk20a *g, |
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index cfba7d65..7ca9e313 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c | |||
@@ -340,6 +340,7 @@ static const struct gpu_ops gp10b_ops = { | |||
340 | gr_gp10b_init_gfxp_wfi_timeout_count, | 340 | gr_gp10b_init_gfxp_wfi_timeout_count, |
341 | .get_max_gfxp_wfi_timeout_count = | 341 | .get_max_gfxp_wfi_timeout_count = |
342 | gr_gp10b_get_max_gfxp_wfi_timeout_count, | 342 | gr_gp10b_get_max_gfxp_wfi_timeout_count, |
343 | .dump_ctxsw_stats = gr_gp10b_dump_ctxsw_stats, | ||
343 | }, | 344 | }, |
344 | .fb = { | 345 | .fb = { |
345 | .reset = fb_gk20a_reset, | 346 | .reset = fb_gk20a_reset, |
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index f19832b9..7c22448d 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |||
@@ -397,6 +397,7 @@ static const struct gpu_ops gv11b_ops = { | |||
397 | .get_max_gfxp_wfi_timeout_count = | 397 | .get_max_gfxp_wfi_timeout_count = |
398 | gr_gv11b_get_max_gfxp_wfi_timeout_count, | 398 | gr_gv11b_get_max_gfxp_wfi_timeout_count, |
399 | .ecc_init_scrub_reg = gr_gv11b_ecc_init_scrub_reg, | 399 | .ecc_init_scrub_reg = gr_gv11b_ecc_init_scrub_reg, |
400 | .dump_ctxsw_stats = gr_gp10b_dump_ctxsw_stats, | ||
400 | }, | 401 | }, |
401 | .fb = { | 402 | .fb = { |
402 | .reset = gv11b_fb_reset, | 403 | .reset = gv11b_fb_reset, |