diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_channel.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index 606c5251..c1492cad 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c | |||
@@ -789,10 +789,6 @@ static int gk20a_ioctl_channel_submit_gpfifo( | |||
789 | if (ch->has_timedout) | 789 | if (ch->has_timedout) |
790 | return -ETIMEDOUT; | 790 | return -ETIMEDOUT; |
791 | 791 | ||
792 | if ((NVGPU_SUBMIT_GPFIFO_FLAGS_RESCHEDULE_RUNLIST & args->flags) && | ||
793 | !capable(CAP_SYS_NICE)) | ||
794 | return -EPERM; | ||
795 | |||
796 | nvgpu_get_fence_args(&args->fence, &fence); | 792 | nvgpu_get_fence_args(&args->fence, &fence); |
797 | submit_flags = | 793 | submit_flags = |
798 | nvgpu_submit_gpfifo_user_flags_to_common_flags(args->flags); | 794 | nvgpu_submit_gpfifo_user_flags_to_common_flags(args->flags); |
@@ -1291,6 +1287,27 @@ long gk20a_channel_ioctl(struct file *filp, | |||
1291 | err = gk20a_fifo_preempt(ch->g, ch); | 1287 | err = gk20a_fifo_preempt(ch->g, ch); |
1292 | gk20a_idle(ch->g); | 1288 | gk20a_idle(ch->g); |
1293 | break; | 1289 | break; |
1290 | case NVGPU_IOCTL_CHANNEL_RESCHEDULE_RUNLIST: | ||
1291 | if (!capable(CAP_SYS_NICE)) { | ||
1292 | err = -EPERM; | ||
1293 | break; | ||
1294 | } | ||
1295 | if (!ch->g->ops.fifo.reschedule_runlist) { | ||
1296 | err = -ENOSYS; | ||
1297 | break; | ||
1298 | } | ||
1299 | err = gk20a_busy(ch->g); | ||
1300 | if (err) { | ||
1301 | dev_err(dev, | ||
1302 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | ||
1303 | __func__, cmd); | ||
1304 | break; | ||
1305 | } | ||
1306 | err = ch->g->ops.fifo.reschedule_runlist(ch, | ||
1307 | NVGPU_RESCHEDULE_RUNLIST_PREEMPT_NEXT & | ||
1308 | ((struct nvgpu_reschedule_runlist_args *)buf)->flags); | ||
1309 | gk20a_idle(ch->g); | ||
1310 | break; | ||
1294 | case NVGPU_IOCTL_CHANNEL_FORCE_RESET: | 1311 | case NVGPU_IOCTL_CHANNEL_FORCE_RESET: |
1295 | err = gk20a_busy(ch->g); | 1312 | err = gk20a_busy(ch->g); |
1296 | if (err) { | 1313 | if (err) { |