All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fixup intel_wait_for_vblank*()
@ 2010-08-22  8:34 Chris Wilson
  0 siblings, 0 replies; only message in thread
From: Chris Wilson @ 2010-08-22  8:34 UTC (permalink / raw)
  To: intel-gfx

Add a msleep to intel_wait_for_vblank().

Change intel_wait_for_vblank_off() to repeat *until* timeout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_display.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 23157e1..f048379 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -993,7 +993,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,
-		     50, 0))
+		     50, 1))
 		DRM_DEBUG_KMS("vblank wait timed out\n");
 }
 
@@ -1019,9 +1019,12 @@ void intel_wait_for_vblank_off(struct drm_device *dev, int pipe)
 	/* Wait for the display line to settle */
 	do {
 		last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK;
-		mdelay(5);
+		if (in_dbg_master())
+			mdelay(5);
+		else
+			msleep(5);
 	} while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) &&
-		 time_after(timeout, jiffies));
+		 !time_after(timeout, jiffies));
 
 	if (time_after(jiffies, timeout))
 		DRM_DEBUG_KMS("vblank wait timed out\n");
-- 
1.7.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-22  8:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-22  8:34 [PATCH] drm/i915: Fixup intel_wait_for_vblank*() Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.