summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index d3e45f55..fc27b120 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -1168,6 +1168,9 @@ void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g,
1168 struct nvgpu_mem *mem) 1168 struct nvgpu_mem *mem)
1169{ 1169{
1170 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx; 1170 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx;
1171 struct ctx_header_desc *ctx = &ch_ctx->ctx_header;
1172 struct nvgpu_mem *ctxheader = &ctx->mem;
1173
1171 u32 gfxp_preempt_option = 1174 u32 gfxp_preempt_option =
1172 ctxsw_prog_main_image_graphics_preemption_options_control_gfxp_f(); 1175 ctxsw_prog_main_image_graphics_preemption_options_control_gfxp_f();
1173 u32 cilp_preempt_option = 1176 u32 cilp_preempt_option =
@@ -1204,9 +1207,14 @@ void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g,
1204 u32 size; 1207 u32 size;
1205 u32 cbes_reserve; 1208 u32 cbes_reserve;
1206 1209
1207 if (g->ops.gr.set_preemption_buffer_va) 1210 if (g->ops.gr.set_preemption_buffer_va) {
1208 g->ops.gr.set_preemption_buffer_va(g, mem, 1211 if (ctxheader->gpu_va)
1212 g->ops.gr.set_preemption_buffer_va(g, ctxheader,
1209 gr_ctx->t18x.preempt_ctxsw_buffer.gpu_va); 1213 gr_ctx->t18x.preempt_ctxsw_buffer.gpu_va);
1214 else
1215 g->ops.gr.set_preemption_buffer_va(g, mem,
1216 gr_ctx->t18x.preempt_ctxsw_buffer.gpu_va);
1217 }
1210 1218
1211 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx); 1219 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx);
1212 if (err) { 1220 if (err) {
@@ -2247,12 +2255,8 @@ int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch,
2247 goto enable_ch; 2255 goto enable_ch;
2248 2256
2249 if (g->ops.gr.update_ctxsw_preemption_mode) { 2257 if (g->ops.gr.update_ctxsw_preemption_mode) {
2250 if (ctxheader->gpu_va) 2258 g->ops.gr.update_ctxsw_preemption_mode(ch->g,
2251 g->ops.gr.update_ctxsw_preemption_mode(ch->g, 2259 ch_ctx, mem);
2252 ch_ctx, ctxheader);
2253 else
2254 g->ops.gr.update_ctxsw_preemption_mode(ch->g,
2255 ch_ctx, mem);
2256 2260
2257 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx); 2261 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx);
2258 if (err) { 2262 if (err) {