[Intel-gfx] [PATCH 1/4] drm/i915: Suppress redundant syncs with mmio page flips

Chris Wilson chris at chris-wilson.co.uk
Wed Jun 18 13:23:14 CEST 2014


Since mmio-flips do not occur on the suggested ring, we are introducing
an extra sync operation where none is required. Pass the current
obj->ring, which is what mmio flip will use, to pin_to_display_plane so
that we emit the appropriate synchronisation (none).

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5e8e711..55cb343 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9492,21 +9492,32 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 		ring = &dev_priv->ring[RCS];
 	}
 
-	ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
-	if (ret)
-		goto cleanup_pending;
+	if (use_mmio_flip(ring, obj)) {
+		ret = intel_pin_and_fence_fb_obj(dev, obj, obj->ring);
+		if (ret)
+			goto cleanup_pending;
 
-	work->gtt_offset =
-		i915_gem_obj_ggtt_offset(obj) + intel_crtc->dspaddr_offset;
+		work->gtt_offset =
+			i915_gem_obj_ggtt_offset(obj) + intel_crtc->dspaddr_offset;
 
-	if (use_mmio_flip(ring, obj))
 		ret = intel_queue_mmio_flip(dev, crtc, fb, obj, ring,
 					    page_flip_flags);
-	else
+		if (ret)
+			goto cleanup_unpin;
+
+	} else {
+		ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
+		if (ret)
+			goto cleanup_pending;
+
+		work->gtt_offset =
+			i915_gem_obj_ggtt_offset(obj) + intel_crtc->dspaddr_offset;
+
 		ret = dev_priv->display.queue_flip(dev, crtc, fb, obj, ring,
 				page_flip_flags);
-	if (ret)
-		goto cleanup_unpin;
+		if (ret)
+			goto cleanup_unpin;
+	}
 
 	intel_disable_fbc(dev);
 	intel_mark_fb_busy(obj, NULL);
-- 
1.9.1




More information about the Intel-gfx mailing list