diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 11 |
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 e4893988f401..47e3a8fdcc6d 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) | |||
135 | struct drm_device *dev = node->minor->dev; | 135 | struct drm_device *dev = node->minor->dev; |
136 | drm_i915_private_t *dev_priv = dev->dev_private; | 136 | drm_i915_private_t *dev_priv = dev->dev_private; |
137 | struct drm_i915_gem_object *obj_priv; | 137 | struct drm_i915_gem_object *obj_priv; |
138 | int ret; | 138 | size_t total_obj_size, total_gtt_size; |
139 | int count, ret; | ||
139 | 140 | ||
140 | ret = mutex_lock_interruptible(&dev->struct_mutex); | 141 | ret = mutex_lock_interruptible(&dev->struct_mutex); |
141 | if (ret) | 142 | if (ret) |
@@ -171,13 +172,19 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
171 | return -EINVAL; | 172 | return -EINVAL; |
172 | } | 173 | } |
173 | 174 | ||
175 | total_obj_size = total_gtt_size = count = 0; | ||
174 | list_for_each_entry(obj_priv, head, list) { | 176 | list_for_each_entry(obj_priv, head, list) { |
175 | seq_printf(m, " "); | 177 | seq_printf(m, " "); |
176 | describe_obj(m, obj_priv); | 178 | describe_obj(m, obj_priv); |
177 | seq_printf(m, "\n"); | 179 | seq_printf(m, "\n"); |
180 | total_obj_size += obj_priv->base.size; | ||
181 | total_gtt_size += obj_priv->gtt_space->size; | ||
182 | count++; | ||
178 | } | 183 | } |
179 | |||
180 | mutex_unlock(&dev->struct_mutex); | 184 | mutex_unlock(&dev->struct_mutex); |
185 | |||
186 | seq_printf(m, "Total %d objects, %zu bytes, %zu GTT size\n", | ||
187 | count, total_obj_size, total_gtt_size); | ||
181 | return 0; | 188 | return 0; |
182 | } | 189 | } |
183 | 190 | ||