aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-03-28 06:31:04 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-03-28 11:39:11 -0400
commit6effa33b73fb0129061ecd8ba3158d984475d35d (patch)
treecf47b6c0e99ee618a9f3e79de5f956156bd3eebb /drivers/gpu/drm
parent0ff9800ade77160df35764f3fe15cd893605762b (diff)
drm/i915: fold wait_for_atomic_us into wait_for_atomic
Since commit bcf9dcc1e6269fac674e41f25d007ff75f76e840 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Sun Jul 15 09:42:38 2012 +0100 drm/i915: Workaround hang with BSD and forcewake on SandyBridge and commit 0cc2764cc4a4bd73df55f8893c871778cf7ddd0f Author: Ben Widawsky <ben@bwidawsk.net> Date: Sat Sep 1 22:59:48 2012 -0700 drm/i915: use cpu_relax() in wait_for_atomic these two macros are essentially the same, so unify them. We keep the _us version since it's a nice documentation for smaller timeouts. v2: Fixup time unit conversion, _wait_for takes ms (Ville). Cc: Jack Winter <jbh@alchemy.lu> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 5c7b04b41702..8720a67395f8 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -50,21 +50,10 @@
50 ret__; \ 50 ret__; \
51}) 51})
52 52
53#define wait_for_atomic_us(COND, US) ({ \
54 unsigned long timeout__ = jiffies + usecs_to_jiffies(US); \
55 int ret__ = 0; \
56 while (!(COND)) { \
57 if (time_after(jiffies, timeout__)) { \
58 ret__ = -ETIMEDOUT; \
59 break; \
60 } \
61 cpu_relax(); \
62 } \
63 ret__; \
64})
65
66#define wait_for(COND, MS) _wait_for(COND, MS, 1) 53#define wait_for(COND, MS) _wait_for(COND, MS, 1)
67#define wait_for_atomic(COND, MS) _wait_for(COND, MS, 0) 54#define wait_for_atomic(COND, MS) _wait_for(COND, MS, 0)
55#define wait_for_atomic_us(COND, US) _wait_for((COND), \
56 DIV_ROUND_UP((US), 1000), 0)
68 57
69#define KHz(x) (1000*x) 58#define KHz(x) (1000*x)
70#define MHz(x) KHz(1000*x) 59#define MHz(x) KHz(1000*x)