[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.
main
Keith Packard 2008-05-26 17:41:46 -07:00
parent d434b64f6a
commit 1f4e36081b
1 changed files with 2 additions and 0 deletions

View File

@ -1529,9 +1529,11 @@ i915_gem_set_domain(struct drm_gem_object *obj,
BUG_ON(!mutex_is_locked(&dev->struct_mutex)); BUG_ON(!mutex_is_locked(&dev->struct_mutex));
drm_idlelock_take (&dev->lock);
i915_kernel_lost_context(dev); i915_kernel_lost_context(dev);
i915_gem_object_set_domain(obj, read_domains, write_domain); i915_gem_object_set_domain(obj, read_domains, write_domain);
i915_gem_dev_set_domain(obj->dev); i915_gem_dev_set_domain(obj->dev);
drm_idlelock_release (&dev->lock);
return 0; return 0;
} }