This is a note to let you know that I've just added the patch titled

    drm/i915: fix up ivb plane 3 pageflips

to the 3.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     0003-drm-i915-fix-up-ivb-plane-3-pageflips.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 40e9b8bb59c2b168523a91e5e319d6339047b499 Mon Sep 17 00:00:00 2001
From: Daniel Vetter <[email protected]>
Date: Wed, 23 May 2012 14:02:00 +0200
Subject: drm/i915: fix up ivb plane 3 pageflips

From: Daniel Vetter <[email protected]>

commit cb05d8dedefa3066bf5d74ef88c6ca6cf4bd1c87 upstream.

Or at least plug another gapping hole. Apparrently hw desingers only
moved the bit field, but did not bother ot re-enumerate the planes
when adding support for a 3rd pipe.

Discovered by i-g-t/flip_test.

This may or may not fix the reference bugzilla, because that one
smells like we have still larger fish to fry.

v2: Fixup the impossible case to catch programming errors, noticed by
Chris Wilson.

References: https://bugs.freedesktop.org/show_bug.cgi?id=50069
Acked-by: Chris Wilson <[email protected]>
Tested-by: Eugeni Dodonov <[email protected]>
Eugeni Dodonov <[email protected]>
Signed-Off-by: Daniel Vetter <[email protected]>
Signed-off-by: Julien Cristau <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |    8 ++++++++
 drivers/gpu/drm/i915/intel_display.c |   19 ++++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -197,6 +197,14 @@
 #define MI_DISPLAY_FLIP                MI_INSTR(0x14, 2)
 #define MI_DISPLAY_FLIP_I915   MI_INSTR(0x14, 1)
 #define   MI_DISPLAY_FLIP_PLANE(n) ((n) << 20)
+/* IVB has funny definitions for which plane to flip. */
+#define   MI_DISPLAY_FLIP_IVB_PLANE_A  (0 << 19)
+#define   MI_DISPLAY_FLIP_IVB_PLANE_B  (1 << 19)
+#define   MI_DISPLAY_FLIP_IVB_SPRITE_A (2 << 19)
+#define   MI_DISPLAY_FLIP_IVB_SPRITE_B (3 << 19)
+#define   MI_DISPLAY_FLIP_IVB_PLANE_C  (4 << 19)
+#define   MI_DISPLAY_FLIP_IVB_SPRITE_C (5 << 19)
+
 #define MI_SET_CONTEXT         MI_INSTR(0x18, 0)
 #define   MI_MM_SPACE_GTT              (1<<8)
 #define   MI_MM_SPACE_PHYSICAL         (0<<8)
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7486,17 +7486,34 @@ static int intel_gen7_queue_flip(struct
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        struct intel_ring_buffer *ring = &dev_priv->ring[BCS];
+       uint32_t plane_bit = 0;
        int ret;
 
        ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
        if (ret)
                goto err;
 
+       switch(intel_crtc->plane) {
+       case PLANE_A:
+               plane_bit = MI_DISPLAY_FLIP_IVB_PLANE_A;
+               break;
+       case PLANE_B:
+               plane_bit = MI_DISPLAY_FLIP_IVB_PLANE_B;
+               break;
+       case PLANE_C:
+               plane_bit = MI_DISPLAY_FLIP_IVB_PLANE_C;
+               break;
+       default:
+               WARN_ONCE(1, "unknown plane in flip command\n");
+               ret = -ENODEV;
+               goto err;
+       }
+
        ret = intel_ring_begin(ring, 4);
        if (ret)
                goto err_unpin;
 
-       intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19));
+       intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane_bit);
        intel_ring_emit(ring, (fb->pitches[0] | obj->tiling_mode));
        intel_ring_emit(ring, (obj->gtt_offset));
        intel_ring_emit(ring, (MI_NOOP));


Patches currently in stable-queue which might be from [email protected] are

queue-3.4/0011-drm-i915-add-some-barriers-when-changing-DIPs.patch
queue-3.4/0015-drm-i915-only-enable-sdvo-hotplug-irq-if-needed.patch
queue-3.4/0007-drm-i915-Add-wait_for-in-init_ring_common.patch
queue-3.4/0008-drm-i915-Wait-for-all-pending-operations-to-the-fb-b.patch
queue-3.4/0016-drm-i915-Reduce-a-pin-leak-BUG-into-a-WARN.patch
queue-3.4/0018-drm-i915-Fix-GT_MODE-default-value.patch
queue-3.4/0019-drm-i915-call-drm_handle_vblank-before-finish_page_f.patch
queue-3.4/0003-drm-i915-fix-up-ivb-plane-3-pageflips.patch
queue-3.4/0002-drm-i915-Unpin-the-flip-target-if-we-fail-to-queue-t.patch
queue-3.4/0017-drm-i915-prevent-possible-pin-leak-on-error-path.patch
queue-3.4/0009-drm-i915-don-t-pwrite-tiled-objects-through-the-gtt.patch
queue-3.4/drm-i915-make-the-panel-fitter-work-on-pipes-b-and-c-on-ivb.patch
queue-3.4/0006-drm-i915-Check-VBIOS-value-for-determining-LVDS-dual.patch
queue-3.4/drm-i915-disable-cpt-phase-pointer-fdi-rx-workaround.patch
queue-3.4/0005-drm-i915-hold-forcewake-around-ring-hw-init.patch
queue-3.4/0004-drm-i915-move-NEEDS_FORCE_WAKE-to-i915_drv.c.patch
queue-3.4/0012-drm-i915-SDVO-hotplug-have-different-interrupt-statu.patch
queue-3.4/0020-drm-i915-Flush-the-pending-flips-on-the-CRTC-before-.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to