2010-08-24 18:31:28

by Jesse Barnes

[permalink] [raw]
Subject: [PATCH] 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.).

Reviewed-by: Chris Wilson <[email protected]>
Tested-by: Sitsofe Wheeler <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>
---
drivers/gpu/drm/i915/intel_display.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6ccb797..dd90b80 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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");
}
--
1.6.3.3


2010-08-25 08:13:46

by Sitsofe Wheeler

[permalink] [raw]
Subject: Re: [PATCH] drm/i915: fix vblank wait test condition

On Tue, Aug 24, 2010 at 11:31:16AM -0700, Jesse Barnes wrote:
> 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.

--
Sitsofe | http://sucs.org/~sits/