drm/i915: pipe_src_w must be even in LVDS dual channel, DVO ganged, and double wide...
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 4 Sep 2013 15:30:05 +0000 (18:30 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 17 Sep 2013 08:03:04 +0000 (10:03 +0200)
Pipe horizontal source size must be even when either LVDS dual channel
mode, DVO ganged mode, or pipe double wide mode is used.

We must round it down since we can never increase the user specified
viewport size.

The actual error from an odd pipe source width looks like a diagonal
shift, like you might get from a bad stride.

v2: s/ganaged/ganged/

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index 91631bf354e65ee2ec0ff1fa224ca4c73570c09d..9bbb6ea34d06bfbb421f41aa03ca1b2f6982dd66 100644 (file)
@@ -4166,6 +4166,16 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,
                        return -EINVAL;
        }
 
+       /*
+        * Pipe horizontal size must be even in:
+        * - DVO ganged mode
+        * - LVDS dual channel mode
+        * - Double wide pipe
+        */
+       if ((intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS) &&
+            intel_is_dual_link_lvds(dev)) || pipe_config->double_wide)
+               pipe_config->pipe_src_w &= ~1;
+
        /* Cantiga+ cannot handle modes with a hsync front porch of 0.
         * WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw.
         */