summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
authorRandy Spurlock <rspurlock@nvidia.com>2014-05-05 19:37:54 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:09:22 -0400
commiteffa9dcfaa5220c6e59d421e1e3c90a97b86dc74 (patch)
tree048f9551b4f8ed4577dffb00f10cf19e87a9a614 /drivers/gpu/nvgpu/gk20a/gr_gk20a.c
parentacd6d02069b499bbaa83b7c5ba6a952e6a6fd476 (diff)
video: tegra: host: gk20a: add class perf settings
Add a place to edit context-switched perf settings based upon class. Disable tex-lock as the first of such for compute. Bug 1409041 Change-Id: I5317a2a2e5f855661a1400b42f69211d16ae0c1d Signed-off-by: Randy Spurlock <rspurlock@nvidia.com> Reviewed-on: http://git-master/r/405908 (cherry picked from commit 250e149be35ecb8893dcef053ec44ffea86c302a) Reviewed-on: http://git-master/r/407094 (cherry picked from commit 54337c08cbf6c2c6b5c929c1be24e87165d9d946) Reviewed-on: http://git-master/r/408837 Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com> Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 0cb6c933..63dfc12d 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -2801,6 +2801,42 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c,
2801 gr_gk20a_commit_global_ctx_buffers(g, c, true)); 2801 gr_gk20a_commit_global_ctx_buffers(g, c, true));
2802 } 2802 }
2803 2803
2804 /* tweak any perf parameters per-context here */
2805 if (args->class_num == KEPLER_COMPUTE_A) {
2806 int begin_err;
2807 u32 tex_lock_disable_mask =
2808 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_m() |
2809 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_tile_m() |
2810 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_phase_m() |
2811 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_tex_m() |
2812 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_timeout_m() |
2813 gr_gpcs_tpcs_sm_sch_texlock_dot_t_unlock_m();
2814
2815 u32 texlock = gk20a_readl(g, gr_gpcs_tpcs_sm_sch_texlock_r());
2816
2817 texlock = (texlock & ~tex_lock_disable_mask) |
2818 (gr_gpcs_tpcs_sm_sch_texlock_tex_hash_disable_f() |
2819 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_tile_disable_f() |
2820 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_phase_disable_f() |
2821 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_tex_disable_f() |
2822 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_timeout_disable_f() |
2823 gr_gpcs_tpcs_sm_sch_texlock_dot_t_unlock_disable_f());
2824
2825 begin_err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx);
2826
2827 if (!begin_err) {
2828 err = gr_gk20a_ctx_patch_write(g, ch_ctx,
2829 gr_gpcs_tpcs_sm_sch_texlock_r(),
2830 texlock, true);
2831 }
2832 if ((begin_err || err)) {
2833 gk20a_err(dev_from_gk20a(g),
2834 "failed to set texlock for compute class");
2835 }
2836 if (!begin_err)
2837 gr_gk20a_ctx_patch_write_end(g, ch_ctx);
2838 }
2839
2804 /* init golden image, ELPG enabled after this is done */ 2840 /* init golden image, ELPG enabled after this is done */
2805 err = gr_gk20a_init_golden_ctx_image(g, c); 2841 err = gr_gk20a_init_golden_ctx_image(g, c);
2806 if (err) { 2842 if (err) {
@@ -4072,6 +4108,7 @@ static void gk20a_gr_enable_gpc_exceptions(struct gk20a *g)
4072 gr_gpc0_gpccs_gpc_exception_en_tpc_0_enabled_f()); 4108 gr_gpc0_gpccs_gpc_exception_en_tpc_0_enabled_f());
4073} 4109}
4074 4110
4111
4075void gr_gk20a_enable_hww_exceptions(struct gk20a *g) 4112void gr_gk20a_enable_hww_exceptions(struct gk20a *g)
4076{ 4113{
4077 /* enable exceptions */ 4114 /* enable exceptions */