aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/ion/omap/omap_tiler_heap.c')
-rw-r--r--drivers/gpu/ion/omap/omap_tiler_heap.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/ion/omap/omap_tiler_heap.c b/drivers/gpu/ion/omap/omap_tiler_heap.c
index af4988ad212..cbd16cf6c52 100644
--- a/drivers/gpu/ion/omap/omap_tiler_heap.c
+++ b/drivers/gpu/ion/omap/omap_tiler_heap.c
@@ -55,6 +55,7 @@ struct omap_tiler_info {
55 u32 vsize; /* virtual stride of buffer */ 55 u32 vsize; /* virtual stride of buffer */
56 u32 vstride; /* virtual size of buffer */ 56 u32 vstride; /* virtual size of buffer */
57 u32 phys_stride; /* Physical stride of the buffer */ 57 u32 phys_stride; /* Physical stride of the buffer */
58 u32 flags; /* Flags specifying cached or not */
58}; 59};
59 60
60static int omap_tiler_heap_allocate(struct ion_heap *heap, 61static int omap_tiler_heap_allocate(struct ion_heap *heap,
@@ -62,6 +63,8 @@ static int omap_tiler_heap_allocate(struct ion_heap *heap,
62 unsigned long size, unsigned long align, 63 unsigned long size, unsigned long align,
63 unsigned long flags) 64 unsigned long flags)
64{ 65{
66 struct omap_tiler_info *info;
67
65 /* This means the buffer is already allocated and populated, we're getting here because 68 /* This means the buffer is already allocated and populated, we're getting here because
66 * of dummy handle creation, so simply return*/ 69 * of dummy handle creation, so simply return*/
67 if (size == 0) { 70 if (size == 0) {
@@ -70,7 +73,12 @@ static int omap_tiler_heap_allocate(struct ion_heap *heap,
70 * This will be used later on inside map_dma function to create 73 * This will be used later on inside map_dma function to create
71 * the sg list for tiler buffer 74 * the sg list for tiler buffer
72 */ 75 */
73 buffer->priv_virt = (void *)flags; 76 info = (struct omap_tiler_info *) flags;
77 if (!info)
78 pr_err("%s: flags argument is not setupg\n", __func__);
79 buffer->priv_virt = info;
80 /* Re-update correct flags inside buffer */
81 buffer->flags = info->flags;
74 return 0; 82 return 0;
75 } 83 }
76 84
@@ -174,6 +182,7 @@ int omap_tiler_alloc(struct ion_heap *heap,
174 info->phys_addrs = (u32 *)(info + 1); 182 info->phys_addrs = (u32 *)(info + 1);
175 info->tiler_addrs = info->phys_addrs + n_phys_pages; 183 info->tiler_addrs = info->phys_addrs + n_phys_pages;
176 info->fmt = data->fmt; 184 info->fmt = data->fmt;
185 info->flags = data->flags;
177 186
178 /* Allocate tiler space 187 /* Allocate tiler space
179 FIXME: we only support PAGE_SIZE alignment right now. */ 188 FIXME: we only support PAGE_SIZE alignment right now. */
@@ -330,9 +339,9 @@ static int omap_tiler_heap_map_user(struct ion_heap *heap,
330 int i, ret = 0; 339 int i, ret = 0;
331 pgprot_t vm_page_prot; 340 pgprot_t vm_page_prot;
332 341
333 /* Use writecombined mappings unless on OMAP5. If OMAP5, use 342 /* Use writecombined mappings unless on OMAP5 or DRA7. If OMAP5 or DRA7, use
334 shared device due to h/w issue. */ 343 shared device due to h/w issue. */
335 if (soc_is_omap54xx()) 344 if (soc_is_omap54xx() || soc_is_dra7xx())
336 vm_page_prot = __pgprot_modify(vma->vm_page_prot, L_PTE_MT_MASK, 345 vm_page_prot = __pgprot_modify(vma->vm_page_prot, L_PTE_MT_MASK,
337 L_PTE_MT_DEV_SHARED); 346 L_PTE_MT_DEV_SHARED);
338 else 347 else