aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-02-11 09:26:38 -0500
committerEric Anholt <eric@anholt.net>2009-03-27 18:12:05 -0400
commita6172a80ecb7ac64151960de1f709f78b509c57c (patch)
treef48b79553ef52da67ce75f3a7f47f994dfc44604 /drivers/gpu
parentf4ceda89895b56e2c03dd327f13d0256838a20ab (diff)
drm/i915: Display fence register state in debugfs i915_gem_fence_regs node.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_debugfs.c66
1 files changed, 57 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_debugfs.c b/drivers/gpu/drm/i915/i915_gem_debugfs.c
index f7e7d3750f8f..5a4cdb5d2871 100644
--- a/drivers/gpu/drm/i915/i915_gem_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_gem_debugfs.c
@@ -41,6 +41,26 @@
41#define FLUSHING_LIST 2 41#define FLUSHING_LIST 2
42#define INACTIVE_LIST 3 42#define INACTIVE_LIST 3
43 43
44static const char *get_pin_flag(struct drm_i915_gem_object *obj_priv)
45{
46 if (obj_priv->user_pin_count > 0)
47 return "P";
48 else if (obj_priv->pin_count > 0)
49 return "p";
50 else
51 return " ";
52}
53
54static const char *get_tiling_flag(struct drm_i915_gem_object *obj_priv)
55{
56 switch (obj_priv->tiling_mode) {
57 default:
58 case I915_TILING_NONE: return " ";
59 case I915_TILING_X: return "X";
60 case I915_TILING_Y: return "Y";
61 }
62}
63
44static int i915_gem_object_list_info(struct seq_file *m, void *data) 64static int i915_gem_object_list_info(struct seq_file *m, void *data)
45{ 65{
46 struct drm_info_node *node = (struct drm_info_node *) m->private; 66 struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -70,19 +90,11 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
70 90
71 list_for_each_entry(obj_priv, head, list) 91 list_for_each_entry(obj_priv, head, list)
72 { 92 {
73 char *pin_description;
74 struct drm_gem_object *obj = obj_priv->obj; 93 struct drm_gem_object *obj = obj_priv->obj;
75 94
76 if (obj_priv->user_pin_count > 0)
77 pin_description = "P";
78 else if (obj_priv->pin_count > 0)
79 pin_description = "p";
80 else
81 pin_description = " ";
82
83 seq_printf(m, " %p: %s %08x %08x %d", 95 seq_printf(m, " %p: %s %08x %08x %d",
84 obj, 96 obj,
85 pin_description, 97 get_pin_flag(obj_priv),
86 obj->read_domains, obj->write_domain, 98 obj->read_domains, obj->write_domain,
87 obj_priv->last_rendering_seqno); 99 obj_priv->last_rendering_seqno);
88 100
@@ -161,6 +173,41 @@ static int i915_interrupt_info(struct seq_file *m, void *data)
161 return 0; 173 return 0;
162} 174}
163 175
176static int i915_gem_fence_regs_info(struct seq_file *m, void *data)
177{
178 struct drm_info_node *node = (struct drm_info_node *) m->private;
179 struct drm_device *dev = node->minor->dev;
180 drm_i915_private_t *dev_priv = dev->dev_private;
181 int i;
182
183 seq_printf(m, "Reserved fences = %d\n", dev_priv->fence_reg_start);
184 seq_printf(m, "Total fences = %d\n", dev_priv->num_fence_regs);
185 for (i = 0; i < dev_priv->num_fence_regs; i++) {
186 struct drm_gem_object *obj = dev_priv->fence_regs[i].obj;
187
188 if (obj == NULL) {
189 seq_printf(m, "Fenced object[%2d] = unused\n", i);
190 } else {
191 struct drm_i915_gem_object *obj_priv;
192
193 obj_priv = obj->driver_private;
194 seq_printf(m, "Fenced object[%2d] = %p: %s "
195 "%08x %08x %08x %s %08x %08x %d",
196 i, obj, get_pin_flag(obj_priv),
197 obj_priv->gtt_offset,
198 obj->size, obj_priv->stride,
199 get_tiling_flag(obj_priv),
200 obj->read_domains, obj->write_domain,
201 obj_priv->last_rendering_seqno);
202 if (obj->name)
203 seq_printf(m, " (name: %d)", obj->name);
204 seq_printf(m, "\n");
205 }
206 }
207
208 return 0;
209}
210
164static int i915_hws_info(struct seq_file *m, void *data) 211static int i915_hws_info(struct seq_file *m, void *data)
165{ 212{
166 struct drm_info_node *node = (struct drm_info_node *) m->private; 213 struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -187,6 +234,7 @@ static struct drm_info_list i915_gem_debugfs_list[] = {
187 {"i915_gem_inactive", i915_gem_object_list_info, 0, (void *) INACTIVE_LIST}, 234 {"i915_gem_inactive", i915_gem_object_list_info, 0, (void *) INACTIVE_LIST},
188 {"i915_gem_request", i915_gem_request_info, 0}, 235 {"i915_gem_request", i915_gem_request_info, 0},
189 {"i915_gem_seqno", i915_gem_seqno_info, 0}, 236 {"i915_gem_seqno", i915_gem_seqno_info, 0},
237 {"i915_gem_fence_regs", i915_gem_fence_regs_info, 0},
190 {"i915_gem_interrupt", i915_interrupt_info, 0}, 238 {"i915_gem_interrupt", i915_interrupt_info, 0},
191 {"i915_gem_hws", i915_hws_info, 0}, 239 {"i915_gem_hws", i915_hws_info, 0},
192}; 240};