@@ -4719,8 +4719,9 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
/* Set up the display plane register */
dspcntr = DISPPLANE_GAMMA_ENABLE;
- if (!IS_VALLEYVIEW(dev)) {
- if (pipe == 0)
+ /* planes A/B are fixed to pipes A/B respectively on Gen4+ */
+ if (INTEL_INFO(dev)->gen <= 3) {
+ if (pipe == PIPE_A)
dspcntr &= ~DISPPLANE_SEL_PIPE_MASK;
else
dspcntr |= DISPPLANE_SEL_PIPE_B;
@@ -4733,11 +4734,15 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
/* pipesrc and dspsize control the size that is scaled from,
* which should always be the user's requested size.
+ *
+ * DSPPOS/DSPSIZE for planes A/B only exist on Gen3 and earlier.
*/
- I915_WRITE(DSPSIZE(plane),
- ((mode->vdisplay - 1) << 16) |
- (mode->hdisplay - 1));
- I915_WRITE(DSPPOS(plane), 0);
+ if (INTEL_INFO(dev)->gen <= 3) {
+ I915_WRITE(DSPSIZE(plane),
+ ((mode->vdisplay - 1) << 16) |
+ (mode->hdisplay - 1));
+ I915_WRITE(DSPPOS(plane), 0);
+ }
i9xx_set_pipeconf(intel_crtc);