drm/i915: Add information on pinning and fencing to the i915 list debug.
authorEric Anholt <eric@anholt.net>
Wed, 18 Feb 2009 07:53:41 +0000 (23:53 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 27 Mar 2009 22:12:04 +0000 (15:12 -0700)
This was inspired by a patch by Chris Wilson, though none of it applied in any
way due to the debugfs work and I decided to change the formatting of the
new information anyway.

Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_gem_debugfs.c

index 4fc845cee804d13add2e16904f36af92eedd380b..f7e7d3750f8f01fc8061446d3f2beed5befcda0f 100644 (file)
@@ -70,18 +70,27 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
 
        list_for_each_entry(obj_priv, head, list)
        {
+               char *pin_description;
                struct drm_gem_object *obj = obj_priv->obj;
-               if (obj->name) {
-                       seq_printf(m, "    %p(%d): %08x %08x %d\n",
-                                       obj, obj->name,
-                                       obj->read_domains, obj->write_domain,
-                                       obj_priv->last_rendering_seqno);
-               } else {
-                       seq_printf(m, "       %p: %08x %08x %d\n",
-                                       obj,
-                                       obj->read_domains, obj->write_domain,
-                                       obj_priv->last_rendering_seqno);
-               }
+
+               if (obj_priv->user_pin_count > 0)
+                       pin_description = "P";
+               else if (obj_priv->pin_count > 0)
+                       pin_description = "p";
+               else
+                       pin_description = " ";
+
+               seq_printf(m, "    %p: %s %08x %08x %d",
+                          obj,
+                          pin_description,
+                          obj->read_domains, obj->write_domain,
+                          obj_priv->last_rendering_seqno);
+
+               if (obj->name)
+                       seq_printf(m, " (name: %d)", obj->name);
+               if (obj_priv->fence_reg != I915_FENCE_REG_NONE)
+                       seq_printf(m, " (fence: %d\n", obj_priv->fence_reg);
+               seq_printf(m, "\n");
        }
        return 0;
 }