summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2017-09-18 14:06:09 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-09-19 20:45:28 -0400
commitc4370d7deff6e3545157e06f51df2fef605a18cc (patch)
treedef6acc583226bade58338ff1ac869636c6d88e0 /drivers/gpu/nvgpu/gk20a
parentc03ccd89c24572dcb65bdfc8d9ab5eb76da28c96 (diff)
gpu: nvgpu: Initialize ctxsw header counters
Initialize following counters in context header for all legacy chips: ctxsw_prog_main_image_num_save_ops ctxsw_prog_main_image_num_restore_ops This was already present in the code but move to a function gk20a_gr_init_ctxsw_hdr_data, so that it can be re-used across chips. Additionally initialize following preemption related counters for gp10b onwards in context header: ctxsw_prog_main_image_num_wfi_save_ops ctxsw_prog_main_image_num_cta_save_ops ctxsw_prog_main_image_num_gfxp_save_ops ctxsw_prog_main_image_num_cilp_save_ops Bug 1958308 Change-Id: I0e45ec718a8f9ddb951b52c92137051b4f6a8c60 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1562654 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h3
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c16
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.h2
3 files changed, 17 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index adc630e6..8ac82428 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -415,6 +415,9 @@ struct gpu_ops {
415 u32 gpc, u32 tpc, u32 sm); 415 u32 gpc, u32 tpc, u32 sm);
416 void (*resume_all_sms)(struct gk20a *g); 416 void (*resume_all_sms)(struct gk20a *g);
417 void (*disable_rd_coalesce)(struct gk20a *g); 417 void (*disable_rd_coalesce)(struct gk20a *g);
418 void (*init_ctxsw_hdr_data)(struct gk20a *g,
419 struct nvgpu_mem *mem);
420
418 } gr; 421 } gr;
419 struct { 422 struct {
420 void (*init_hw)(struct gk20a *g); 423 void (*init_hw)(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 833a3ab9..82c9fa89 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -1821,6 +1821,15 @@ cleanup_pm_buf:
1821 return ret; 1821 return ret;
1822} 1822}
1823 1823
1824void gk20a_gr_init_ctxsw_hdr_data(struct gk20a *g,
1825 struct nvgpu_mem *mem)
1826{
1827 nvgpu_mem_wr(g, mem,
1828 ctxsw_prog_main_image_num_save_ops_o(), 0);
1829 nvgpu_mem_wr(g, mem,
1830 ctxsw_prog_main_image_num_restore_ops_o(), 0);
1831}
1832
1824/* load saved fresh copy of gloden image into channel gr_ctx */ 1833/* load saved fresh copy of gloden image into channel gr_ctx */
1825int gr_gk20a_load_golden_ctx_image(struct gk20a *g, 1834int gr_gk20a_load_golden_ctx_image(struct gk20a *g,
1826 struct channel_gk20a *c) 1835 struct channel_gk20a *c)
@@ -1860,12 +1869,11 @@ int gr_gk20a_load_golden_ctx_image(struct gk20a *g,
1860 nvgpu_mem_wr_n(g, mem, 0, 1869 nvgpu_mem_wr_n(g, mem, 0,
1861 gr->ctx_vars.local_golden_image, 1870 gr->ctx_vars.local_golden_image,
1862 gr->ctx_vars.golden_image_size); 1871 gr->ctx_vars.golden_image_size);
1863 nvgpu_mem_wr(g, mem,
1864 ctxsw_prog_main_image_num_save_ops_o(), 0);
1865 nvgpu_mem_wr(g, mem,
1866 ctxsw_prog_main_image_num_restore_ops_o(), 0);
1867 } 1872 }
1868 1873
1874 if (g->ops.gr.init_ctxsw_hdr_data)
1875 g->ops.gr.init_ctxsw_hdr_data(g, mem);
1876
1869 if (g->ops.gr.enable_cde_in_fecs && c->cde) 1877 if (g->ops.gr.enable_cde_in_fecs && c->cde)
1870 g->ops.gr.enable_cde_in_fecs(g, mem); 1878 g->ops.gr.enable_cde_in_fecs(g, mem);
1871 1879
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
index c69d9df9..2d2bd15e 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
@@ -737,6 +737,8 @@ void gk20a_gr_get_esr_sm_sel(struct gk20a *g, u32 gpc, u32 tpc,
737void gk20a_gr_init_ovr_sm_dsm_perf(void); 737void gk20a_gr_init_ovr_sm_dsm_perf(void);
738void gk20a_gr_get_ovr_perf_regs(struct gk20a *g, u32 *num_ovr_perf_regs, 738void gk20a_gr_get_ovr_perf_regs(struct gk20a *g, u32 *num_ovr_perf_regs,
739 u32 **ovr_perf_regs); 739 u32 **ovr_perf_regs);
740void gk20a_gr_init_ctxsw_hdr_data(struct gk20a *g,
741 struct nvgpu_mem *mem);
740 742
741static inline const char *gr_gk20a_graphics_preempt_mode_name(u32 graphics_preempt_mode) 743static inline const char *gr_gk20a_graphics_preempt_mode_name(u32 graphics_preempt_mode)
742{ 744{