On Fri, Mar 20, 2015 at 12:31:16PM -0700, Jesse Barnes wrote:
> On 03/20/2015 12:28 PM, ville.syrj...@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrj...@linux.intel.com>
> > 
> > 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 <jbar...@virtuousgeek.org>
> > Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_drv.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h 
> > b/drivers/gpu/drm/i915/intel_drv.h
> > index 6f20f3a..d2a4de0 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -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();                                    \
> >             }                                                       \
> > 
> 
> Nice improvement!  I guess it's just because usleep_range() uses an
> hrtimeout, but since we have the added slop of the range it may actually
> be an improvement, power-wise too.
> 
> Reviewed-by: Jesse Barnes <jbar...@virtuousgeek.org>

Nice indeed. Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to