diff options
author | Shaohua Li <shaohua.li@intel.com> | 2009-04-07 22:58:23 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-04-14 14:45:28 -0400 |
commit | 68c84342171034120c8a1f6dfb8ef51b14250f11 (patch) | |
tree | 14024d0556cd3c5d3bd46e396e9d2a3439e74d72 | |
parent | 280b713b5b0fd84cf2469098aee88acbb5de859c (diff) |
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, | |||
1596 | 1596 | ||
1597 | if (obj->write_domain != 0) | 1597 | if (obj->write_domain != 0) |
1598 | i915_gem_object_move_to_flushing(obj); | 1598 | i915_gem_object_move_to_flushing(obj); |
1599 | else | 1599 | else { |
1600 | /* Take a reference on the object so it won't be | ||
1601 | * freed while the spinlock is held. The list | ||
1602 | * protection for this spinlock is safe when breaking | ||
1603 | * the lock like this since the next thing we do | ||
1604 | * is just get the head of the list again. | ||
1605 | */ | ||
1606 | drm_gem_object_reference(obj); | ||
1600 | i915_gem_object_move_to_inactive(obj); | 1607 | i915_gem_object_move_to_inactive(obj); |
1608 | spin_unlock(&dev_priv->mm.active_list_lock); | ||
1609 | drm_gem_object_unreference(obj); | ||
1610 | spin_lock(&dev_priv->mm.active_list_lock); | ||
1611 | } | ||
1601 | } | 1612 | } |
1602 | out: | 1613 | out: |
1603 | spin_unlock(&dev_priv->mm.active_list_lock); | 1614 | spin_unlock(&dev_priv->mm.active_list_lock); |