diff mbox

[1/3] make struct ion_device available for other heap

Message ID 1331547431-3737-2-git-send-email-benjamin.gaignard@stericsson.com
State New
Headers show

Commit Message

Benjamin Gaignard March 12, 2012, 10:17 a.m. UTC
From: Benjamin Gaignard <benjamin.gaignard@linaro.org>

CMA heap needs to know misc device to be able to do the link between
ION heap and CMA area reserved in board configuration file.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
---
 drivers/gpu/ion/ion.c      |   20 --------------------
 drivers/gpu/ion/ion_priv.h |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+), 20 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index 37b23af..dbfdd7e 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -34,26 +34,6 @@ 
 #define DEBUG
 
 /**
- * struct ion_device - the metadata of the ion device node
- * @dev:		the actual misc device
- * @buffers:	an rb tree of all the existing buffers
- * @lock:		lock protecting the buffers & heaps trees
- * @heaps:		list of all the heaps in the system
- * @user_clients:	list of all the clients created from userspace
- */
-struct ion_device {
-	struct miscdevice dev;
-	struct rb_root buffers;
-	struct mutex lock;
-	struct rb_root heaps;
-	long (*custom_ioctl) (struct ion_client *client, unsigned int cmd,
-			      unsigned long arg);
-	struct rb_root user_clients;
-	struct rb_root kernel_clients;
-	struct dentry *debug_root;
-};
-
-/**
  * struct ion_client - a process/hw block local address space
  * @ref:		for reference counting the client
  * @node:		node in the tree of all clients
diff --git a/drivers/gpu/ion/ion_priv.h b/drivers/gpu/ion/ion_priv.h
index 3323954..82e44ea 100644
--- a/drivers/gpu/ion/ion_priv.h
+++ b/drivers/gpu/ion/ion_priv.h
@@ -22,6 +22,8 @@ 
 #include <linux/mutex.h>
 #include <linux/rbtree.h>
 #include <linux/ion.h>
+#include <linux/miscdevice.h>
+#include <linux/rbtree.h>
 
 struct ion_mapping;
 
@@ -38,6 +40,26 @@  struct ion_kernel_mapping {
 struct ion_buffer *ion_handle_buffer(struct ion_handle *handle);
 
 /**
+ * struct ion_device - the metadata of the ion device node
+ * @dev:		the actual misc device
+ * @buffers:	an rb tree of all the existing buffers
+ * @lock:		lock protecting the buffers & heaps trees
+ * @heaps:		list of all the heaps in the system
+ * @user_clients:	list of all the clients created from userspace
+ */
+struct ion_device {
+	struct miscdevice dev;
+	struct rb_root buffers;
+	struct mutex lock;
+	struct rb_root heaps;
+	long (*custom_ioctl) (struct ion_client *client, unsigned int cmd,
+			      unsigned long arg);
+	struct rb_root user_clients;
+	struct rb_root kernel_clients;
+	struct dentry *debug_root;
+};
+
+/**
  * struct ion_buffer - metadata for a particular buffer
  * @ref:		refernce count
  * @node:		node in the ion_device buffers tree