aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-01-16 11:29:57 -0500
committerLucas Stach <l.stach@pengutronix.de>2017-02-02 04:30:37 -0500
commite66774dd6f6a3d44559599e4eeb785734c28d034 (patch)
treee87ff31d2685fae6e2a5009d426f63abe3c3af85
parent9912b4db7beae07cfa8d435530cddf375873c6f3 (diff)
drm/etnaviv: add cmdbuf suballocator
There are 3 big benefits to suballocating a single big DMA buffer for command submission: 1. Avoid hammering CMA. The old way of allocating and freeing a DMA buffer for each submission was hitting some of the real slow pathes in CMA, as this allocator was not designed for a concurrent small buffers load. 2. Less TLB flushes on IOMMUv2. If a new command buffer is mapped into the GPU address space the MMU TLBs need to be flushed. By having one big buffer statically mapped to the GPU, a lot of those flushes can be avoided. 3. No funky workarounds for GC3000. The FE TLB flush on GC3000 isn't reliable. To work around that we tried to lay out the cmdbufs in the GPU address space in a way to avoid this issue. This hasn't always worked if the address space is crowded. A single statically mapped buffer avoids the erratum completely. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c123
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h21
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c5
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gpu.c14
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gpu.h5
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_mmu.c45
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_mmu.h10
7 files changed, 165 insertions, 58 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c
index 1ad118c6c64e..633e0f07cbac 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c
@@ -14,51 +14,140 @@
14 * this program. If not, see <http://www.gnu.org/licenses/>. 14 * this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#include <drm/drm_mm.h>
18
17#include "etnaviv_cmdbuf.h" 19#include "etnaviv_cmdbuf.h"
18#include "etnaviv_gpu.h" 20#include "etnaviv_gpu.h"
19#include "etnaviv_mmu.h" 21#include "etnaviv_mmu.h"
20 22
21struct etnaviv_cmdbuf *etnaviv_cmdbuf_new(struct etnaviv_gpu *gpu, u32 size, 23#define SUBALLOC_SIZE SZ_256K
22 size_t nr_bos) 24#define SUBALLOC_GRANULE SZ_4K
25#define SUBALLOC_GRANULES (SUBALLOC_SIZE / SUBALLOC_GRANULE)
26
27struct etnaviv_cmdbuf_suballoc {
28 /* suballocated dma buffer properties */
29 struct etnaviv_gpu *gpu;
30 void *vaddr;
31 dma_addr_t paddr;
32
33 /* GPU mapping */
34 u32 iova;
35 struct drm_mm_node vram_node; /* only used on MMUv2 */
36
37 /* allocation management */
38 struct mutex lock;
39 DECLARE_BITMAP(granule_map, SUBALLOC_GRANULES);
40 int free_space;
41 wait_queue_head_t free_event;
42};
43
44struct etnaviv_cmdbuf_suballoc *
45etnaviv_cmdbuf_suballoc_new(struct etnaviv_gpu * gpu)
46{
47 struct etnaviv_cmdbuf_suballoc *suballoc;
48 int ret;
49
50 suballoc = kzalloc(sizeof(*suballoc), GFP_KERNEL);
51 if (!suballoc)
52 return ERR_PTR(-ENOMEM);
53
54 suballoc->gpu = gpu;
55 mutex_init(&suballoc->lock);
56 init_waitqueue_head(&suballoc->free_event);
57
58 suballoc->vaddr = dma_alloc_wc(gpu->dev, SUBALLOC_SIZE,
59 &suballoc->paddr, GFP_KERNEL);
60 if (!suballoc->vaddr)
61 goto free_suballoc;
62
63 ret = etnaviv_iommu_get_suballoc_va(gpu, suballoc->paddr,
64 &suballoc->vram_node, SUBALLOC_SIZE,
65 &suballoc->iova);
66 if (ret)
67 goto free_dma;
68
69 return suballoc;
70
71free_dma:
72 dma_free_wc(gpu->dev, SUBALLOC_SIZE, suballoc->vaddr, suballoc->paddr);
73free_suballoc:
74 kfree(suballoc);
75
76 return NULL;
77}
78
79void etnaviv_cmdbuf_suballoc_destroy(struct etnaviv_cmdbuf_suballoc *suballoc)
80{
81 etnaviv_iommu_put_suballoc_va(suballoc->gpu, &suballoc->vram_node,
82 SUBALLOC_SIZE, suballoc->iova);
83 dma_free_wc(suballoc->gpu->dev, SUBALLOC_SIZE, suballoc->vaddr,
84 suballoc->paddr);
85 kfree(suballoc);
86}
87
88struct etnaviv_cmdbuf *
89etnaviv_cmdbuf_new(struct etnaviv_cmdbuf_suballoc *suballoc, u32 size,
90 size_t nr_bos)
23{ 91{
24 struct etnaviv_cmdbuf *cmdbuf; 92 struct etnaviv_cmdbuf *cmdbuf;
25 size_t sz = size_vstruct(nr_bos, sizeof(cmdbuf->bo_map[0]), 93 size_t sz = size_vstruct(nr_bos, sizeof(cmdbuf->bo_map[0]),
26 sizeof(*cmdbuf)); 94 sizeof(*cmdbuf));
95 int granule_offs, order, ret;
27 96
28 cmdbuf = kzalloc(sz, GFP_KERNEL); 97 cmdbuf = kzalloc(sz, GFP_KERNEL);
29 if (!cmdbuf) 98 if (!cmdbuf)
30 return NULL; 99 return NULL;
31 100
32 if (gpu->mmu->version == ETNAVIV_IOMMU_V2) 101 cmdbuf->suballoc = suballoc;
33 size = ALIGN(size, SZ_4K); 102 cmdbuf->size = size;
34 103
35 cmdbuf->vaddr = dma_alloc_wc(gpu->dev, size, &cmdbuf->paddr, 104 order = order_base_2(ALIGN(size, SUBALLOC_GRANULE) / SUBALLOC_GRANULE);
36 GFP_KERNEL); 105retry:
37 if (!cmdbuf->vaddr) { 106 mutex_lock(&suballoc->lock);
38 kfree(cmdbuf); 107 granule_offs = bitmap_find_free_region(suballoc->granule_map,
39 return NULL; 108 SUBALLOC_GRANULES, order);
109 if (granule_offs < 0) {
110 suballoc->free_space = 0;
111 mutex_unlock(&suballoc->lock);
112 ret = wait_event_interruptible_timeout(suballoc->free_event,
113 suballoc->free_space,
114 msecs_to_jiffies(10 * 1000));
115 if (!ret) {
116 dev_err(suballoc->gpu->dev,
117 "Timeout waiting for cmdbuf space\n");
118 return NULL;
119 }
120 goto retry;
40 } 121 }
41 122 mutex_unlock(&suballoc->lock);
42 cmdbuf->gpu = gpu; 123 cmdbuf->suballoc_offset = granule_offs * SUBALLOC_GRANULE;
43 cmdbuf->size = size; 124 cmdbuf->vaddr = suballoc->vaddr + cmdbuf->suballoc_offset;
44 125
45 return cmdbuf; 126 return cmdbuf;
46} 127}
47 128
48void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf) 129void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf)
49{ 130{
50 etnaviv_iommu_put_cmdbuf_va(cmdbuf->gpu, cmdbuf); 131 struct etnaviv_cmdbuf_suballoc *suballoc = cmdbuf->suballoc;
51 dma_free_wc(cmdbuf->gpu->dev, cmdbuf->size, cmdbuf->vaddr, 132 int order = order_base_2(ALIGN(cmdbuf->size, SUBALLOC_GRANULE) /
52 cmdbuf->paddr); 133 SUBALLOC_GRANULE);
134
135 mutex_lock(&suballoc->lock);
136 bitmap_release_region(suballoc->granule_map,
137 cmdbuf->suballoc_offset / SUBALLOC_GRANULE,
138 order);
139 suballoc->free_space = 1;
140 mutex_unlock(&suballoc->lock);
141 wake_up_all(&suballoc->free_event);
53 kfree(cmdbuf); 142 kfree(cmdbuf);
54} 143}
55 144
56u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf) 145u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf)
57{ 146{
58 return etnaviv_iommu_get_cmdbuf_va(buf->gpu, buf); 147 return buf->suballoc->iova + buf->suballoc_offset;
59} 148}
60 149
61dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf) 150dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf)
62{ 151{
63 return buf->paddr; 152 return buf->suballoc->paddr + buf->suballoc_offset;
64} 153}
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
index 244358778407..80d78076c679 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
@@ -17,21 +17,21 @@
17#ifndef __ETNAVIV_CMDBUF_H__ 17#ifndef __ETNAVIV_CMDBUF_H__
18#define __ETNAVIV_CMDBUF_H__ 18#define __ETNAVIV_CMDBUF_H__
19 19
20#include <drm/drm_mm.h>
21#include <linux/types.h> 20#include <linux/types.h>
22 21
22struct etnaviv_gpu;
23struct etnaviv_cmdbuf_suballoc;
24
23struct etnaviv_cmdbuf { 25struct etnaviv_cmdbuf {
24 /* device this cmdbuf is allocated for */ 26 /* suballocator this cmdbuf is allocated from */
25 struct etnaviv_gpu *gpu; 27 struct etnaviv_cmdbuf_suballoc *suballoc;
26 /* user context key, must be unique between all active users */ 28 /* user context key, must be unique between all active users */
27 struct etnaviv_file_private *ctx; 29 struct etnaviv_file_private *ctx;
28 /* cmdbuf properties */ 30 /* cmdbuf properties */
31 int suballoc_offset;
29 void *vaddr; 32 void *vaddr;
30 dma_addr_t paddr;
31 u32 size; 33 u32 size;
32 u32 user_size; 34 u32 user_size;
33 /* vram node used if the cmdbuf is mapped through the MMUv2 */
34 struct drm_mm_node vram_node;
35 /* fence after which this buffer is to be disposed */ 35 /* fence after which this buffer is to be disposed */
36 struct dma_fence *fence; 36 struct dma_fence *fence;
37 /* target exec state */ 37 /* target exec state */
@@ -43,6 +43,15 @@ struct etnaviv_cmdbuf {
43 struct etnaviv_vram_mapping *bo_map[0]; 43 struct etnaviv_vram_mapping *bo_map[0];
44}; 44};
45 45
46struct etnaviv_cmdbuf_suballoc *
47etnaviv_cmdbuf_suballoc_new(struct etnaviv_gpu * gpu);
48void etnaviv_cmdbuf_suballoc_destroy(struct etnaviv_cmdbuf_suballoc *suballoc);
49
50struct etnaviv_cmdbuf *
51etnaviv_cmdbuf_new(struct etnaviv_cmdbuf_suballoc *suballoc, u32 size,
52 size_t nr_bos);
53void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf);
54
46u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf); 55u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf);
47dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf); 56dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf);
48 57
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index 7e1fefef2f2c..726090d7a6ac 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -333,8 +333,9 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
333 bos = drm_malloc_ab(args->nr_bos, sizeof(*bos)); 333 bos = drm_malloc_ab(args->nr_bos, sizeof(*bos));
334 relocs = drm_malloc_ab(args->nr_relocs, sizeof(*relocs)); 334 relocs = drm_malloc_ab(args->nr_relocs, sizeof(*relocs));
335 stream = drm_malloc_ab(1, args->stream_size); 335 stream = drm_malloc_ab(1, args->stream_size);
336 cmdbuf = etnaviv_cmdbuf_new(gpu, ALIGN(args->stream_size, 8) + 8, 336 cmdbuf = etnaviv_cmdbuf_new(gpu->cmdbuf_suballoc,
337 args->nr_bos); 337 ALIGN(args->stream_size, 8) + 8,
338 args->nr_bos);
338 if (!bos || !relocs || !stream || !cmdbuf) { 339 if (!bos || !relocs || !stream || !cmdbuf) {
339 ret = -ENOMEM; 340 ret = -ENOMEM;
340 goto err_submit_cmds; 341 goto err_submit_cmds;
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 3a689c3fbe5b..130d7d517a19 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -694,8 +694,15 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
694 goto fail; 694 goto fail;
695 } 695 }
696 696
697 gpu->cmdbuf_suballoc = etnaviv_cmdbuf_suballoc_new(gpu);
698 if (IS_ERR(gpu->cmdbuf_suballoc)) {
699 dev_err(gpu->dev, "Failed to create cmdbuf suballocator\n");
700 ret = PTR_ERR(gpu->cmdbuf_suballoc);
701 goto fail;
702 }
703
697 /* Create buffer: */ 704 /* Create buffer: */
698 gpu->buffer = etnaviv_cmdbuf_new(gpu, PAGE_SIZE, 0); 705 gpu->buffer = etnaviv_cmdbuf_new(gpu->cmdbuf_suballoc, PAGE_SIZE, 0);
699 if (!gpu->buffer) { 706 if (!gpu->buffer) {
700 ret = -ENOMEM; 707 ret = -ENOMEM;
701 dev_err(gpu->dev, "could not create command buffer\n"); 708 dev_err(gpu->dev, "could not create command buffer\n");
@@ -1598,6 +1605,11 @@ static void etnaviv_gpu_unbind(struct device *dev, struct device *master,
1598 gpu->buffer = NULL; 1605 gpu->buffer = NULL;
1599 } 1606 }
1600 1607
1608 if (gpu->cmdbuf_suballoc) {
1609 etnaviv_cmdbuf_suballoc_destroy(gpu->cmdbuf_suballoc);
1610 gpu->cmdbuf_suballoc = NULL;
1611 }
1612
1601 if (gpu->mmu) { 1613 if (gpu->mmu) {
1602 etnaviv_iommu_destroy(gpu->mmu); 1614 etnaviv_iommu_destroy(gpu->mmu);
1603 gpu->mmu = NULL; 1615 gpu->mmu = NULL;
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
index 9c10ffeff77e..1c0606ea7d5e 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
@@ -92,6 +92,7 @@ struct etnaviv_event {
92 struct dma_fence *fence; 92 struct dma_fence *fence;
93}; 93};
94 94
95struct etnaviv_cmdbuf_suballoc;
95struct etnaviv_cmdbuf; 96struct etnaviv_cmdbuf;
96 97
97struct etnaviv_gpu { 98struct etnaviv_gpu {
@@ -135,6 +136,7 @@ struct etnaviv_gpu {
135 int irq; 136 int irq;
136 137
137 struct etnaviv_iommu *mmu; 138 struct etnaviv_iommu *mmu;
139 struct etnaviv_cmdbuf_suballoc *cmdbuf_suballoc;
138 140
139 /* Power Control: */ 141 /* Power Control: */
140 struct clk *clk_bus; 142 struct clk *clk_bus;
@@ -188,9 +190,6 @@ int etnaviv_gpu_wait_obj_inactive(struct etnaviv_gpu *gpu,
188 struct etnaviv_gem_object *etnaviv_obj, struct timespec *timeout); 190 struct etnaviv_gem_object *etnaviv_obj, struct timespec *timeout);
189int etnaviv_gpu_submit(struct etnaviv_gpu *gpu, 191int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
190 struct etnaviv_gem_submit *submit, struct etnaviv_cmdbuf *cmdbuf); 192 struct etnaviv_gem_submit *submit, struct etnaviv_cmdbuf *cmdbuf);
191struct etnaviv_cmdbuf *etnaviv_cmdbuf_new(struct etnaviv_gpu *gpu,
192 u32 size, size_t nr_bos);
193void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf);
194int etnaviv_gpu_pm_get_sync(struct etnaviv_gpu *gpu); 193int etnaviv_gpu_pm_get_sync(struct etnaviv_gpu *gpu);
195void etnaviv_gpu_pm_put(struct etnaviv_gpu *gpu); 194void etnaviv_gpu_pm_put(struct etnaviv_gpu *gpu);
196int etnaviv_gpu_wait_idle(struct etnaviv_gpu *gpu, unsigned int timeout_ms); 195int etnaviv_gpu_wait_idle(struct etnaviv_gpu *gpu, unsigned int timeout_ms);
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
index 056685bd33b2..dcc86d8eeb98 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
@@ -321,55 +321,50 @@ void etnaviv_iommu_restore(struct etnaviv_gpu *gpu)
321 etnaviv_iommuv2_restore(gpu); 321 etnaviv_iommuv2_restore(gpu);
322} 322}
323 323
324u32 etnaviv_iommu_get_cmdbuf_va(struct etnaviv_gpu *gpu, 324int etnaviv_iommu_get_suballoc_va(struct etnaviv_gpu *gpu, dma_addr_t paddr,
325 struct etnaviv_cmdbuf *buf) 325 struct drm_mm_node *vram_node, size_t size,
326 u32 *iova)
326{ 327{
327 struct etnaviv_iommu *mmu = gpu->mmu; 328 struct etnaviv_iommu *mmu = gpu->mmu;
328 329
329 if (mmu->version == ETNAVIV_IOMMU_V1) { 330 if (mmu->version == ETNAVIV_IOMMU_V1) {
330 return buf->paddr - gpu->memory_base; 331 *iova = paddr - gpu->memory_base;
332 return 0;
331 } else { 333 } else {
332 int ret; 334 int ret;
333 335
334 if (buf->vram_node.allocated)
335 return (u32)buf->vram_node.start;
336
337 mutex_lock(&mmu->lock); 336 mutex_lock(&mmu->lock);
338 ret = etnaviv_iommu_find_iova(mmu, &buf->vram_node, 337 ret = etnaviv_iommu_find_iova(mmu, vram_node, size);
339 buf->size + SZ_64K);
340 if (ret < 0) { 338 if (ret < 0) {
341 mutex_unlock(&mmu->lock); 339 mutex_unlock(&mmu->lock);
342 return 0; 340 return ret;
343 } 341 }
344 ret = iommu_map(mmu->domain, buf->vram_node.start, buf->paddr, 342 ret = iommu_map(mmu->domain, vram_node->start, paddr, size,
345 buf->size, IOMMU_READ); 343 IOMMU_READ);
346 if (ret < 0) { 344 if (ret < 0) {
347 drm_mm_remove_node(&buf->vram_node); 345 drm_mm_remove_node(vram_node);
348 mutex_unlock(&mmu->lock); 346 mutex_unlock(&mmu->lock);
349 return 0; 347 return ret;
350 } 348 }
351 /* 349 mmu->last_iova = vram_node->start + size;
352 * At least on GC3000 the FE MMU doesn't properly flush old TLB
353 * entries. Make sure to space the command buffers out in a way
354 * that the FE MMU prefetch won't load invalid entries.
355 */
356 mmu->last_iova = buf->vram_node.start + buf->size + SZ_64K;
357 gpu->mmu->need_flush = true; 350 gpu->mmu->need_flush = true;
358 mutex_unlock(&mmu->lock); 351 mutex_unlock(&mmu->lock);
359 352
360 return (u32)buf->vram_node.start; 353 *iova = (u32)vram_node->start;
354 return 0;
361 } 355 }
362} 356}
363 357
364void etnaviv_iommu_put_cmdbuf_va(struct etnaviv_gpu *gpu, 358void etnaviv_iommu_put_suballoc_va(struct etnaviv_gpu *gpu,
365 struct etnaviv_cmdbuf *buf) 359 struct drm_mm_node *vram_node, size_t size,
360 u32 iova)
366{ 361{
367 struct etnaviv_iommu *mmu = gpu->mmu; 362 struct etnaviv_iommu *mmu = gpu->mmu;
368 363
369 if (mmu->version == ETNAVIV_IOMMU_V2 && buf->vram_node.allocated) { 364 if (mmu->version == ETNAVIV_IOMMU_V2) {
370 mutex_lock(&mmu->lock); 365 mutex_lock(&mmu->lock);
371 iommu_unmap(mmu->domain, buf->vram_node.start, buf->size); 366 iommu_unmap(mmu->domain,iova, size);
372 drm_mm_remove_node(&buf->vram_node); 367 drm_mm_remove_node(vram_node);
373 mutex_unlock(&mmu->lock); 368 mutex_unlock(&mmu->lock);
374 } 369 }
375} 370}
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_mmu.h b/drivers/gpu/drm/etnaviv/etnaviv_mmu.h
index e787e49c9693..54be289e5981 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_mmu.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_mmu.h
@@ -62,10 +62,12 @@ void etnaviv_iommu_unmap_gem(struct etnaviv_iommu *mmu,
62 struct etnaviv_vram_mapping *mapping); 62 struct etnaviv_vram_mapping *mapping);
63void etnaviv_iommu_destroy(struct etnaviv_iommu *iommu); 63void etnaviv_iommu_destroy(struct etnaviv_iommu *iommu);
64 64
65u32 etnaviv_iommu_get_cmdbuf_va(struct etnaviv_gpu *gpu, 65int etnaviv_iommu_get_suballoc_va(struct etnaviv_gpu *gpu, dma_addr_t paddr,
66 struct etnaviv_cmdbuf *buf); 66 struct drm_mm_node *vram_node, size_t size,
67void etnaviv_iommu_put_cmdbuf_va(struct etnaviv_gpu *gpu, 67 u32 *iova);
68 struct etnaviv_cmdbuf *buf); 68void etnaviv_iommu_put_suballoc_va(struct etnaviv_gpu *gpu,
69 struct drm_mm_node *vram_node, size_t size,
70 u32 iova);
69 71
70size_t etnaviv_iommu_dump_size(struct etnaviv_iommu *iommu); 72size_t etnaviv_iommu_dump_size(struct etnaviv_iommu *iommu);
71void etnaviv_iommu_dump(struct etnaviv_iommu *iommu, void *buf); 73void etnaviv_iommu_dump(struct etnaviv_iommu *iommu, void *buf);