aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>2013-03-22 18:08:30 +0100
committerColin Cross <ccross@android.com>2013-09-19 13:50:05 -0500
commitae2b22e9b7a207d9392df5b5ec93b8c042d4b3ce (patch)
tree857e3ce98094abcff9d4f076e0a7e9d61d6937c2 /include
parent0a87e75ab5ab0d8a14a3f293d4970f9b3e50bf6e (diff)
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 'include')
-rw-r--r--include/linux/ion.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/ion.h b/include/linux/ion.h
index 2ce49d05fa6..440f4b3b0a4 100644
--- a/include/linux/ion.h
+++ b/include/linux/ion.h
@@ -27,6 +27,7 @@ struct ion_handle;
* @ION_HEAP_TYPE_CARVEOUT: memory allocated from a prereserved
* carveout heap, allocations are physically
* contiguous
+ * @ION_HEAP_TYPE_DMA: memory allocated via DMA API
* @ION_NUM_HEAPS: helper for iterating over heaps, a bit mask
* is used to identify the heaps, so only 32
* total heap types are supported
@@ -36,6 +37,7 @@ enum ion_heap_type {
ION_HEAP_TYPE_SYSTEM_CONTIG,
ION_HEAP_TYPE_CARVEOUT,
ION_HEAP_TYPE_CHUNK,
+ ION_HEAP_TYPE_DMA,
ION_HEAP_TYPE_CUSTOM, /* must be last so device specific heaps always
are at the end of this enum */
ION_NUM_HEAPS = 16,
@@ -44,6 +46,7 @@ enum ion_heap_type {
#define ION_HEAP_SYSTEM_MASK (1 << ION_HEAP_TYPE_SYSTEM)
#define ION_HEAP_SYSTEM_CONTIG_MASK (1 << ION_HEAP_TYPE_SYSTEM_CONTIG)
#define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT)
+#define ION_HEAP_TYPE_DMA_MASK (1 << ION_HEAP_TYPE_DMA)
#define ION_NUM_HEAP_IDS sizeof(unsigned int) * 8