gpu: ion: Add debug information for individual heaps

Currently, the debugfs information provides aggregated data
for all carveout heaps. This isn't particularly helpful for
determining allocation problems with individual carveout heaps.
Fix this to give data for individual carveout heaps.

Change-Id: I60a10851052412e20c40f1862d6dcc22093fd982
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
This commit is contained in:
Laura Abbott
2011-10-31 14:09:53 -07:00
committed by Stephen Boyd
parent 48db6b1d83
commit 0552ef6bd3

View File

@@ -1091,7 +1091,7 @@ static const struct file_operations ion_fops = {
}; };
static size_t ion_debug_heap_total(struct ion_client *client, static size_t ion_debug_heap_total(struct ion_client *client,
enum ion_heap_type type) enum ion_heap_ids id)
{ {
size_t size = 0; size_t size = 0;
struct rb_node *n; struct rb_node *n;
@@ -1101,7 +1101,7 @@ static size_t ion_debug_heap_total(struct ion_client *client,
struct ion_handle *handle = rb_entry(n, struct ion_handle *handle = rb_entry(n,
struct ion_handle, struct ion_handle,
node); node);
if (handle->buffer->heap->type == type) if (handle->buffer->heap->id == id)
size += handle->buffer->size; size += handle->buffer->size;
} }
mutex_unlock(&client->lock); mutex_unlock(&client->lock);
@@ -1119,7 +1119,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
for (n = rb_first(&dev->clients); n; n = rb_next(n)) { for (n = rb_first(&dev->clients); n; n = rb_next(n)) {
struct ion_client *client = rb_entry(n, struct ion_client, struct ion_client *client = rb_entry(n, struct ion_client,
node); node);
size_t size = ion_debug_heap_total(client, heap->type); size_t size = ion_debug_heap_total(client, heap->id);
if (!size) if (!size)
continue; continue;
if (client->task) { if (client->task) {