summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2017-02-16 18:39:02 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-02-24 15:14:17 -0500
commitac8cea9351a15c7f081621bc83e8a318b9531020 (patch)
tree64f575132d2125e324647944028f04f16217c293 /drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
parent45303a7de515c2214c8df2e19d130b89395eae4f (diff)
gpu: nvgpu: ignore set preempt mode to default
In native case, attempting to set graphics/compute preempt mode to default is ignored if preemption mode has already been set for the context. In virtualized case an error is currently returned. Align behaviour for native and virtualized case, by ignoring such request. Bug 200186530 Change-Id: Ieb3a37107bdbd3284804ee9fd392786409224082 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: http://git-master/r/1306506 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
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];