summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2016-07-27 20:06:36 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-11 12:16:03 -0400
commitfda4ddfa79f3a78becfe44fd558974bd274c03a9 (patch)
tree55d7999d7af7040ed50121fa6fa70fddc11b0887 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parentbb5fd16c67287e53db5165a974ea15ec3be09fe9 (diff)
gpu: nvgpu: userd allocation from sysmem
When bar1 memory is not supported then userd will be allocated from sysmem. Functions gp_get and gp_put are updated accordingly. JIRA GV11B-1 Change-Id: Ia895712a110f6cca26474228141488f5f8ace756 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/1225384 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.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 6a69de3e..4458430b 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -1541,12 +1541,25 @@ clean_up:
1541 return err; 1541 return err;
1542} 1542}
1543 1543
1544u32 gk20a_userd_gp_get(struct gk20a *g, struct channel_gk20a *c)
1545{
1546 return gk20a_bar1_readl(g,
1547 c->userd_gpu_va + sizeof(u32) * ram_userd_gp_get_w());
1548}
1549
1550void gk20a_userd_gp_put(struct gk20a *g, struct channel_gk20a *c)
1551{
1552 gk20a_bar1_writel(g,
1553 c->userd_gpu_va + sizeof(u32) * ram_userd_gp_put_w(),
1554 c->gpfifo.put);
1555}
1556
1544/* Update with this periodically to determine how the gpfifo is draining. */ 1557/* Update with this periodically to determine how the gpfifo is draining. */
1545static inline u32 update_gp_get(struct gk20a *g, 1558static inline u32 update_gp_get(struct gk20a *g,
1546 struct channel_gk20a *c) 1559 struct channel_gk20a *c)
1547{ 1560{
1548 u32 new_get = gk20a_bar1_readl(g, 1561 u32 new_get = g->ops.fifo.userd_gp_get(g, c);
1549 c->userd_gpu_va + sizeof(u32) * ram_userd_gp_get_w()); 1562
1550 if (new_get < c->gpfifo.get) 1563 if (new_get < c->gpfifo.get)
1551 c->gpfifo.wrap = !c->gpfifo.wrap; 1564 c->gpfifo.wrap = !c->gpfifo.wrap;
1552 c->gpfifo.get = new_get; 1565 c->gpfifo.get = new_get;
@@ -2360,9 +2373,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
2360 wait_cmd, incr_cmd, 2373 wait_cmd, incr_cmd,
2361 skip_buffer_refcounting); 2374 skip_buffer_refcounting);
2362 2375
2363 gk20a_bar1_writel(g, 2376 g->ops.fifo.userd_gp_put(g, c);
2364 c->userd_gpu_va + 4 * ram_userd_gp_put_w(),
2365 c->gpfifo.put);
2366 2377
2367 trace_gk20a_channel_submitted_gpfifo(dev_name(c->g->dev), 2378 trace_gk20a_channel_submitted_gpfifo(dev_name(c->g->dev),
2368 c->hw_chid, 2379 c->hw_chid,
@@ -2988,6 +2999,8 @@ void gk20a_init_channel(struct gpu_ops *gops)
2988 gops->fifo.setup_ramfc = channel_gk20a_setup_ramfc; 2999 gops->fifo.setup_ramfc = channel_gk20a_setup_ramfc;
2989 gops->fifo.channel_set_priority = gk20a_channel_set_priority; 3000 gops->fifo.channel_set_priority = gk20a_channel_set_priority;
2990 gops->fifo.channel_set_timeslice = gk20a_channel_set_timeslice; 3001 gops->fifo.channel_set_timeslice = gk20a_channel_set_timeslice;
3002 gops->fifo.userd_gp_get = gk20a_userd_gp_get;
3003 gops->fifo.userd_gp_put = gk20a_userd_gp_put;
2991} 3004}
2992 3005
2993long gk20a_channel_ioctl(struct file *filp, 3006long gk20a_channel_ioctl(struct file *filp,