summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-12 13:34:08 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-12 13:34:08 +0100
commitec5da01e23eec303dd313aa62b8ed4712c488437 (patch)
tree7f5a6c4a606133e787cf9f052caad319bae35cd5 /drivers/gpu/drm/i915/intel_display.c
parentc9f9ccc150e119bab6a1003e7762b024623011d8 (diff)
drm/i915: Use msleep instead of mdelay during wait_vblank_off
Avoid a potentially long busy-wait if we not in the process of atomically switching to the kdb console. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1e88ebbc1a1..594f8f2410a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1034,16 +1034,17 @@ void intel_wait_for_vblank_off(struct drm_device *dev, int pipe)
struct drm_i915_private *dev_priv = dev->dev_private;
int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL);
unsigned long timeout = jiffies + msecs_to_jiffies(100);
- u32 last_line;
+ u32 last_line, line;
/* Wait for the display line to settle */
+ line = I915_READ(pipedsl_reg) & DSL_LINEMASK;
do {
- last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK;
- mdelay(5);
- } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) &&
- time_after(timeout, jiffies));
+ last_line = line;
+ MSLEEP(5);
+ line = I915_READ(pipedsl_reg) & DSL_LINEMASK;
+ } while (line != last_line && time_after(timeout, jiffies));
- if (time_after(jiffies, timeout))
+ if (line != last_line)
DRM_DEBUG_KMS("vblank wait timed out\n");
}