drm/rockchip: add DRM_RENDER_ALLOW
[firefly-linux-kernel-4.4.55.git] / include / linux / rockchip_ion.h
index 4e78235cba31adaa69211ef0788f350920a02ea5..39c497774fb09926e3282dbf71648777c0e6d716 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2014 ROCKCHIP, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
 #include <linux/ion.h>
 #endif
 
-enum ion_heap_ids {
-       INVALID_HEAP_ID = -1,
-       ION_CMA_HEAP_ID = 1,
-       ION_IOMMU_HEAP_ID,
-       ION_SYSTEM_HEAP_ID,
-       ION_DRM_HEAP_ID,
-
-       ION_HEAP_ID_RESERVED = 31
-};
-
-#define ION_HEAP(bit) (1 << (bit))
-
-#define ION_CMA_HEAP_NAME              "cma"
-#define ION_IOMMU_HEAP_NAME            "iommu"
-#define ION_SYSTEM_HEAP_NAME   "vmalloc"
-#define ION_DRM_HEAP_NAME              "drm"
-
-#define ION_SET_CACHED(__cache)                (__cache | ION_FLAG_CACHED)
-#define ION_SET_UNCACHED(__cache)      (__cache & ~ION_FLAG_CACHED)
-
-#define ION_IS_CACHED(__flags) ((__flags) & ION_FLAG_CACHED)
-
-/* struct ion_flush_data - data passed to ion for flushing caches
- *
- * @handle:    handle with data to flush
- * @fd:                fd to flush
- * @vaddr:     userspace virtual address mapped with mmap
- * @offset:    offset into the handle to flush
- * @length:    length of handle to flush
- *
- * Performs cache operations on the handle. If p is the start address
- * of the handle, p + offset through p + offset + length will have
- * the cache operations performed
- */
-struct ion_flush_data {
-       ion_user_handle_t handle;
-       int fd;
-       void *vaddr;
-       unsigned int offset;
-       unsigned int length;
-};
-
 struct ion_phys_data {
        ion_user_handle_t handle;
        unsigned long phys;
        unsigned long size;
 };
 
-struct ion_share_obj_data {
-       int fd;
-       void *obj;
-};
-
 #define ION_IOC_ROCKCHIP_MAGIC 'R'
 
-/**
- * Clean the caches of the handle specified.
- */
-#define ION_IOC_CLEAN_CACHES   _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, \
-                                               struct ion_flush_data)
-/**
- * Invalidate the caches of the handle specified.
- */
-#define ION_IOC_INV_CACHES     _IOWR(ION_IOC_ROCKCHIP_MAGIC, 1, \
-                                               struct ion_flush_data)
-/**
- * Clean and invalidate the caches of the handle specified.
- */
-#define ION_IOC_CLEAN_INV_CACHES       _IOWR(ION_IOC_ROCKCHIP_MAGIC, 2, \
-                                               struct ion_flush_data)
-
-/**
- * Get phys addr of the handle specified.
- */
-#define ION_IOC_GET_PHYS       _IOWR(ION_IOC_ROCKCHIP_MAGIC, 3, \
+/* Get phys addr of the handle specified. */
+#define ION_IOC_GET_PHYS       _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, \
                                                struct ion_phys_data)
 
-/**
- * Get share object of the fd specified.
- */
-#define ION_IOC_GET_SHARE      _IOWR(ION_IOC_ROCKCHIP_MAGIC, 4, \
-                                               struct ion_share_obj_data)
+extern struct ion_device *rockchip_ion_dev;
 
-/**
- * Set share object and associate new fd.
- */
-#define ION_IOC_SET_SHARE      _IOWR(ION_IOC_ROCKCHIP_MAGIC, 5, \
-                                               struct ion_share_obj_data)
+struct ion_client *rockchip_ion_client_create(const char *name);
 
 #endif