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

Keith Packard keithp at keithp.com
Fri Mar 18 16:22:16 CET 2011


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.

Reviewed-by: Keith Packard <keithp at keithp.com>

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20110318/ddfbf49d/attachment.sig>


More information about the Intel-gfx mailing list