Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218006
b: refs/heads/master
c: ec5da01
h: refs/heads/master
v: v3
  • Loading branch information
Chris Wilson committed Sep 12, 2010
1 parent 67214c8 commit 2a27b58
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c9f9ccc150e119bab6a1003e7762b024623011d8
refs/heads/master: ec5da01e23eec303dd313aa62b8ed4712c488437
13 changes: 7 additions & 6 deletions trunk/drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/gpu/drm/i915/intel_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
#define wait_for(COND, MS) _wait_for(COND, MS, 1)
#define wait_for_atomic(COND, MS) _wait_for(COND, MS, 0)

#define MSLEEP(x) do { \
if (in_dbg_master()) \
mdelay(x); \
else \
msleep(x); \
} while(0)

#define KHz(x) (1000*x)
#define MHz(x) KHz(1000*x)

Expand Down

0 comments on commit 2a27b58

Please sign in to comment.