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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 91ea086c..9de7d675 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -2075,6 +2075,18 @@ static int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch,
2075 vm = ch->vm; 2075 vm = ch->vm;
2076 } 2076 }
2077 2077
2078 /* skip setting anything if both modes are already set */
2079 if (graphics_preempt_mode &&
2080 (graphics_preempt_mode == gr_ctx->graphics_preempt_mode))
2081 graphics_preempt_mode = 0;
2082
2083 if (compute_preempt_mode &&
2084 (compute_preempt_mode == gr_ctx->compute_preempt_mode))
2085 compute_preempt_mode = 0;
2086
2087 if (graphics_preempt_mode == 0 && compute_preempt_mode == 0)
2088 return 0;
2089
2078 if (g->ops.gr.set_ctxsw_preemption_mode) { 2090 if (g->ops.gr.set_ctxsw_preemption_mode) {
2079 err = g->ops.gr.set_ctxsw_preemption_mode(g, gr_ctx, vm, class, 2091 err = g->ops.gr.set_ctxsw_preemption_mode(g, gr_ctx, vm, class,
2080 graphics_preempt_mode, compute_preempt_mode); 2092 graphics_preempt_mode, compute_preempt_mode);