[Intel-gfx] [PATCH 4/4] drm/i915: Pin the pages before acquiring struct_mutex for display

Chris Wilson chris at chris-wilson.co.uk
Thu Jun 15 08:25:09 UTC 2017


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: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8897ad369a85..8c2a0b04ad4a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13397,6 +13397,10 @@ intel_prepare_plane_fb(struct drm_plane *plane,
 	if (!obj)
 		return 0;
 
+	ret = i915_gem_object_pin_pages(obj);
+	if (ret)
+		return ret;
+
 	ret = mutex_lock_interruptible(&dev_priv->drm.struct_mutex);
 	if (ret) {
 		i915_gem_object_unpin_pages(obj);
@@ -13421,6 +13425,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
 	}
 
 	mutex_unlock(&dev_priv->drm.struct_mutex);
+	i915_gem_object_unpin_pages(obj);
 	if (ret)
 		return ret;
 
-- 
2.11.0



More information about the Intel-gfx mailing list