summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-04-19 07:27:49 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-05-09 16:16:29 -0400
commitd868b654419cfa096f563c9281a2a5cc067c23db (patch)
treea11fc30ab435c6e2a4c54b97455d3f5c177ad507 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parentf14152c081d94710dbde843b8dcd9b3981afb831 (diff)
gpu: nvgpu: separate IOCTL to set preemption mode
Add separate IOCTL NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE to allow setting preemption modes from UMD Define preemption modes in nvgpu.h and use them everywhere Remove mode definitions from mm_gk20a.h Also, we support setting only one preemption mode in a channel But it is possible to have multiple preemption modes (one from graphics and one from compute) set simultaneously Hence, update struct gr_ctx_desc to include two separate preemption modes (graphics_preempt_mode and compute_preempt_mode) API NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE also supports setting two separate preemption modes i.e. one for graphics and one for compute Make necessary changes in code to support two preemption modes Bug 1646259 Change-Id: Ia1dea19e609ba8cc0de2f39ab6c0c4cd6b0a752c Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1131805 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 189ec330..990972e4 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -3208,6 +3208,23 @@ long gk20a_channel_ioctl(struct file *filp,
3208 3208
3209 trace_gk20a_channel_set_timeslice(GK20A_TP_ARGS_SCHED(ch)); 3209 trace_gk20a_channel_set_timeslice(GK20A_TP_ARGS_SCHED(ch));
3210 break; 3210 break;
3211 case NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE:
3212 if (ch->g->ops.gr.set_preemption_mode) {
3213 err = gk20a_busy(dev);
3214 if (err) {
3215 dev_err(dev,
3216 "%s: failed to host gk20a for ioctl cmd: 0x%x",
3217 __func__, cmd);
3218 break;
3219 }
3220 err = ch->g->ops.gr.set_preemption_mode(ch,
3221 ((struct nvgpu_preemption_mode_args *)buf)->graphics_preempt_mode,
3222 ((struct nvgpu_preemption_mode_args *)buf)->compute_preempt_mode);
3223 gk20a_idle(dev);
3224 } else {
3225 err = -EINVAL;
3226 }
3227 break;
3211 default: 3228 default:
3212 dev_dbg(dev, "unrecognized ioctl cmd: 0x%x", cmd); 3229 dev_dbg(dev, "unrecognized ioctl cmd: 0x%x", cmd);
3213 err = -ENOTTY; 3230 err = -ENOTTY;