From b03afb6d5c4bbca5a26cc95027491c816e5e1f6d Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Wed, 19 Apr 2017 16:47:13 -0700 Subject: 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 Reviewed-on: http://git-master/r/1469040 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c index f9884cfb..9cb5b262 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c @@ -211,6 +211,16 @@ int gk20a_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice) return g->ops.fifo.tsg_set_timeslice(tsg, timeslice); } +u32 gk20a_tsg_get_timeslice(struct tsg_gk20a *tsg) +{ + struct gk20a *g = tsg->g; + + if (!tsg->timeslice_us) + return g->ops.fifo.default_timeslice_us(g); + + return tsg->timeslice_us; +} + static void release_used_tsg(struct fifo_gk20a *f, struct tsg_gk20a *tsg) { nvgpu_mutex_acquire(&f->tsg_inuse_mutex); -- cgit v1.2.2