summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index b9a1e685..2197bae5 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -849,7 +849,7 @@ static int gr_gm20b_alloc_gr_ctx(struct gk20a *g,
849 849
850static void gr_gm20b_update_ctxsw_preemption_mode(struct gk20a *g, 850static void gr_gm20b_update_ctxsw_preemption_mode(struct gk20a *g,
851 struct channel_ctx_gk20a *ch_ctx, 851 struct channel_ctx_gk20a *ch_ctx,
852 void *ctx_ptr) 852 struct mem_desc *mem)
853{ 853{
854 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx; 854 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx;
855 u32 cta_preempt_option = 855 u32 cta_preempt_option =
@@ -859,7 +859,8 @@ static void gr_gm20b_update_ctxsw_preemption_mode(struct gk20a *g,
859 859
860 if (gr_ctx->compute_preempt_mode == NVGPU_COMPUTE_PREEMPTION_MODE_CTA) { 860 if (gr_ctx->compute_preempt_mode == NVGPU_COMPUTE_PREEMPTION_MODE_CTA) {
861 gk20a_dbg_info("CTA: %x", cta_preempt_option); 861 gk20a_dbg_info("CTA: %x", cta_preempt_option);
862 gk20a_mem_wr32(ctx_ptr + ctxsw_prog_main_image_preemption_options_o(), 0, 862 gk20a_mem_wr(g, mem,
863 ctxsw_prog_main_image_preemption_options_o(),
863 cta_preempt_option); 864 cta_preempt_option);
864 } 865 }
865 866
@@ -1005,7 +1006,7 @@ static int gr_gm20b_update_pc_sampling(struct channel_gk20a *c,
1005 bool enable) 1006 bool enable)
1006{ 1007{
1007 struct channel_ctx_gk20a *ch_ctx = &c->ch_ctx; 1008 struct channel_ctx_gk20a *ch_ctx = &c->ch_ctx;
1008 void *ctx_ptr = NULL; 1009 struct mem_desc *mem;
1009 u32 v; 1010 u32 v;
1010 1011
1011 gk20a_dbg_fn(""); 1012 gk20a_dbg_fn("");
@@ -1013,18 +1014,17 @@ static int gr_gm20b_update_pc_sampling(struct channel_gk20a *c,
1013 if (!ch_ctx || !ch_ctx->gr_ctx || c->vpr) 1014 if (!ch_ctx || !ch_ctx->gr_ctx || c->vpr)
1014 return -EINVAL; 1015 return -EINVAL;
1015 1016
1016 ctx_ptr = vmap(ch_ctx->gr_ctx->mem.pages, 1017 mem = &ch_ctx->gr_ctx->mem;
1017 PAGE_ALIGN(ch_ctx->gr_ctx->mem.size) >> PAGE_SHIFT, 1018
1018 0, pgprot_writecombine(PAGE_KERNEL)); 1019 if (gk20a_mem_begin(c->g, mem))
1019 if (!ctx_ptr)
1020 return -ENOMEM; 1020 return -ENOMEM;
1021 1021
1022 v = gk20a_mem_rd32(ctx_ptr + ctxsw_prog_main_image_pm_o(), 0); 1022 v = gk20a_mem_rd(c->g, mem, ctxsw_prog_main_image_pm_o());
1023 v &= ~ctxsw_prog_main_image_pm_pc_sampling_m(); 1023 v &= ~ctxsw_prog_main_image_pm_pc_sampling_m();
1024 v |= ctxsw_prog_main_image_pm_pc_sampling_f(enable); 1024 v |= ctxsw_prog_main_image_pm_pc_sampling_f(enable);
1025 gk20a_mem_wr32(ctx_ptr + ctxsw_prog_main_image_pm_o(), 0, v); 1025 gk20a_mem_wr(c->g, mem, ctxsw_prog_main_image_pm_o(), v);
1026 1026
1027 vunmap(ctx_ptr); 1027 gk20a_mem_end(c->g, mem);
1028 1028
1029 gk20a_dbg_fn("done"); 1029 gk20a_dbg_fn("done");
1030 1030
@@ -1089,13 +1089,13 @@ static void gr_gm20b_init_cyclestats(struct gk20a *g)
1089#endif 1089#endif
1090} 1090}
1091 1091
1092static void gr_gm20b_enable_cde_in_fecs(void *ctx_ptr) 1092static void gr_gm20b_enable_cde_in_fecs(struct gk20a *g, struct mem_desc *mem)
1093{ 1093{
1094 u32 cde_v; 1094 u32 cde_v;
1095 1095
1096 cde_v = gk20a_mem_rd32(ctx_ptr + ctxsw_prog_main_image_ctl_o(), 0); 1096 cde_v = gk20a_mem_rd(g, mem, ctxsw_prog_main_image_ctl_o());
1097 cde_v |= ctxsw_prog_main_image_ctl_cde_enabled_f(); 1097 cde_v |= ctxsw_prog_main_image_ctl_cde_enabled_f();
1098 gk20a_mem_wr32(ctx_ptr + ctxsw_prog_main_image_ctl_o(), 0, cde_v); 1098 gk20a_mem_wr(g, mem, ctxsw_prog_main_image_ctl_o(), cde_v);
1099} 1099}
1100 1100
1101static void gr_gm20b_bpt_reg_info(struct gk20a *g, struct warpstate *w_state) 1101static void gr_gm20b_bpt_reg_info(struct gk20a *g, struct warpstate *w_state)