diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-30 06:46:12 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-01 09:45:20 -0400 |
commit | 73aa808f10effc280e6eb70267314542a7c29426 (patch) | |
tree | e8c7d0e25bb5d0658c47ff0339aec9a65367bbc2 /drivers/gpu/drm/i915/i915_debugfs.c | |
parent | 6a04002bea137d2c6359228316d9c827806e475f (diff) |
drm: Move the GTT accounting to i915
Only drm/i915 does the bookkeeping that makes the information useful,
and the information maintained is driver specific, so move it out of the
core and into its single user.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 0d9bbd595ff8..d598070fb279 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -188,6 +188,31 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
188 | return 0; | 188 | return 0; |
189 | } | 189 | } |
190 | 190 | ||
191 | static int i915_gem_object_info(struct seq_file *m, void* data) | ||
192 | { | ||
193 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
194 | struct drm_device *dev = node->minor->dev; | ||
195 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
196 | int ret; | ||
197 | |||
198 | ret = mutex_lock_interruptible(&dev->struct_mutex); | ||
199 | if (ret) | ||
200 | return ret; | ||
201 | |||
202 | seq_printf(m, "%u objects\n", dev_priv->mm.object_count); | ||
203 | seq_printf(m, "%zu object bytes\n", dev_priv->mm.object_memory); | ||
204 | seq_printf(m, "%u pinned\n", dev_priv->mm.pin_count); | ||
205 | seq_printf(m, "%zu pin bytes\n", dev_priv->mm.pin_memory); | ||
206 | seq_printf(m, "%u objects in gtt\n", dev_priv->mm.gtt_count); | ||
207 | seq_printf(m, "%zu gtt bytes\n", dev_priv->mm.gtt_memory); | ||
208 | seq_printf(m, "%zu gtt total\n", dev_priv->mm.gtt_total); | ||
209 | |||
210 | mutex_unlock(&dev->struct_mutex); | ||
211 | |||
212 | return 0; | ||
213 | } | ||
214 | |||
215 | |||
191 | static int i915_gem_pageflip_info(struct seq_file *m, void *data) | 216 | static int i915_gem_pageflip_info(struct seq_file *m, void *data) |
192 | { | 217 | { |
193 | struct drm_info_node *node = (struct drm_info_node *) m->private; | 218 | struct drm_info_node *node = (struct drm_info_node *) m->private; |
@@ -994,6 +1019,7 @@ static int i915_wedged_create(struct dentry *root, struct drm_minor *minor) | |||
994 | 1019 | ||
995 | static struct drm_info_list i915_debugfs_list[] = { | 1020 | static struct drm_info_list i915_debugfs_list[] = { |
996 | {"i915_capabilities", i915_capabilities, 0, 0}, | 1021 | {"i915_capabilities", i915_capabilities, 0, 0}, |
1022 | {"i915_gem_objects", i915_gem_object_info, 0}, | ||
997 | {"i915_gem_render_active", i915_gem_object_list_info, 0, (void *) RENDER_LIST}, | 1023 | {"i915_gem_render_active", i915_gem_object_list_info, 0, (void *) RENDER_LIST}, |
998 | {"i915_gem_bsd_active", i915_gem_object_list_info, 0, (void *) BSD_LIST}, | 1024 | {"i915_gem_bsd_active", i915_gem_object_list_info, 0, (void *) BSD_LIST}, |
999 | {"i915_gem_flushing", i915_gem_object_list_info, 0, (void *) FLUSHING_LIST}, | 1025 | {"i915_gem_flushing", i915_gem_object_list_info, 0, (void *) FLUSHING_LIST}, |