diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2017-09-18 14:06:09 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-09-19 20:45:28 -0400 |
commit | c4370d7deff6e3545157e06f51df2fef605a18cc (patch) | |
tree | def6acc583226bade58338ff1ac869636c6d88e0 /drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |
parent | c03ccd89c24572dcb65bdfc8d9ab5eb76da28c96 (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/gr_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 16 |
1 files changed, 12 insertions, 4 deletions
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 | ||
1824 | void 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 */ |
1825 | int gr_gk20a_load_golden_ctx_image(struct gk20a *g, | 1834 | int 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 | ||