diff options
author | Shaohua Li <shaohua.li@intel.com> | 2009-04-08 10:58:23 +0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-04-14 11:45:28 -0700 |
commit | 68c84342171034120c8a1f6dfb8ef51b14250f11 (patch) | |
tree | 14024d0556cd3c5d3bd46e396e9d2a3439e74d72 | |
parent | 280b713b5b0fd84cf2469098aee88acbb5de859c (diff) | |
download | linux-68c84342171034120c8a1f6dfb8ef51b14250f11.tar.gz linux-68c84342171034120c8a1f6dfb8ef51b14250f11.tar.bz2 linux-68c84342171034120c8a1f6dfb8ef51b14250f11.zip |
drm/i915: fix scheduling while holding the new active list spinlock
regression caused by commit 5e118f4139feafe97e913df67b1f7c1e5083e535:
i915_gem_object_move_to_inactive() should be called in task context,
as it calls fput();
Signed-off-by: Shaohua Li<shaohua.li@intel.com>
[anholt: Add more detail to the comment about the lock break that's added]
Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 6dca9fc7c1db..4642115902d6 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1596,8 +1596,19 @@ i915_gem_retire_request(struct drm_device *dev, if (obj->write_domain != 0) i915_gem_object_move_to_flushing(obj); - else + else { + /* Take a reference on the object so it won't be + * freed while the spinlock is held. The list + * protection for this spinlock is safe when breaking + * the lock like this since the next thing we do + * is just get the head of the list again. + */ + drm_gem_object_reference(obj); i915_gem_object_move_to_inactive(obj); + spin_unlock(&dev_priv->mm.active_list_lock); + drm_gem_object_unreference(obj); + spin_lock(&dev_priv->mm.active_list_lock); + } } out: spin_unlock(&dev_priv->mm.active_list_lock); |