ion: ioctl compatibility with userland using old api

As far as I can tell, flags passed by userland are now used to determine
buffer caching.

Note in ION_IOC_ALLOC_COMPAT we are currently forcing uncached buffer
allocations (needed to make a choice here).  This
may need to change.

Signed-off-by: Flemmard <flemmard@gmail.com>
diff --git a/include/linux/msm_ion.h b/include/linux/msm_ion.h
index 86dd70a..1437bfa 100644
--- a/include/linux/msm_ion.h
+++ b/include/linux/msm_ion.h
@@ -91,6 +91,17 @@
  * Macro should be used with ion_heap_ids defined above.
  */
 #define ION_HEAP(bit) (1 << (bit))
+#define ion_full_heap_mask (ION_HEAP(ION_CP_MM_HEAP_ID) | \
+			   ION_HEAP(ION_CP_MFC_HEAP_ID) | \
+			   ION_HEAP(ION_CP_WB_HEAP_ID) | \
+			   ION_HEAP(ION_CAMERA_HEAP_ID) | \
+			   ION_HEAP(ION_SF_HEAP_ID) | \
+			   ION_HEAP(ION_IOMMU_HEAP_ID) | \
+			   ION_HEAP(ION_QSECOM_HEAP_ID) | \
+			   ION_HEAP(ION_AUDIO_HEAP_ID) | \
+			   ION_HEAP(ION_MM_FIRMWARE_HEAP_ID) | \
+			   ION_HEAP(ION_SYSTEM_HEAP_ID) )
+
 
 #define ION_ADSP_HEAP_NAME	"adsp"
 #define ION_VMALLOC_HEAP_NAME	"vmalloc"
@@ -274,6 +285,7 @@
  * of the handle, p + offset through p + offset + length will have
  * the cache operations performed
  */
+/*
 struct ion_flush_data {
 	struct ion_handle *handle;
 	int fd;
@@ -281,7 +293,7 @@
 	unsigned int offset;
 	unsigned int length;
 };
-
+*/
 /* struct ion_flag_data - information about flags for this buffer
  *
  * @handle:	handle to get flags from
@@ -290,11 +302,12 @@
  * Takes handle as an input and outputs the flags from the handle
  * in the flag field.
  */
+/*
 struct ion_flag_data {
 	struct ion_handle *handle;
 	unsigned long flags;
 };
-
+*/
 #define ION_IOC_MSM_MAGIC 'M'
 
 /**
@@ -304,6 +317,7 @@
  */
 #define ION_IOC_CLEAN_CACHES	_IOWR(ION_IOC_MSM_MAGIC, 0, \
 						struct ion_flush_data)
+
 /**
  * DOC: ION_IOC_INV_CACHES - invalidate the caches
  *
@@ -327,5 +341,4 @@
  */
 #define ION_IOC_GET_FLAGS		_IOWR(ION_IOC_MSM_MAGIC, 3, \
 						struct ion_flag_data)
-
 #endif