diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-09 19:00:24 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-11 17:16:56 -0500 |
commit | 08c18323547ce6d70eab3b37eca894baf114ad85 (patch) | |
tree | 19ebe49ae46b97dae394efaf32d4528cb46ef895 | |
parent | a779e5abda0367aa9d53c0931d9687743afe503d (diff) |
drm/i915/debugfs: Show all objects in the gtt
Useful for determining the layout.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 73914d841856..19a3d58044dd 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -106,10 +106,19 @@ static const char *get_tiling_flag(struct drm_i915_gem_object *obj) | |||
106 | } | 106 | } |
107 | } | 107 | } |
108 | 108 | ||
109 | static const char *agp_type_str(int type) | ||
110 | { | ||
111 | switch (type) { | ||
112 | case 0: return " uncached"; | ||
113 | case 1: return " snooped"; | ||
114 | default: return ""; | ||
115 | } | ||
116 | } | ||
117 | |||
109 | static void | 118 | static void |
110 | describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) | 119 | describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) |
111 | { | 120 | { |
112 | seq_printf(m, "%p: %s%s %8zd %04x %04x %d %d%s%s", | 121 | seq_printf(m, "%p: %s%s %8zd %04x %04x %d %d%s%s%s", |
113 | &obj->base, | 122 | &obj->base, |
114 | get_pin_flag(obj), | 123 | get_pin_flag(obj), |
115 | get_tiling_flag(obj), | 124 | get_tiling_flag(obj), |
@@ -118,6 +127,7 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) | |||
118 | obj->base.write_domain, | 127 | obj->base.write_domain, |
119 | obj->last_rendering_seqno, | 128 | obj->last_rendering_seqno, |
120 | obj->last_fenced_seqno, | 129 | obj->last_fenced_seqno, |
130 | agp_type_str(obj->agp_type == AGP_USER_CACHED_MEMORY), | ||
121 | obj->dirty ? " dirty" : "", | 131 | obj->dirty ? " dirty" : "", |
122 | obj->madv == I915_MADV_DONTNEED ? " purgeable" : ""); | 132 | obj->madv == I915_MADV_DONTNEED ? " purgeable" : ""); |
123 | if (obj->base.name) | 133 | if (obj->base.name) |
@@ -276,6 +286,37 @@ static int i915_gem_object_info(struct seq_file *m, void* data) | |||
276 | return 0; | 286 | return 0; |
277 | } | 287 | } |
278 | 288 | ||
289 | static int i915_gem_gtt_info(struct seq_file *m, void* data) | ||
290 | { | ||
291 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
292 | struct drm_device *dev = node->minor->dev; | ||
293 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
294 | struct drm_i915_gem_object *obj; | ||
295 | size_t total_obj_size, total_gtt_size; | ||
296 | int count, ret; | ||
297 | |||
298 | ret = mutex_lock_interruptible(&dev->struct_mutex); | ||
299 | if (ret) | ||
300 | return ret; | ||
301 | |||
302 | total_obj_size = total_gtt_size = count = 0; | ||
303 | list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) { | ||
304 | seq_printf(m, " "); | ||
305 | describe_obj(m, obj); | ||
306 | seq_printf(m, "\n"); | ||
307 | total_obj_size += obj->base.size; | ||
308 | total_gtt_size += obj->gtt_space->size; | ||
309 | count++; | ||
310 | } | ||
311 | |||
312 | mutex_unlock(&dev->struct_mutex); | ||
313 | |||
314 | seq_printf(m, "Total %d objects, %zu bytes, %zu GTT size\n", | ||
315 | count, total_obj_size, total_gtt_size); | ||
316 | |||
317 | return 0; | ||
318 | } | ||
319 | |||
279 | 320 | ||
280 | static int i915_gem_pageflip_info(struct seq_file *m, void *data) | 321 | static int i915_gem_pageflip_info(struct seq_file *m, void *data) |
281 | { | 322 | { |
@@ -624,15 +665,6 @@ static const char *ring_str(int ring) | |||
624 | } | 665 | } |
625 | } | 666 | } |
626 | 667 | ||
627 | static const char *agp_type_str(int type) | ||
628 | { | ||
629 | switch (type) { | ||
630 | case 0: return " uncached"; | ||
631 | case 1: return " snooped"; | ||
632 | default: return ""; | ||
633 | } | ||
634 | } | ||
635 | |||
636 | static const char *pin_flag(int pinned) | 668 | static const char *pin_flag(int pinned) |
637 | { | 669 | { |
638 | if (pinned > 0) | 670 | if (pinned > 0) |
@@ -1229,6 +1261,7 @@ static int i915_wedged_create(struct dentry *root, struct drm_minor *minor) | |||
1229 | static struct drm_info_list i915_debugfs_list[] = { | 1261 | static struct drm_info_list i915_debugfs_list[] = { |
1230 | {"i915_capabilities", i915_capabilities, 0, 0}, | 1262 | {"i915_capabilities", i915_capabilities, 0, 0}, |
1231 | {"i915_gem_objects", i915_gem_object_info, 0}, | 1263 | {"i915_gem_objects", i915_gem_object_info, 0}, |
1264 | {"i915_gem_gtt", i915_gem_gtt_info, 0}, | ||
1232 | {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, | 1265 | {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, |
1233 | {"i915_gem_flushing", i915_gem_object_list_info, 0, (void *) FLUSHING_LIST}, | 1266 | {"i915_gem_flushing", i915_gem_object_list_info, 0, (void *) FLUSHING_LIST}, |
1234 | {"i915_gem_inactive", i915_gem_object_list_info, 0, (void *) INACTIVE_LIST}, | 1267 | {"i915_gem_inactive", i915_gem_object_list_info, 0, (void *) INACTIVE_LIST}, |