summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
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/gk20a/channel_gk20a.c
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/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 9e3bc05e..6cb77d67 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -146,6 +146,16 @@ int channel_gk20a_commit_va(struct channel_gk20a *c)
146 return 0; 146 return 0;
147} 147}
148 148
149u32 gk20a_channel_get_timeslice(struct channel_gk20a *ch)
150{
151 struct gk20a *g = ch->g;
152
153 if (!ch->timeslice_us)
154 return g->ops.fifo.default_timeslice_us(g);
155
156 return ch->timeslice_us;
157}
158
149int gk20a_channel_get_timescale_from_timeslice(struct gk20a *g, 159int gk20a_channel_get_timescale_from_timeslice(struct gk20a *g,
150 int timeslice_period, 160 int timeslice_period,
151 int *__timeslice_timeout, int *__timeslice_scale) 161 int *__timeslice_timeout, int *__timeslice_scale)