drm/i915: fix pipe source image setting in flip command

The MI_DISPLAY_FLIP command needs to be set the same pipe
source image like in pipe source register, e.g source image
size minus one. This fixes screen corrupt issue on Ironlake.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>

authored by Zhenyu Wang and committed by Eric Anholt aacef09b f072d2e7

+4 -2
+4 -2
drivers/gpu/drm/i915/intel_display.c
··· 4180 4180 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 4181 4181 struct intel_unpin_work *work; 4182 4182 unsigned long flags; 4183 - int ret; 4183 + int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; 4184 + int ret, pipesrc; 4184 4185 RING_LOCALS; 4185 4186 4186 4187 work = kzalloc(sizeof *work, GFP_KERNEL); ··· 4237 4236 OUT_RING(fb->pitch); 4238 4237 if (IS_I965G(dev)) { 4239 4238 OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode); 4240 - OUT_RING((fb->width << 16) | fb->height); 4239 + pipesrc = I915_READ(pipesrc_reg); 4240 + OUT_RING(pipesrc & 0x0fff0fff); 4241 4241 } else { 4242 4242 OUT_RING(obj_priv->gtt_offset); 4243 4243 OUT_RING(MI_NOOP);