gpu: ion: Refactor debugfs printing
Printing to debugfs is done from a centralized location for
all the heaps managed by ion. This architecture is not
sustainable in the long run since different heaps have different
requirements for what should be printed.
Refactor the debugfs printing for ion so that each heap is
responsible for printing its information.
Change-Id: I1dbe13432a4ab07f27ea4756c3be7fa01ad1df92
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index ec93055..34145fe 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -1605,30 +1605,8 @@
seq_printf(s, "%16.s %16u %16x\n", client->name, client->pid,
size);
}
- if (heap->ops->get_allocated) {
- seq_printf(s, "total bytes currently allocated: %lx\n",
- heap->ops->get_allocated(heap));
- }
- if (heap->ops->get_total) {
- seq_printf(s, "total heap size: %lx\n",
- heap->ops->get_total(heap));
- }
- if (heap->ops->get_alloc_cnt) {
- seq_printf(s, "allocation count: %lx\n",
- heap->ops->get_alloc_cnt(heap));
- }
- if (heap->ops->get_umap_cnt) {
- seq_printf(s, "umapping count: %lx\n",
- heap->ops->get_umap_cnt(heap));
- }
- if (heap->ops->get_kmap_cnt) {
- seq_printf(s, "kmapping count: %lx\n",
- heap->ops->get_kmap_cnt(heap));
- }
- if (heap->ops->get_secured) {
- seq_printf(s, "secured heap: %s\n",
- heap->ops->get_secured(heap) ? "Yes" : "No");
- }
+ if (heap->ops->print_debug)
+ heap->ops->print_debug(heap, s);
return 0;
}