summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_debugfs.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-26 11:44:19 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-30 09:30:12 +0100
commit8f2480fb05991f1a5522dd48332cd9db4f7745c6 (patch)
treead5d0eb418249096e1ee3ce13fb94bb98723f6bf /drivers/gpu/drm/i915/i915_debugfs.c
parentd21d5975686fbc107f9352006b06e1e92b4c5810 (diff)
drm/i915/debugfs: Include list totals
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index e4893988f40..47e3a8fdcc6 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -135,7 +135,8 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
struct drm_device *dev = node->minor->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_i915_gem_object *obj_priv;
- int ret;
+ size_t total_obj_size, total_gtt_size;
+ int count, ret;
ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
@@ -171,13 +172,19 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
return -EINVAL;
}
+ total_obj_size = total_gtt_size = count = 0;
list_for_each_entry(obj_priv, head, list) {
seq_printf(m, " ");
describe_obj(m, obj_priv);
seq_printf(m, "\n");
+ total_obj_size += obj_priv->base.size;
+ total_gtt_size += obj_priv->gtt_space->size;
+ count++;
}
-
mutex_unlock(&dev->struct_mutex);
+
+ seq_printf(m, "Total %d objects, %zu bytes, %zu GTT size\n",
+ count, total_obj_size, total_gtt_size);
return 0;
}