summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-19 15:05:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-21 11:19:59 +0100
commitc7f9f9a8b89bb4d53edc030f5b61ae11d6859721 (patch)
tree1cc879aa1b228a0fd5569f56776ad12f811cfd68 /drivers/gpu/drm/i915/intel_display.c
parente070868ef2101ce548d4fbb25edfd301e59fb719 (diff)
downloadlwn-c7f9f9a8b89bb4d53edc030f5b61ae11d6859721.tar.gz
lwn-c7f9f9a8b89bb4d53edc030f5b61ae11d6859721.zip
drm/i915: Use ring->flush() instead of MI_FLUSH
Use the ring abstraction to hide the details of having choose the appropriate flushing method. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c3f0400963de..0505ddb76a10 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5056,24 +5056,23 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
atomic_inc(&obj_priv->pending_flip);
work->pending_flip_obj = obj;
- if (was_dirty || IS_GEN3(dev) || IS_GEN2(dev)) {
- BEGIN_LP_RING(2);
- if (IS_GEN3(dev) || IS_GEN2(dev)) {
- u32 flip_mask;
+ /* Schedule the pipelined flush */
+ if (was_dirty)
+ i915_gem_flush_ring(dev, obj_priv->ring, 0, was_dirty);
- /* Can't queue multiple flips, so wait for the previous
- * one to finish before executing the next.
- */
+ if (IS_GEN3(dev) || IS_GEN2(dev)) {
+ u32 flip_mask;
- if (intel_crtc->plane)
- flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
- else
- flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
-
- OUT_RING(MI_WAIT_FOR_EVENT | flip_mask);
- } else
- OUT_RING(MI_NOOP);
- OUT_RING(MI_FLUSH);
+ /* Can't queue multiple flips, so wait for the previous
+ * one to finish before executing the next.
+ */
+ BEGIN_LP_RING(2);
+ if (intel_crtc->plane)
+ flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
+ else
+ flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
+ OUT_RING(MI_WAIT_FOR_EVENT | flip_mask);
+ OUT_RING(MI_NOOP);
ADVANCE_LP_RING();
}