diff mbox

[1/2] gpu: ion: Update debugfs to show for each id

Message ID 1346827474-19709-2-git-send-email-zhangfei.gao@marvell.com
State Rejected
Headers show

Commit Message

Zhangfei Gao Sept. 5, 2012, 6:44 a.m. UTC
From: Nishanth Peethambaran <nishanth@broadcom.com>

Update the debugfs read of client and heap to show
based on 'id' instead of 'type'.
Multiple heaps of the same type can be present, but
id is unique.

Signed-off-by: Nishanth Peethambaran <nishanth@broadcom.com>
---
 drivers/gpu/ion/ion.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index 207d00f..96f9cd7 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -579,11 +579,11 @@  static int ion_debug_client_show(struct seq_file *s, void *unused)
 	for (n = rb_first(&client->handles); n; n = rb_next(n)) {
 		struct ion_handle *handle = rb_entry(n, struct ion_handle,
 						     node);
-		enum ion_heap_type type = handle->buffer->heap->type;
+		int id = handle->buffer->heap->id;
 
-		if (!names[type])
-			names[type] = handle->buffer->heap->name;
-		sizes[type] += handle->buffer->size;
+		if (!names[id])
+			names[id] = handle->buffer->heap->name;
+		sizes[id] += handle->buffer->size;
 	}
 	mutex_unlock(&client->lock);
 
@@ -1153,7 +1153,7 @@  static const struct file_operations ion_fops = {
 };
 
 static size_t ion_debug_heap_total(struct ion_client *client,
-				   enum ion_heap_type type)
+				   int id)
 {
 	size_t size = 0;
 	struct rb_node *n;
@@ -1163,7 +1163,7 @@  static size_t ion_debug_heap_total(struct ion_client *client,
 		struct ion_handle *handle = rb_entry(n,
 						     struct ion_handle,
 						     node);
-		if (handle->buffer->heap->type == type)
+		if (handle->buffer->heap->id == id)
 			size += handle->buffer->size;
 	}
 	mutex_unlock(&client->lock);
@@ -1184,7 +1184,7 @@  static int ion_debug_heap_show(struct seq_file *s, void *unused)
 	for (n = rb_first(&dev->clients); n; n = rb_next(n)) {
 		struct ion_client *client = rb_entry(n, struct ion_client,
 						     node);
-		size_t size = ion_debug_heap_total(client, heap->type);
+		size_t size = ion_debug_heap_total(client, heap->id);
 		if (!size)
 			continue;
 		if (client->task) {