diff options
author | Arve Hjønnevåg | 2012-11-26 19:14:58 -0600 |
---|---|---|
committer | Arve Hjønnevåg | 2013-02-22 17:27:47 -0600 |
commit | c0ec0fb6622d2d460fbb85d1c5377e79c93ffb54 (patch) | |
tree | 4f3b0dfa3a968c33b0b2c813c3fd49c530437ef5 | |
parent | e0b721361db3128b57e741c3e21b774f58502bba (diff) | |
download | kernel-common-c0ec0fb6622d2d460fbb85d1c5377e79c93ffb54.tar.gz kernel-common-c0ec0fb6622d2d460fbb85d1c5377e79c93ffb54.tar.xz kernel-common-c0ec0fb6622d2d460fbb85d1c5377e79c93ffb54.zip |
gpu: ion: __dma_page_cpu_to_dev -> arm_dma_ops.sync_single_for_device hack
Signed-off-by: Arve Hjønnevåg <arve@android.com>
-rw-r--r-- | drivers/gpu/ion/ion_chunk_heap.c | 10 | ||||
-rw-r--r-- | drivers/gpu/ion/ion_page_pool.c | 6 | ||||
-rw-r--r-- | drivers/gpu/ion/ion_system_heap.c | 5 |
3 files changed, 13 insertions, 8 deletions
diff --git a/drivers/gpu/ion/ion_chunk_heap.c b/drivers/gpu/ion/ion_chunk_heap.c index 687af63b9f5..3e77de59223 100644 --- a/drivers/gpu/ion/ion_chunk_heap.c +++ b/drivers/gpu/ion/ion_chunk_heap.c | |||
@@ -105,8 +105,9 @@ static void ion_chunk_heap_free(struct ion_buffer *buffer) | |||
105 | 105 | ||
106 | for_each_sg(table->sgl, sg, table->nents, i) { | 106 | for_each_sg(table->sgl, sg, table->nents, i) { |
107 | if (ion_buffer_cached(buffer)) | 107 | if (ion_buffer_cached(buffer)) |
108 | __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), | 108 | arm_dma_ops.sync_single_for_device(NULL, |
109 | DMA_BIDIRECTIONAL); | 109 | pfn_to_dma(NULL, page_to_pfn(sg_page(sg))), |
110 | sg_dma_len(sg), DMA_BIDIRECTIONAL); | ||
110 | gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), | 111 | gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), |
111 | sg_dma_len(sg)); | 112 | sg_dma_len(sg)); |
112 | } | 113 | } |
@@ -155,8 +156,9 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data) | |||
155 | chunk_heap->base = heap_data->base; | 156 | chunk_heap->base = heap_data->base; |
156 | chunk_heap->size = heap_data->size; | 157 | chunk_heap->size = heap_data->size; |
157 | chunk_heap->allocated = 0; | 158 | chunk_heap->allocated = 0; |
158 | __dma_page_cpu_to_dev(phys_to_page(heap_data->base), 0, heap_data->size, | 159 | arm_dma_ops.sync_single_for_device(NULL, |
159 | DMA_BIDIRECTIONAL); | 160 | pfn_to_dma(NULL, page_to_pfn(phys_to_page(heap_data->base))), |
161 | heap_data->size, DMA_BIDIRECTIONAL); | ||
160 | gen_pool_add(chunk_heap->pool, chunk_heap->base, heap_data->size, -1); | 162 | gen_pool_add(chunk_heap->pool, chunk_heap->base, heap_data->size, -1); |
161 | chunk_heap->heap.ops = &chunk_heap_ops; | 163 | chunk_heap->heap.ops = &chunk_heap_ops; |
162 | chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK; | 164 | chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK; |
diff --git a/drivers/gpu/ion/ion_page_pool.c b/drivers/gpu/ion/ion_page_pool.c index cd57b30e875..7158d9e5560 100644 --- a/drivers/gpu/ion/ion_page_pool.c +++ b/drivers/gpu/ion/ion_page_pool.c | |||
@@ -43,8 +43,10 @@ static void *ion_page_pool_alloc_pages(struct ion_page_pool *pool) | |||
43 | /* this is only being used to flush the page for dma, | 43 | /* this is only being used to flush the page for dma, |
44 | this api is not really suitable for calling from a driver | 44 | this api is not really suitable for calling from a driver |
45 | but no better way to flush a page for dma exist at this time */ | 45 | but no better way to flush a page for dma exist at this time */ |
46 | __dma_page_cpu_to_dev(page, 0, PAGE_SIZE << pool->order, | 46 | arm_dma_ops.sync_single_for_device(NULL, |
47 | DMA_BIDIRECTIONAL); | 47 | pfn_to_dma(NULL, page_to_pfn(page)), |
48 | PAGE_SIZE << pool->order, | ||
49 | DMA_BIDIRECTIONAL); | ||
48 | return page; | 50 | return page; |
49 | } | 51 | } |
50 | 52 | ||
diff --git a/drivers/gpu/ion/ion_system_heap.c b/drivers/gpu/ion/ion_system_heap.c index c1061a801a4..1e06bd97831 100644 --- a/drivers/gpu/ion/ion_system_heap.c +++ b/drivers/gpu/ion/ion_system_heap.c | |||
@@ -78,8 +78,9 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap, | |||
78 | page = alloc_pages(gfp_flags, order); | 78 | page = alloc_pages(gfp_flags, order); |
79 | if (!page) | 79 | if (!page) |
80 | return 0; | 80 | return 0; |
81 | __dma_page_cpu_to_dev(page, 0, PAGE_SIZE << order, | 81 | arm_dma_ops.sync_single_for_device(NULL, |
82 | DMA_BIDIRECTIONAL); | 82 | pfn_to_dma(NULL, page_to_pfn(page)), |
83 | PAGE_SIZE << order, DMA_BIDIRECTIONAL); | ||
83 | } | 84 | } |
84 | if (!page) | 85 | if (!page) |
85 | return 0; | 86 | return 0; |