diff mbox

drm/i915: Fixup intel_wait_for_vblank*()

Message ID 1282466085-4204-1-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Chris Wilson Aug. 22, 2010, 8:34 a.m. UTC
None
diff mbox

Patch

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");