diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c index 7b98c80f..0eaa23ab 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | |||
@@ -325,6 +325,26 @@ static int gk20a_tsg_event_id_ctrl(struct gk20a *g, struct tsg_gk20a *tsg, | |||
325 | return err; | 325 | return err; |
326 | } | 326 | } |
327 | 327 | ||
328 | static int gk20a_tsg_set_runlist_interleave(struct tsg_gk20a *tsg, u32 level) | ||
329 | { | ||
330 | struct gk20a *g = tsg->g; | ||
331 | int ret; | ||
332 | |||
333 | switch (level) { | ||
334 | case NVGPU_RUNLIST_INTERLEAVE_LEVEL_LOW: | ||
335 | case NVGPU_RUNLIST_INTERLEAVE_LEVEL_MEDIUM: | ||
336 | case NVGPU_RUNLIST_INTERLEAVE_LEVEL_HIGH: | ||
337 | ret = g->ops.fifo.set_runlist_interleave(g, tsg->tsgid, | ||
338 | true, 0, level); | ||
339 | break; | ||
340 | default: | ||
341 | ret = -EINVAL; | ||
342 | break; | ||
343 | } | ||
344 | |||
345 | return ret ? ret : g->ops.fifo.update_runlist(g, 0, ~0, true, true); | ||
346 | } | ||
347 | |||
328 | static void release_used_tsg(struct fifo_gk20a *f, struct tsg_gk20a *tsg) | 348 | static void release_used_tsg(struct fifo_gk20a *f, struct tsg_gk20a *tsg) |
329 | { | 349 | { |
330 | mutex_lock(&f->tsg_inuse_mutex); | 350 | mutex_lock(&f->tsg_inuse_mutex); |
@@ -520,6 +540,20 @@ long gk20a_tsg_dev_ioctl(struct file *filp, unsigned int cmd, | |||
520 | break; | 540 | break; |
521 | } | 541 | } |
522 | 542 | ||
543 | case NVGPU_IOCTL_TSG_SET_RUNLIST_INTERLEAVE: | ||
544 | { | ||
545 | err = gk20a_busy(g->dev); | ||
546 | if (err) { | ||
547 | gk20a_err(dev_from_gk20a(g), | ||
548 | "failed to host gk20a for ioctl cmd: 0x%x", cmd); | ||
549 | return err; | ||
550 | } | ||
551 | err = gk20a_tsg_set_runlist_interleave(tsg, | ||
552 | ((struct nvgpu_runlist_interleave_args *)buf)->level); | ||
553 | gk20a_idle(g->dev); | ||
554 | break; | ||
555 | } | ||
556 | |||
523 | default: | 557 | default: |
524 | gk20a_err(dev_from_gk20a(g), | 558 | gk20a_err(dev_from_gk20a(g), |
525 | "unrecognized tsg gpu ioctl cmd: 0x%x", | 559 | "unrecognized tsg gpu ioctl cmd: 0x%x", |