gpu: ion: Add support for carveout heaps on msm targets
Add infrastructure for supporting ion carveout heaps.
The memory type should be specified in the board file using
mach/ion.h. The ion platform driver will be responsible for
allocating the correct memory.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/include/linux/ion.h b/include/linux/ion.h
index 5a855e9..d6dcf38 100644
--- a/include/linux/ion.h
+++ b/include/linux/ion.h
@@ -18,6 +18,7 @@
#define _LINUX_ION_H
#include <linux/types.h>
+#include <mach/ion.h>
struct ion_handle;
/**
@@ -42,6 +43,25 @@
#define ION_HEAP_SYSTEM_CONTIG_MASK (1 << ION_HEAP_TYPE_SYSTEM_CONTIG)
#define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT)
+
+/**
+ * These are the only ids that should be used for Ion heap ids.
+ * The ids listed are the order in which allocation will be attempted
+ * if specified. Don't swap the order of heap ids unless you know what
+ * you are doing!
+ */
+
+enum ion_heap_ids {
+ ION_HEAP_SYSTEM_ID,
+ ION_HEAP_SYSTEM_CONTIG_ID,
+ ION_HEAP_EBI_ID,
+ ION_HEAP_SMI_ID,
+};
+
+#define ION_KMALLOC_HEAP_NAME "kmalloc"
+#define ION_VMALLOC_HEAP_NAME "vmalloc"
+#define ION_EBI1_HEAP_NAME "EBI1"
+
#ifdef __KERNEL__
struct ion_device;
struct ion_heap;
@@ -72,6 +92,7 @@
const char *name;
ion_phys_addr_t base;
size_t size;
+ enum ion_memory_types memory_type;
};
/**