summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-05-26 17:41:46 -0700
committerKeith Packard <keithp@keithp.com>2008-05-26 17:41:46 -0700
commit1f4e36081bd6ff7d7b53a62e0c8db7c0f82edf99 (patch)
treeb87f06e9e3fa14ee77ccdd2d4640bd873c5af9c7
parentd434b64f6a760d85295e32298a9a1f3624ee1b69 (diff)
[intel-gem] Must hold DRM lock while setting object domain
Object domain transfer can involve adding flush ops to the request queue, and so the DRM lock must be held to avoid having the X server smash pointers badly.
-rw-r--r--linux-core/i915_gem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c
index 3ad3f40c..5eeabdaa 100644
--- a/linux-core/i915_gem.c
+++ b/linux-core/i915_gem.c
@@ -1529,9 +1529,11 @@ i915_gem_set_domain(struct drm_gem_object *obj,
BUG_ON(!mutex_is_locked(&dev->struct_mutex));
+ drm_idlelock_take (&dev->lock);
i915_kernel_lost_context(dev);
i915_gem_object_set_domain(obj, read_domains, write_domain);
i915_gem_dev_set_domain(obj->dev);
+ drm_idlelock_release (&dev->lock);
return 0;
}