[Intel-gfx] [PATCH 7/8] drm/i915: Re-enable self-refresh

Eric Anholt eric at anholt.net
Fri Mar 18 19:12:07 CET 2011


On Fri, 18 Mar 2011 08:22:16 -0700, Keith Packard <keithp at keithp.com> wrote:
> On Fri, 18 Mar 2011 08:02:09 +0000, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> 
> > A broken implementation of is_pot() prevented the detection of when a
> > singular pipe was enabled.
> 
> > -	return mask && (mask & -mask) == 0;
> > +	return mask && (mask & -mask) == mask;
> 
> I think the form
> 
>         mask && (mask & (mask - 1)) == 0
> 
> is easier to reason about.
> 
> But, your fix is also correct as it finds the lowest bit set in 'mask'
> and checks to see if that is the same as mask.

At the risk of bikeshed, is_power_of_2() in log2.h is prettier. (note:
treats 0 as not power of two).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20110318/f1253732/attachment.sig>


More information about the Intel-gfx mailing list