[PATCH] drm/i915/tv: Flush register writes before sleeping.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Chris Wilson
Date: Tuesday, August 24, 2010 - 2:21 am

Ivan, can you try this patch?

Linus is going to make some more snide comments if he sees just how many
of these trivial-ish patches that I have pending...

---

If we need to wait until the next vblank for the register to be updated
and to take effect, make sure the write is actually flushed to the register
prior to sleeping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_tv.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index d2029ef..19b9739 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1157,10 +1157,13 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 		I915_WRITE(dspbase_reg, I915_READ(dspbase_reg));
 
 		/* Wait for vblank for the disable to take effect */
-		if (!IS_I9XX(dev))
+		if (!IS_I9XX(dev)) {
+			POSTING_READ(dspbase_reg);
 			intel_wait_for_vblank(dev, intel_crtc->pipe);
+		}
 
 		I915_WRITE(pipeconf_reg, pipeconf & ~PIPEACONF_ENABLE);
+		POSTING_READ(pipeconf_reg);
 		/* Wait for vblank for the disable to take effect. */
 		intel_wait_for_vblank(dev, intel_crtc->pipe);
 
@@ -1268,11 +1271,15 @@ intel_tv_detect_type (struct intel_tv *intel_tv)
 		   DAC_C_0_7_V);
 	I915_WRITE(TV_CTL, tv_ctl);
 	I915_WRITE(TV_DAC, tv_dac);
+	POSTING_READ(TV_DAC);
 	intel_wait_for_vblank(dev, intel_crtc->pipe);
+
 	tv_dac = I915_READ(TV_DAC);
 	I915_WRITE(TV_DAC, save_tv_dac);
 	I915_WRITE(TV_CTL, save_tv_ctl);
+	POSTING_READ(TV_CTL);
 	intel_wait_for_vblank(dev, intel_crtc->pipe);
+
 	/*
 	 *  A B C
 	 *  0 1 1 Composite
-- 
1.7.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
i915: 2.6.36-rc2 wrong resolution on gdm start, Ivan Bulatovic, (Mon Aug 23, 6:00 pm)
Re: i915: 2.6.36-rc2 wrong resolution on gdm start, Chris Wilson, (Tue Aug 24, 12:49 am)
Re: i915: 2.6.36-rc2 wrong resolution on gdm start, Ivan Bulatovic, (Tue Aug 24, 1:35 am)
Re: i915: 2.6.36-rc2 wrong resolution on gdm start, Chris Wilson, (Tue Aug 24, 1:50 am)
Re: i915: 2.6.36-rc2 wrong resolution on gdm start, Pekka Enberg, (Tue Aug 24, 1:54 am)
Re: i915: 2.6.36-rc2 wrong resolution on gdm start, Ivan Bulatovic, (Tue Aug 24, 2:12 am)
[PATCH] drm/i915/tv: Flush register writes before sleeping., Chris Wilson, (Tue Aug 24, 2:21 am)
Re: i915: 2.6.36-rc2 wrong resolution on gdm start, Pekka Enberg, (Sun Aug 29, 4:29 am)
Re: i915: 2.6.36-rc2 wrong resolution on gdm start, Maciej Rutecki, (Sun Aug 29, 5:59 am)
Re: i915: 2.6.36-rc2 wrong resolution on gdm start, Sitsofe Wheeler, (Sun Aug 29, 6:37 am)