summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
index 6027ba7f..21fec478 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
+++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -264,9 +264,17 @@ static int vgpu_gr_gp10b_set_preemption_mode(struct channel_gk20a *ch,
264 if (!class) 264 if (!class)
265 return -EINVAL; 265 return -EINVAL;
266 266
267 /* preemption already set ? */ 267 /* skip setting anything if both modes are already set */
268 if (gr_ctx->graphics_preempt_mode || gr_ctx->compute_preempt_mode) 268 if (graphics_preempt_mode &&
269 return -EINVAL; 269 (graphics_preempt_mode == gr_ctx->graphics_preempt_mode))
270 graphics_preempt_mode = 0;
271
272 if (compute_preempt_mode &&
273 (compute_preempt_mode == gr_ctx->compute_preempt_mode))
274 compute_preempt_mode = 0;
275
276 if (graphics_preempt_mode == 0 && compute_preempt_mode == 0)
277 return 0;
270 278
271 if (gk20a_is_channel_marked_as_tsg(ch)) { 279 if (gk20a_is_channel_marked_as_tsg(ch)) {
272 tsg = &g->fifo.tsg[ch->tsgid]; 280 tsg = &g->fifo.tsg[ch->tsgid];