gpu: nvgpu: skip setting preemption modes if already set

In gr_gp10b_set_preemption_mode(), skip setting anything
if both graphics and compute preemption modes are
already set

Bug 200263471

Change-Id: I2788464750835da8f6396c6c1ca8356a63758c80
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1275465
GVS: Gerrit_Virtual_Submit
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
This commit is contained in:
Deepak Nibade
2016-12-22 13:45:21 +05:30
parent 76a18f5e76
commit 2aa3c85f8e

View File

@@ -2075,6 +2075,18 @@ static int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch,
vm = ch->vm;
}
/* skip setting anything if both modes are already set */
if (graphics_preempt_mode &&
(graphics_preempt_mode == gr_ctx->graphics_preempt_mode))
graphics_preempt_mode = 0;
if (compute_preempt_mode &&
(compute_preempt_mode == gr_ctx->compute_preempt_mode))
compute_preempt_mode = 0;
if (graphics_preempt_mode == 0 && compute_preempt_mode == 0)
return 0;
if (g->ops.gr.set_ctxsw_preemption_mode) {
err = g->ops.gr.set_ctxsw_preemption_mode(g, gr_ctx, vm, class,
graphics_preempt_mode, compute_preempt_mode);