diff mbox

[68/70] drm/i915: Simplify vma-walker for i915_gem_objects

Message ID 1428424108-13650-10-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson April 7, 2015, 4:28 p.m. UTC
When walking the vma of the GGTT, we already have the node size
available, so no need to do a double lookup. To further simplify, just
ignore the mappable counts, which will be useful for inspecting other VM
later.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 6508eec3cf60..7c84420b374f 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -405,12 +405,8 @@  static void print_batch_pool_stats(struct seq_file *m,
 
 #define count_vmas(list, member) do { \
 	list_for_each_entry(vma, list, member) { \
-		size += i915_gem_obj_ggtt_size(vma->obj); \
+		size += vma->node.size; \
 		++count; \
-		if (vma->obj->map_and_fenceable) { \
-			mappable_size += i915_gem_obj_ggtt_size(vma->obj); \
-			++mappable_count; \
-		} \
 	} \
 } while (0)
 
@@ -440,15 +436,13 @@  static int i915_gem_object_info(struct seq_file *m, void* data)
 	seq_printf(m, "%u [%u] objects, %zu [%zu] bytes in gtt\n",
 		   count, mappable_count, size, mappable_size);
 
-	size = count = mappable_size = mappable_count = 0;
+	size = count = 0;
 	count_vmas(&vm->active_list, mm_list);
-	seq_printf(m, "  %u [%u] active objects, %zu [%zu] bytes\n",
-		   count, mappable_count, size, mappable_size);
+	seq_printf(m, "  %u active objects, %zu bytes\n", count, size);
 
-	size = count = mappable_size = mappable_count = 0;
+	size = count = 0;
 	count_vmas(&vm->inactive_list, mm_list);
-	seq_printf(m, "  %u [%u] inactive objects, %zu [%zu] bytes\n",
-		   count, mappable_count, size, mappable_size);
+	seq_printf(m, "  %u inactive objects, %zu bytes\n", count, size);
 
 	size = count = purgeable_size = purgeable_count = 0;
 	list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list) {