From ae2b22e9b7a207d9392df5b5ec93b8c042d4b3ce Mon Sep 17 00:00:00 2001 From: Benjamin Gaignard Date: Fri, 22 Mar 2013 18:08:30 +0100 Subject: gpu: ion: add CMA heap New heap type ION_HEAP_TYPE_DMA where allocation is done with dma_alloc_coherent API. device coherent_dma_mask must be set to DMA_BIT_MASK(32). ion_platform_heap private field is used to retrieve the device linked to CMA, if NULL the default CMA area is used. ion_cma_get_sgtable is a copy of dma_common_get_sgtable function which should be in kernel 3.5 Change-Id: If4b1a3f9c8a6bd72053226208832f4971e44372f Signed-off-by: Benjamin Gaignard --- drivers/gpu/ion/ion_heap.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/ion/ion_heap.c') diff --git a/drivers/gpu/ion/ion_heap.c b/drivers/gpu/ion/ion_heap.c index 4a16aa27384..05e7ce5499c 100644 --- a/drivers/gpu/ion/ion_heap.c +++ b/drivers/gpu/ion/ion_heap.c @@ -254,6 +254,9 @@ struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data) case ION_HEAP_TYPE_CHUNK: heap = ion_chunk_heap_create(heap_data); break; + case ION_HEAP_TYPE_DMA: + heap = ion_cma_heap_create(heap_data); + break; default: pr_err("%s: Invalid heap type %d\n", __func__, heap_data->type); @@ -290,6 +293,9 @@ void ion_heap_destroy(struct ion_heap *heap) case ION_HEAP_TYPE_CHUNK: ion_chunk_heap_destroy(heap); break; + case ION_HEAP_TYPE_DMA: + ion_cma_heap_destroy(heap); + break; default: pr_err("%s: Invalid heap type %d\n", __func__, heap->type); -- cgit v1.2.3-70-g09d2