gpu: ion: Don't flush allocatoins that come from the page pools
authorRebecca Schultz Zavin <rebecca@android.com>
Fri, 19 Oct 2012 04:54:01 +0000 (21:54 -0700)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 21:16:12 +0000 (14:16 -0700)
Change-Id: Ib08cb2cea3b6ea4b1ebf5a1b28abe6b9374fd2bd
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
drivers/gpu/ion/ion_system_heap.c

index 2dc3048ed6f66f807fb48082ff4718d770846f2e..26e6bbcda7020a8b046bdc93e0f2139bc65b4907 100644 (file)
@@ -76,9 +76,14 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap,
                if (order > 4)
                        gfp_flags = high_order_gfp_flags;
                page = alloc_pages(gfp_flags, order);
+               if (!page)
+                       return 0;
+               __dma_page_cpu_to_dev(page, 0, PAGE_SIZE << order,
+                                     DMA_BIDIRECTIONAL);
        }
        if (!page)
                return 0;
+
        if (split_pages)
                split_page(page, order);
        return page;
@@ -201,9 +206,6 @@ static int ion_system_heap_allocate(struct ion_heap *heap,
                kfree(info);
        }
 
-       dma_sync_sg_for_device(NULL, table->sgl, table->nents,
-                              DMA_BIDIRECTIONAL);
-
        buffer->priv_virt = table;
        return 0;
 err1: