[Intel-gfx] [PATCH]gem: fix a regression

Shaohua Li shaohua.li at intel.com
Tue Apr 7 11:02:05 CEST 2009


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 at intel.com>

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 1449b45..54a258c 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1494,8 +1494,17 @@ i915_gem_retire_request(struct drm_device *dev,
 
 		if (obj->write_domain != 0)
 			i915_gem_object_move_to_flushing(obj);
-		else
+		else {
+			/*
+			 * the object might be freed, take reference first so
+			 * it will not be freed in atomic environment
+			 **/
+			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);





More information about the Intel-gfx mailing list