From 4ac110cb8a46a0c91a4a1e39c168de1b49688971 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 7 May 2014 13:09:36 +0300 Subject: gpu: nvgpu: Register as subdomain of host1x Add gk20a as a sub power domain of host1x. This enforces keeping host1x on when using gk20a. Bug 200003112 Change-Id: I08db595bc7b819d86d33fb98af0d8fb4de369463 Signed-off-by: Arto Merilainen Reviewed-on: http://git-master/r/407543 Reviewed-by: Riham Haidar Tested-by: Riham Haidar --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 50 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 7cf5fcde..1b7191db 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -697,14 +697,14 @@ int gk20a_channel_release(struct inode *inode, struct file *filp) trace_gk20a_channel_release(dev_name(&g->dev->dev)); - err = gk20a_channel_busy(ch->g->dev); + err = gk20a_busy(ch->g->dev); if (err) { gk20a_err(dev_from_gk20a(g), "failed to release channel %d", ch->hw_chid); return err; } gk20a_free_channel(ch, true); - gk20a_channel_idle(ch->g->dev); + gk20a_idle(ch->g->dev); gk20a_put_client(g); filp->private_data = NULL; @@ -767,14 +767,14 @@ static int __gk20a_channel_open(struct gk20a *g, struct file *filp) return err; } - err = gk20a_channel_busy(g->dev); + err = gk20a_busy(g->dev); if (err) { gk20a_put_client(g); gk20a_err(dev_from_gk20a(g), "failed to power on, %d", err); return err; } ch = gk20a_open_new_channel(g); - gk20a_channel_idle(g->dev); + gk20a_idle(g->dev); if (!ch) { gk20a_put_client(g); gk20a_err(dev_from_gk20a(g), @@ -1408,12 +1408,12 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) list_del_init(&job->list); kfree(job); - gk20a_channel_idle(g->dev); + gk20a_idle(g->dev); } mutex_unlock(&c->jobs_lock); for (i = 0; i < nr_completed; i++) - gk20a_channel_idle(c->g->dev); + gk20a_idle(c->g->dev); } static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, @@ -1455,7 +1455,7 @@ static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, gk20a_dbg_info("channel %d", c->hw_chid); /* gk20a_channel_update releases this ref. */ - err = gk20a_channel_busy(g->dev); + err = gk20a_busy(g->dev); if (err) { gk20a_err(d, "failed to host gk20a to submit gpfifo"); return err; @@ -1606,7 +1606,7 @@ clean_up: gk20a_err(d, "fail"); free_priv_cmdbuf(c, wait_cmd); free_priv_cmdbuf(c, incr_cmd); - gk20a_channel_idle(g->dev); + gk20a_idle(g->dev); return err; } @@ -1856,7 +1856,6 @@ int gk20a_channel_suspend(struct gk20a *g) for (chid = 0; chid < f->num_channels; chid++) { struct channel_gk20a *c = &f->channel[chid]; if (c->in_use && c->obj_class != KEPLER_C) { - gk20a_platform_channel_busy(g->dev); err = gk20a_channel_submit_wfi(c); if (err) { gk20a_err(d, "cannot idle channel %d\n", @@ -1866,7 +1865,6 @@ int gk20a_channel_suspend(struct gk20a *g) c->sync->wait_cpu(c->sync, &c->last_submit_fence, 500000); - gk20a_platform_channel_idle(g->dev); break; } } @@ -2037,7 +2035,7 @@ long gk20a_channel_ioctl(struct file *filp, case NVHOST_IOCTL_CHANNEL_SET_NVMAP_FD: break; case NVHOST_IOCTL_CHANNEL_ALLOC_OBJ_CTX: - err = gk20a_channel_busy(dev); + err = gk20a_busy(dev); if (err) { dev_err(&dev->dev, "%s: failed to host gk20a for ioctl cmd: 0x%x", @@ -2046,10 +2044,10 @@ long gk20a_channel_ioctl(struct file *filp, } err = gk20a_alloc_obj_ctx(ch, (struct nvhost_alloc_obj_ctx_args *)buf); - gk20a_channel_idle(dev); + gk20a_idle(dev); break; case NVHOST_IOCTL_CHANNEL_FREE_OBJ_CTX: - err = gk20a_channel_busy(dev); + err = gk20a_busy(dev); if (err) { dev_err(&dev->dev, "%s: failed to host gk20a for ioctl cmd: 0x%x", @@ -2058,10 +2056,10 @@ long gk20a_channel_ioctl(struct file *filp, } err = gk20a_free_obj_ctx(ch, (struct nvhost_free_obj_ctx_args *)buf); - gk20a_channel_idle(dev); + gk20a_idle(dev); break; case NVHOST_IOCTL_CHANNEL_ALLOC_GPFIFO: - err = gk20a_channel_busy(dev); + err = gk20a_busy(dev); if (err) { dev_err(&dev->dev, "%s: failed to host gk20a for ioctl cmd: 0x%x", @@ -2070,14 +2068,14 @@ long gk20a_channel_ioctl(struct file *filp, } err = gk20a_alloc_channel_gpfifo(ch, (struct nvhost_alloc_gpfifo_args *)buf); - gk20a_channel_idle(dev); + gk20a_idle(dev); break; case NVHOST_IOCTL_CHANNEL_SUBMIT_GPFIFO: err = gk20a_ioctl_channel_submit_gpfifo(ch, (struct nvhost_submit_gpfifo_args *)buf); break; case NVHOST_IOCTL_CHANNEL_WAIT: - err = gk20a_channel_busy(dev); + err = gk20a_busy(dev); if (err) { dev_err(&dev->dev, "%s: failed to host gk20a for ioctl cmd: 0x%x", @@ -2086,10 +2084,10 @@ long gk20a_channel_ioctl(struct file *filp, } err = gk20a_channel_wait(ch, (struct nvhost_wait_args *)buf); - gk20a_channel_idle(dev); + gk20a_idle(dev); break; case NVHOST_IOCTL_CHANNEL_ZCULL_BIND: - err = gk20a_channel_busy(dev); + err = gk20a_busy(dev); if (err) { dev_err(&dev->dev, "%s: failed to host gk20a for ioctl cmd: 0x%x", @@ -2098,10 +2096,10 @@ long gk20a_channel_ioctl(struct file *filp, } err = gk20a_channel_zcull_bind(ch, (struct nvhost_zcull_bind_args *)buf); - gk20a_channel_idle(dev); + gk20a_idle(dev); break; case NVHOST_IOCTL_CHANNEL_SET_ERROR_NOTIFIER: - err = gk20a_channel_busy(dev); + err = gk20a_busy(dev); if (err) { dev_err(&dev->dev, "%s: failed to host gk20a for ioctl cmd: 0x%x", @@ -2110,11 +2108,11 @@ long gk20a_channel_ioctl(struct file *filp, } err = gk20a_init_error_notifier(ch, (struct nvhost_set_error_notifier *)buf); - gk20a_channel_idle(dev); + gk20a_idle(dev); break; #ifdef CONFIG_GK20A_CYCLE_STATS case NVHOST_IOCTL_CHANNEL_CYCLE_STATS: - err = gk20a_channel_busy(dev); + err = gk20a_busy(dev); if (err) { dev_err(&dev->dev, "%s: failed to host gk20a for ioctl cmd: 0x%x", @@ -2123,7 +2121,7 @@ long gk20a_channel_ioctl(struct file *filp, } err = gk20a_channel_cycle_stats(ch, (struct nvhost_cycle_stats_args *)buf); - gk20a_channel_idle(dev); + gk20a_idle(dev); break; #endif case NVHOST_IOCTL_CHANNEL_SET_TIMEOUT: @@ -2153,7 +2151,7 @@ long gk20a_channel_ioctl(struct file *filp, ch->has_timedout; break; case NVHOST_IOCTL_CHANNEL_SET_PRIORITY: - err = gk20a_channel_busy(dev); + err = gk20a_busy(dev); if (err) { dev_err(&dev->dev, "%s: failed to host gk20a for ioctl cmd: 0x%x", @@ -2162,7 +2160,7 @@ long gk20a_channel_ioctl(struct file *filp, } gk20a_channel_set_priority(ch, ((struct nvhost_set_priority_args *)buf)->priority); - gk20a_channel_idle(dev); + gk20a_idle(dev); break; default: dev_err(&dev->dev, "unrecognized ioctl cmd: 0x%x", cmd); -- cgit v1.2.2