diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-03-20 15:28:08 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-23 05:30:16 -0400 |
commit | 9848de082ff400f8b88e6d550bfce551838af69c (patch) | |
tree | 63289e17f9c1adfe8fa2067b6605e28f38a7a264 | |
parent | 0b37a9a9ebdf47dc9d5290a1c69bd944dde5cc15 (diff) |
drm/i915: Use usleep_range() in wait_for()
msleep() can sleep for way too long, so switch wait_for() to use
usleep_range() instead. Following a totally unscientific method
I just picked the range as W-2W.
This cuts the i915 init time on my BSW to almost half:
- initcall i915_init+0x0/0xa8 [i915] returned 0 after 419977 usecs
+ initcall i915_init+0x0/0xa8 [i915] returned 0 after 238419 usecs
Note that I didn't perform any other benchmarks on this so far.
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 6f20f3a01398..d2a4de0e4f4a 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -56,8 +56,8 @@ | |||
56 | ret__ = -ETIMEDOUT; \ | 56 | ret__ = -ETIMEDOUT; \ |
57 | break; \ | 57 | break; \ |
58 | } \ | 58 | } \ |
59 | if (W && drm_can_sleep()) { \ | 59 | if ((W) && drm_can_sleep()) { \ |
60 | msleep(W); \ | 60 | usleep_range((W)*1000, (W)*2000); \ |
61 | } else { \ | 61 | } else { \ |
62 | cpu_relax(); \ | 62 | cpu_relax(); \ |
63 | } \ | 63 | } \ |