diff options
| author | Benjamin Gaignard <benjamin.gaignard@linaro.org> | 2013-03-22 18:08:30 +0100 | 
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2013-09-19 13:50:05 -0500 | 
| commit | ae2b22e9b7a207d9392df5b5ec93b8c042d4b3ce (patch) | |
| tree | 857e3ce98094abcff9d4f076e0a7e9d61d6937c2 /drivers/gpu/ion/ion_heap.c | |
| parent | 0a87e75ab5ab0d8a14a3f293d4970f9b3e50bf6e (diff) | |
| download | olio-linux-3.10-ae2b22e9b7a207d9392df5b5ec93b8c042d4b3ce.tar.xz olio-linux-3.10-ae2b22e9b7a207d9392df5b5ec93b8c042d4b3ce.zip | |
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 <benjamin.gaignard@linaro.org>
Diffstat (limited to 'drivers/gpu/ion/ion_heap.c')
| -rw-r--r-- | drivers/gpu/ion/ion_heap.c | 6 | 
1 files changed, 6 insertions, 0 deletions
| 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); |