summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2017-04-19 19:47:13 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-24 07:55:36 -0400
commitb03afb6d5c4bbca5a26cc95027491c816e5e1f6d (patch)
treeb59ae1b881877cf52ca921a5bf9d884f78fac648 /drivers/gpu/nvgpu/common
parenta823c72219d3bb96bc9489e84b64e0038e7119d7 (diff)
gpu: nvgpu: add ioctls to get current timeslice
Add the following ioctls - NVGPU_CHANNEL_IOCTL_GET_TIMESLICE for channel timeslice in us - NVGPU_TSG_IOCTL_GET_TIMESLICE for TSG timeslice in us If timeslice has not been set explicitly, ioctl returns the default timeslice that will be used when programming the runlist entry. Bug 1883271 Change-Id: Ib18fdd836323b1a2d4efceb1e27d07713bd6fca5 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: http://git-master/r/1469040 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_channel.c4
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_tsg.c12
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
index 8a87e4cb..4d4d1690 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
@@ -1125,6 +1125,10 @@ long gk20a_channel_ioctl(struct file *filp,
1125 gk20a_channel_trace_sched_param( 1125 gk20a_channel_trace_sched_param(
1126 trace_gk20a_channel_set_timeslice, ch); 1126 trace_gk20a_channel_set_timeslice, ch);
1127 break; 1127 break;
1128 case NVGPU_IOCTL_CHANNEL_GET_TIMESLICE:
1129 ((struct nvgpu_timeslice_args *)buf)->timeslice_us =
1130 gk20a_channel_get_timeslice(ch);
1131 break;
1128 case NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE: 1132 case NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE:
1129 if (ch->g->ops.gr.set_preemption_mode) { 1133 if (ch->g->ops.gr.set_preemption_mode) {
1130 err = gk20a_busy(ch->g); 1134 err = gk20a_busy(ch->g);
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c b/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c
index e67965e1..25805ea0 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c
@@ -340,6 +340,12 @@ done:
340 return err; 340 return err;
341} 341}
342 342
343static int gk20a_tsg_ioctl_get_timeslice(struct gk20a *g,
344 struct tsg_gk20a *tsg, struct nvgpu_timeslice_args *arg)
345{
346 arg->timeslice_us = gk20a_tsg_get_timeslice(tsg);
347 return 0;
348}
343 349
344long nvgpu_ioctl_tsg_dev_ioctl(struct file *filp, unsigned int cmd, 350long nvgpu_ioctl_tsg_dev_ioctl(struct file *filp, unsigned int cmd,
345 unsigned long arg) 351 unsigned long arg)
@@ -455,6 +461,12 @@ long nvgpu_ioctl_tsg_dev_ioctl(struct file *filp, unsigned int cmd,
455 (struct nvgpu_timeslice_args *)buf); 461 (struct nvgpu_timeslice_args *)buf);
456 break; 462 break;
457 } 463 }
464 case NVGPU_IOCTL_TSG_GET_TIMESLICE:
465 {
466 err = gk20a_tsg_ioctl_get_timeslice(g, tsg,
467 (struct nvgpu_timeslice_args *)buf);
468 break;
469 }
458 470
459 default: 471 default:
460 nvgpu_err(g, "unrecognized tsg gpu ioctl cmd: 0x%x", 472 nvgpu_err(g, "unrecognized tsg gpu ioctl cmd: 0x%x",