summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_debugfs.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-03-20 11:54:25 -0700
committerEric Anholt <eric@anholt.net>2009-04-01 15:22:07 -0700
commit5e118f4139feafe97e913df67b1f7c1e5083e535 (patch)
treea4d73fb1bb51083ab95b6167c6a8c621f6245a63 /drivers/gpu/drm/i915/i915_gem_debugfs.c
parent7026d4ac1fc134566c2c946e6c0d849fc03ba7b7 (diff)
downloadlwn-5e118f4139feafe97e913df67b1f7c1e5083e535.tar.gz
lwn-5e118f4139feafe97e913df67b1f7c1e5083e535.zip
drm/i915: Add a spinlock to protect the active_list
This is a baby-step in the direction of having finer-grained locking than the struct_mutex. Specifically, this will enable new debugging code to read the active list for printing out GPU state when the GPU is wedged, (while the struct_mutex is held, of course). Signed-off-by: Carl Worth <cworth@cworth.org> [anholt: indentation fix] Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_debugfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_debugfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_debugfs.c b/drivers/gpu/drm/i915/i915_gem_debugfs.c
index 455ec970b385..a1ac0c5e7307 100644
--- a/drivers/gpu/drm/i915/i915_gem_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_gem_debugfs.c
@@ -69,10 +69,13 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
struct drm_device *dev = node->minor->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_i915_gem_object *obj_priv;
+ spinlock_t *lock = NULL;
switch (list) {
case ACTIVE_LIST:
seq_printf(m, "Active:\n");
+ lock = &dev_priv->mm.active_list_lock;
+ spin_lock(lock);
head = &dev_priv->mm.active_list;
break;
case INACTIVE_LIST:
@@ -104,6 +107,9 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
seq_printf(m, " (fence: %d\n", obj_priv->fence_reg);
seq_printf(m, "\n");
}
+
+ if (lock)
+ spin_unlock(lock);
return 0;
}