summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-05-07 06:09:36 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:09:20 -0400
commit4ac110cb8a46a0c91a4a1e39c168de1b49688971 (patch)
tree5cf832c256e8e7b4c28c2a08ed28614d44c00ea4 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parent4d93f777450e5bf46d5001426b3a437810cd852b (diff)
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 <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/407543 Reviewed-by: Riham Haidar <rhaidar@nvidia.com> Tested-by: Riham Haidar <rhaidar@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c50
1 files changed, 24 insertions, 26 deletions
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)
697 697
698 trace_gk20a_channel_release(dev_name(&g->dev->dev)); 698 trace_gk20a_channel_release(dev_name(&g->dev->dev));
699 699
700 err = gk20a_channel_busy(ch->g->dev); 700 err = gk20a_busy(ch->g->dev);
701 if (err) { 701 if (err) {
702 gk20a_err(dev_from_gk20a(g), "failed to release channel %d", 702 gk20a_err(dev_from_gk20a(g), "failed to release channel %d",
703 ch->hw_chid); 703 ch->hw_chid);
704 return err; 704 return err;
705 } 705 }
706 gk20a_free_channel(ch, true); 706 gk20a_free_channel(ch, true);
707 gk20a_channel_idle(ch->g->dev); 707 gk20a_idle(ch->g->dev);
708 708
709 gk20a_put_client(g); 709 gk20a_put_client(g);
710 filp->private_data = NULL; 710 filp->private_data = NULL;
@@ -767,14 +767,14 @@ static int __gk20a_channel_open(struct gk20a *g, struct file *filp)
767 return err; 767 return err;
768 } 768 }
769 769
770 err = gk20a_channel_busy(g->dev); 770 err = gk20a_busy(g->dev);
771 if (err) { 771 if (err) {
772 gk20a_put_client(g); 772 gk20a_put_client(g);
773 gk20a_err(dev_from_gk20a(g), "failed to power on, %d", err); 773 gk20a_err(dev_from_gk20a(g), "failed to power on, %d", err);
774 return err; 774 return err;
775 } 775 }
776 ch = gk20a_open_new_channel(g); 776 ch = gk20a_open_new_channel(g);
777 gk20a_channel_idle(g->dev); 777 gk20a_idle(g->dev);
778 if (!ch) { 778 if (!ch) {
779 gk20a_put_client(g); 779 gk20a_put_client(g);
780 gk20a_err(dev_from_gk20a(g), 780 gk20a_err(dev_from_gk20a(g),
@@ -1408,12 +1408,12 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed)
1408 1408
1409 list_del_init(&job->list); 1409 list_del_init(&job->list);
1410 kfree(job); 1410 kfree(job);
1411 gk20a_channel_idle(g->dev); 1411 gk20a_idle(g->dev);
1412 } 1412 }
1413 mutex_unlock(&c->jobs_lock); 1413 mutex_unlock(&c->jobs_lock);
1414 1414
1415 for (i = 0; i < nr_completed; i++) 1415 for (i = 0; i < nr_completed; i++)
1416 gk20a_channel_idle(c->g->dev); 1416 gk20a_idle(c->g->dev);
1417} 1417}
1418 1418
1419static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, 1419static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
@@ -1455,7 +1455,7 @@ static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
1455 gk20a_dbg_info("channel %d", c->hw_chid); 1455 gk20a_dbg_info("channel %d", c->hw_chid);
1456 1456
1457 /* gk20a_channel_update releases this ref. */ 1457 /* gk20a_channel_update releases this ref. */
1458 err = gk20a_channel_busy(g->dev); 1458 err = gk20a_busy(g->dev);
1459 if (err) { 1459 if (err) {
1460 gk20a_err(d, "failed to host gk20a to submit gpfifo"); 1460 gk20a_err(d, "failed to host gk20a to submit gpfifo");
1461 return err; 1461 return err;
@@ -1606,7 +1606,7 @@ clean_up:
1606 gk20a_err(d, "fail"); 1606 gk20a_err(d, "fail");
1607 free_priv_cmdbuf(c, wait_cmd); 1607 free_priv_cmdbuf(c, wait_cmd);
1608 free_priv_cmdbuf(c, incr_cmd); 1608 free_priv_cmdbuf(c, incr_cmd);
1609 gk20a_channel_idle(g->dev); 1609 gk20a_idle(g->dev);
1610 return err; 1610 return err;
1611} 1611}
1612 1612
@@ -1856,7 +1856,6 @@ int gk20a_channel_suspend(struct gk20a *g)
1856 for (chid = 0; chid < f->num_channels; chid++) { 1856 for (chid = 0; chid < f->num_channels; chid++) {
1857 struct channel_gk20a *c = &f->channel[chid]; 1857 struct channel_gk20a *c = &f->channel[chid];
1858 if (c->in_use && c->obj_class != KEPLER_C) { 1858 if (c->in_use && c->obj_class != KEPLER_C) {
1859 gk20a_platform_channel_busy(g->dev);
1860 err = gk20a_channel_submit_wfi(c); 1859 err = gk20a_channel_submit_wfi(c);
1861 if (err) { 1860 if (err) {
1862 gk20a_err(d, "cannot idle channel %d\n", 1861 gk20a_err(d, "cannot idle channel %d\n",
@@ -1866,7 +1865,6 @@ int gk20a_channel_suspend(struct gk20a *g)
1866 1865
1867 c->sync->wait_cpu(c->sync, &c->last_submit_fence, 1866 c->sync->wait_cpu(c->sync, &c->last_submit_fence,
1868 500000); 1867 500000);
1869 gk20a_platform_channel_idle(g->dev);
1870 break; 1868 break;
1871 } 1869 }
1872 } 1870 }
@@ -2037,7 +2035,7 @@ long gk20a_channel_ioctl(struct file *filp,
2037 case NVHOST_IOCTL_CHANNEL_SET_NVMAP_FD: 2035 case NVHOST_IOCTL_CHANNEL_SET_NVMAP_FD:
2038 break; 2036 break;
2039 case NVHOST_IOCTL_CHANNEL_ALLOC_OBJ_CTX: 2037 case NVHOST_IOCTL_CHANNEL_ALLOC_OBJ_CTX:
2040 err = gk20a_channel_busy(dev); 2038 err = gk20a_busy(dev);
2041 if (err) { 2039 if (err) {
2042 dev_err(&dev->dev, 2040 dev_err(&dev->dev,
2043 "%s: failed to host gk20a for ioctl cmd: 0x%x", 2041 "%s: failed to host gk20a for ioctl cmd: 0x%x",
@@ -2046,10 +2044,10 @@ long gk20a_channel_ioctl(struct file *filp,
2046 } 2044 }
2047 err = gk20a_alloc_obj_ctx(ch, 2045 err = gk20a_alloc_obj_ctx(ch,
2048 (struct nvhost_alloc_obj_ctx_args *)buf); 2046 (struct nvhost_alloc_obj_ctx_args *)buf);
2049 gk20a_channel_idle(dev); 2047 gk20a_idle(dev);
2050 break; 2048 break;
2051 case NVHOST_IOCTL_CHANNEL_FREE_OBJ_CTX: 2049 case NVHOST_IOCTL_CHANNEL_FREE_OBJ_CTX:
2052 err = gk20a_channel_busy(dev); 2050 err = gk20a_busy(dev);
2053 if (err) { 2051 if (err) {
2054 dev_err(&dev->dev, 2052 dev_err(&dev->dev,
2055 "%s: failed to host gk20a for ioctl cmd: 0x%x", 2053 "%s: failed to host gk20a for ioctl cmd: 0x%x",
@@ -2058,10 +2056,10 @@ long gk20a_channel_ioctl(struct file *filp,
2058 } 2056 }
2059 err = gk20a_free_obj_ctx(ch, 2057 err = gk20a_free_obj_ctx(ch,
2060 (struct nvhost_free_obj_ctx_args *)buf); 2058 (struct nvhost_free_obj_ctx_args *)buf);
2061 gk20a_channel_idle(dev); 2059 gk20a_idle(dev);
2062 break; 2060 break;
2063 case NVHOST_IOCTL_CHANNEL_ALLOC_GPFIFO: 2061 case NVHOST_IOCTL_CHANNEL_ALLOC_GPFIFO:
2064 err = gk20a_channel_busy(dev); 2062 err = gk20a_busy(dev);
2065 if (err) { 2063 if (err) {
2066 dev_err(&dev->dev, 2064 dev_err(&dev->dev,
2067 "%s: failed to host gk20a for ioctl cmd: 0x%x", 2065 "%s: failed to host gk20a for ioctl cmd: 0x%x",
@@ -2070,14 +2068,14 @@ long gk20a_channel_ioctl(struct file *filp,
2070 } 2068 }
2071 err = gk20a_alloc_channel_gpfifo(ch, 2069 err = gk20a_alloc_channel_gpfifo(ch,
2072 (struct nvhost_alloc_gpfifo_args *)buf); 2070 (struct nvhost_alloc_gpfifo_args *)buf);
2073 gk20a_channel_idle(dev); 2071 gk20a_idle(dev);
2074 break; 2072 break;
2075 case NVHOST_IOCTL_CHANNEL_SUBMIT_GPFIFO: 2073 case NVHOST_IOCTL_CHANNEL_SUBMIT_GPFIFO:
2076 err = gk20a_ioctl_channel_submit_gpfifo(ch, 2074 err = gk20a_ioctl_channel_submit_gpfifo(ch,
2077 (struct nvhost_submit_gpfifo_args *)buf); 2075 (struct nvhost_submit_gpfifo_args *)buf);
2078 break; 2076 break;
2079 case NVHOST_IOCTL_CHANNEL_WAIT: 2077 case NVHOST_IOCTL_CHANNEL_WAIT:
2080 err = gk20a_channel_busy(dev); 2078 err = gk20a_busy(dev);
2081 if (err) { 2079 if (err) {
2082 dev_err(&dev->dev, 2080 dev_err(&dev->dev,
2083 "%s: failed to host gk20a for ioctl cmd: 0x%x", 2081 "%s: failed to host gk20a for ioctl cmd: 0x%x",
@@ -2086,10 +2084,10 @@ long gk20a_channel_ioctl(struct file *filp,
2086 } 2084 }
2087 err = gk20a_channel_wait(ch, 2085 err = gk20a_channel_wait(ch,
2088 (struct nvhost_wait_args *)buf); 2086 (struct nvhost_wait_args *)buf);
2089 gk20a_channel_idle(dev); 2087 gk20a_idle(dev);
2090 break; 2088 break;
2091 case NVHOST_IOCTL_CHANNEL_ZCULL_BIND: 2089 case NVHOST_IOCTL_CHANNEL_ZCULL_BIND:
2092 err = gk20a_channel_busy(dev); 2090 err = gk20a_busy(dev);
2093 if (err) { 2091 if (err) {
2094 dev_err(&dev->dev, 2092 dev_err(&dev->dev,
2095 "%s: failed to host gk20a for ioctl cmd: 0x%x", 2093 "%s: failed to host gk20a for ioctl cmd: 0x%x",
@@ -2098,10 +2096,10 @@ long gk20a_channel_ioctl(struct file *filp,
2098 } 2096 }
2099 err = gk20a_channel_zcull_bind(ch, 2097 err = gk20a_channel_zcull_bind(ch,
2100 (struct nvhost_zcull_bind_args *)buf); 2098 (struct nvhost_zcull_bind_args *)buf);
2101 gk20a_channel_idle(dev); 2099 gk20a_idle(dev);
2102 break; 2100 break;
2103 case NVHOST_IOCTL_CHANNEL_SET_ERROR_NOTIFIER: 2101 case NVHOST_IOCTL_CHANNEL_SET_ERROR_NOTIFIER:
2104 err = gk20a_channel_busy(dev); 2102 err = gk20a_busy(dev);
2105 if (err) { 2103 if (err) {
2106 dev_err(&dev->dev, 2104 dev_err(&dev->dev,
2107 "%s: failed to host gk20a for ioctl cmd: 0x%x", 2105 "%s: failed to host gk20a for ioctl cmd: 0x%x",
@@ -2110,11 +2108,11 @@ long gk20a_channel_ioctl(struct file *filp,
2110 } 2108 }
2111 err = gk20a_init_error_notifier(ch, 2109 err = gk20a_init_error_notifier(ch,
2112 (struct nvhost_set_error_notifier *)buf); 2110 (struct nvhost_set_error_notifier *)buf);
2113 gk20a_channel_idle(dev); 2111 gk20a_idle(dev);
2114 break; 2112 break;
2115#ifdef CONFIG_GK20A_CYCLE_STATS 2113#ifdef CONFIG_GK20A_CYCLE_STATS
2116 case NVHOST_IOCTL_CHANNEL_CYCLE_STATS: 2114 case NVHOST_IOCTL_CHANNEL_CYCLE_STATS:
2117 err = gk20a_channel_busy(dev); 2115 err = gk20a_busy(dev);
2118 if (err) { 2116 if (err) {
2119 dev_err(&dev->dev, 2117 dev_err(&dev->dev,
2120 "%s: failed to host gk20a for ioctl cmd: 0x%x", 2118 "%s: failed to host gk20a for ioctl cmd: 0x%x",
@@ -2123,7 +2121,7 @@ long gk20a_channel_ioctl(struct file *filp,
2123 } 2121 }
2124 err = gk20a_channel_cycle_stats(ch, 2122 err = gk20a_channel_cycle_stats(ch,
2125 (struct nvhost_cycle_stats_args *)buf); 2123 (struct nvhost_cycle_stats_args *)buf);
2126 gk20a_channel_idle(dev); 2124 gk20a_idle(dev);
2127 break; 2125 break;
2128#endif 2126#endif
2129 case NVHOST_IOCTL_CHANNEL_SET_TIMEOUT: 2127 case NVHOST_IOCTL_CHANNEL_SET_TIMEOUT:
@@ -2153,7 +2151,7 @@ long gk20a_channel_ioctl(struct file *filp,
2153 ch->has_timedout; 2151 ch->has_timedout;
2154 break; 2152 break;
2155 case NVHOST_IOCTL_CHANNEL_SET_PRIORITY: 2153 case NVHOST_IOCTL_CHANNEL_SET_PRIORITY:
2156 err = gk20a_channel_busy(dev); 2154 err = gk20a_busy(dev);
2157 if (err) { 2155 if (err) {
2158 dev_err(&dev->dev, 2156 dev_err(&dev->dev,
2159 "%s: failed to host gk20a for ioctl cmd: 0x%x", 2157 "%s: failed to host gk20a for ioctl cmd: 0x%x",
@@ -2162,7 +2160,7 @@ long gk20a_channel_ioctl(struct file *filp,
2162 } 2160 }
2163 gk20a_channel_set_priority(ch, 2161 gk20a_channel_set_priority(ch,
2164 ((struct nvhost_set_priority_args *)buf)->priority); 2162 ((struct nvhost_set_priority_args *)buf)->priority);
2165 gk20a_channel_idle(dev); 2163 gk20a_idle(dev);
2166 break; 2164 break;
2167 default: 2165 default:
2168 dev_err(&dev->dev, "unrecognized ioctl cmd: 0x%x", cmd); 2166 dev_err(&dev->dev, "unrecognized ioctl cmd: 0x%x", cmd);