Skip to contentSkip to conversation

drm/i915: fix vblank wait test condition

PATCH In review Jesse Barnes 2 participants 2 messages Aug 24, 2010 – Aug 25, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: fix vblank wait test condition

When converting this to the new wait_for macro I inverted the wait condition, which causes all sorts of problems. So correct it to fix several failures caused by the bad wait (flickering, bad output detection, tearing, etc.).

---
 drivers/gpu/drm/i915/intel_display.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index 6ccb797..dd90b80 100644
@@ -992,7 +992,7 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe)
 
 	/* Wait for vblank interrupt bit to set */
 	if (wait_for((I915_READ(pipestat_reg) &
-		      PIPE_VBLANK_INTERRUPT_STATUS) == 0,
+		      PIPE_VBLANK_INTERRUPT_STATUS),
 		     50, 0))
 		DRM_DEBUG_KMS("vblank wait timed out\n");
 }
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 4 lines · Jesse Barnes

When converting this to the new wait_for macro I inverted the wait condition, which causes all sorts of problems. So correct it to fix several failures caused by the bad wait (flickering, bad output detection, tearing, etc.).

Further testing has shown this fixed one set of cases where strange behaviour happened on my EeePC but there are other triggers. I've found the following:

With this patch booting without a battery in the machine will lead to a stable system without lots of errors appearing in dmesg (just one "Insufficient FIFO" at boot). Doing "watch --differences=cumulative xrandr" always shows the same outputs. VT switching occasionally causes the occasional "*ERROR* vblank wait timed out" message. However doing a suspend/resume brings back all the problems, dmesg starts filling up with FIFO errors and xrandr starts reporting different outputs every time it is called. Additionally, booting with a battery inside the machine at boot will always lead to the quirky behaviour too.

Signature · 1 line
Sitsofe | http://sucs.org/~sits/