Commit 4d3088c7 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: Pin the pages before acquiring struct_mutex for display

Since we don't need the struct_mutex to acquire the object's pages, call
i915_gem_object_pin_pages() before we bind the object into the GGTT.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170726160038.29487-3-chris@chris-wilson.co.ukSigned-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 6ea1d55d
...@@ -12432,10 +12432,16 @@ intel_prepare_plane_fb(struct drm_plane *plane, ...@@ -12432,10 +12432,16 @@ intel_prepare_plane_fb(struct drm_plane *plane,
if (!obj) if (!obj)
return 0; return 0;
ret = mutex_lock_interruptible(&dev_priv->drm.struct_mutex); ret = i915_gem_object_pin_pages(obj);
if (ret) if (ret)
return ret; return ret;
ret = mutex_lock_interruptible(&dev_priv->drm.struct_mutex);
if (ret) {
i915_gem_object_unpin_pages(obj);
return ret;
}
if (plane->type == DRM_PLANE_TYPE_CURSOR && if (plane->type == DRM_PLANE_TYPE_CURSOR &&
INTEL_INFO(dev_priv)->cursor_needs_physical) { INTEL_INFO(dev_priv)->cursor_needs_physical) {
const int align = intel_cursor_alignment(dev_priv); const int align = intel_cursor_alignment(dev_priv);
...@@ -12454,6 +12460,7 @@ intel_prepare_plane_fb(struct drm_plane *plane, ...@@ -12454,6 +12460,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
i915_gem_object_wait_priority(obj, 0, I915_PRIORITY_DISPLAY); i915_gem_object_wait_priority(obj, 0, I915_PRIORITY_DISPLAY);
mutex_unlock(&dev_priv->drm.struct_mutex); mutex_unlock(&dev_priv->drm.struct_mutex);
i915_gem_object_unpin_pages(obj);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment