aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Gamari <bgamari@gmail.com>2009-02-17 20:08:51 -0500
committerEric Anholt <eric@anholt.net>2009-03-27 18:12:03 -0400
commit433e12f78b68a8069f54956edf766bb21394c197 (patch)
tree4d95338d13eb90a73451eb3618295b84d0c6e039 /drivers/gpu
parent2017263e9e72974610179beaa85c4498b9c4b7a4 (diff)
drm/i915: Consolidate gem object list dumping
Here we eliminate a few functions in favor of using a single function to dump from all of the object lists. Signed-Off-By: Ben Gamari <bgamari@gmail.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_debugfs.c86
1 files changed, 28 insertions, 58 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_debugfs.c b/drivers/gpu/drm/i915/i915_gem_debugfs.c
index dd2b0edb9963..4fc845cee804 100644
--- a/drivers/gpu/drm/i915/i915_gem_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_gem_debugfs.c
@@ -37,69 +37,38 @@
37 37
38#if defined(CONFIG_DEBUG_FS) 38#if defined(CONFIG_DEBUG_FS)
39 39
40static int i915_gem_active_info(struct seq_file *m, void *data) 40#define ACTIVE_LIST 1
41{ 41#define FLUSHING_LIST 2
42 struct drm_info_node *node = (struct drm_info_node *) m->private; 42#define INACTIVE_LIST 3
43 struct drm_device *dev = node->minor->dev;
44 drm_i915_private_t *dev_priv = dev->dev_private;
45 struct drm_i915_gem_object *obj_priv;
46
47 seq_printf(m, "Active:\n");
48 list_for_each_entry(obj_priv, &dev_priv->mm.active_list,
49 list)
50 {
51 struct drm_gem_object *obj = obj_priv->obj;
52 if (obj->name) {
53 seq_printf(m, " %p(%d): %08x %08x %d\n",
54 obj, obj->name,
55 obj->read_domains, obj->write_domain,
56 obj_priv->last_rendering_seqno);
57 } else {
58 seq_printf(m, " %p: %08x %08x %d\n",
59 obj,
60 obj->read_domains, obj->write_domain,
61 obj_priv->last_rendering_seqno);
62 }
63 }
64 return 0;
65}
66 43
67static int i915_gem_flushing_info(struct seq_file *m, void *data) 44static int i915_gem_object_list_info(struct seq_file *m, void *data)
68{ 45{
69 struct drm_info_node *node = (struct drm_info_node *) m->private; 46 struct drm_info_node *node = (struct drm_info_node *) m->private;
47 uintptr_t list = (uintptr_t) node->info_ent->data;
48 struct list_head *head;
70 struct drm_device *dev = node->minor->dev; 49 struct drm_device *dev = node->minor->dev;
71 drm_i915_private_t *dev_priv = dev->dev_private; 50 drm_i915_private_t *dev_priv = dev->dev_private;
72 struct drm_i915_gem_object *obj_priv; 51 struct drm_i915_gem_object *obj_priv;
73 52
74 seq_printf(m, "Flushing:\n"); 53 switch (list) {
75 list_for_each_entry(obj_priv, &dev_priv->mm.flushing_list, 54 case ACTIVE_LIST:
76 list) 55 seq_printf(m, "Active:\n");
77 { 56 head = &dev_priv->mm.active_list;
78 struct drm_gem_object *obj = obj_priv->obj; 57 break;
79 if (obj->name) { 58 case INACTIVE_LIST:
80 seq_printf(m, " %p(%d): %08x %08x %d\n", 59 seq_printf(m, "Inctive:\n");
81 obj, obj->name, 60 head = &dev_priv->mm.inactive_list;
82 obj->read_domains, obj->write_domain, 61 break;
83 obj_priv->last_rendering_seqno); 62 case FLUSHING_LIST:
84 } else { 63 seq_printf(m, "Flushing:\n");
85 seq_printf(m, " %p: %08x %08x %d\n", obj, 64 head = &dev_priv->mm.flushing_list;
86 obj->read_domains, obj->write_domain, 65 break;
87 obj_priv->last_rendering_seqno); 66 default:
88 } 67 DRM_INFO("Ooops, unexpected list\n");
68 return 0;
89 } 69 }
90 return 0;
91}
92 70
93static int i915_gem_inactive_info(struct seq_file *m, void *data) 71 list_for_each_entry(obj_priv, head, list)
94{
95 struct drm_info_node *node = (struct drm_info_node *) m->private;
96 struct drm_device *dev = node->minor->dev;
97 drm_i915_private_t *dev_priv = dev->dev_private;
98 struct drm_i915_gem_object *obj_priv;
99
100 seq_printf(m, "Inactive:\n");
101 list_for_each_entry(obj_priv, &dev_priv->mm.inactive_list,
102 list)
103 { 72 {
104 struct drm_gem_object *obj = obj_priv->obj; 73 struct drm_gem_object *obj = obj_priv->obj;
105 if (obj->name) { 74 if (obj->name) {
@@ -108,7 +77,8 @@ static int i915_gem_inactive_info(struct seq_file *m, void *data)
108 obj->read_domains, obj->write_domain, 77 obj->read_domains, obj->write_domain,
109 obj_priv->last_rendering_seqno); 78 obj_priv->last_rendering_seqno);
110 } else { 79 } else {
111 seq_printf(m, " %p: %08x %08x %d\n", obj, 80 seq_printf(m, " %p: %08x %08x %d\n",
81 obj,
112 obj->read_domains, obj->write_domain, 82 obj->read_domains, obj->write_domain,
113 obj_priv->last_rendering_seqno); 83 obj_priv->last_rendering_seqno);
114 } 84 }
@@ -203,9 +173,9 @@ static int i915_hws_info(struct seq_file *m, void *data)
203} 173}
204 174
205static struct drm_info_list i915_gem_debugfs_list[] = { 175static struct drm_info_list i915_gem_debugfs_list[] = {
206 {"i915_gem_active", i915_gem_active_info, 0}, 176 {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST},
207 {"i915_gem_flushing", i915_gem_flushing_info, 0}, 177 {"i915_gem_flushing", i915_gem_object_list_info, 0, (void *) FLUSHING_LIST},
208 {"i915_gem_inactive", i915_gem_inactive_info, 0}, 178 {"i915_gem_inactive", i915_gem_object_list_info, 0, (void *) INACTIVE_LIST},
209 {"i915_gem_request", i915_gem_request_info, 0}, 179 {"i915_gem_request", i915_gem_request_info, 0},
210 {"i915_gem_seqno", i915_gem_seqno_info, 0}, 180 {"i915_gem_seqno", i915_gem_seqno_info, 0},
211 {"i915_gem_interrupt", i915_interrupt_info, 0}, 181 {"i915_gem_interrupt", i915_interrupt_info, 0},