Skip to content

Commit

Permalink
drm/i915: Use usleep_range() in wait_for()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
Reviewed-by: Jesse Barnes <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
  • Loading branch information
vsyrjala authored and danvet committed Mar 23, 2015
1 parent 0b37a9a commit 9848de0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/intel_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
ret__ = -ETIMEDOUT; \
break; \
} \
if (W && drm_can_sleep()) { \
msleep(W); \
if ((W) && drm_can_sleep()) { \
usleep_range((W)*1000, (W)*2000); \
} else { \
cpu_relax(); \
} \
Expand Down

0 comments on commit 9848de0

Please sign in to comment.