Re: [Mesa-dev] [PATCH 1/2] intel: Fix ROUND_DOWN_TO macro

2011-04-11 Thread Eric Anholt
On Mon, 11 Apr 2011 10:30:42 -0700, "Ian Romanick" wrote: > From: Ian Romanick > > Previously the macro would (ALIGN(value - alignment - 1, alignment)). > At the very least, this was missing parenthesis around "alignment - > 1". As a result, if value was already aligned, it would be reduced by

Re: [Mesa-dev] [PATCH 1/2] intel: Fix ROUND_DOWN_TO macro

2011-04-11 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/11/2011 11:06 AM, Kenneth Graunke wrote: > Acked-by: Kenneth Graunke > > I don't really care whether it's called ALIGN_FLOOR or ROUND_DOWN_TO; > either is fine by me. I might add a comment saying that these only work > if the second parameter

Re: [Mesa-dev] [PATCH 1/2] intel: Fix ROUND_DOWN_TO macro

2011-04-11 Thread Kenneth Graunke
Acked-by: Kenneth Graunke I don't really care whether it's called ALIGN_FLOOR or ROUND_DOWN_TO; either is fine by me. I might add a comment saying that these only work if the second parameter is a power of two. ___ mesa-dev mailing list mesa-dev@li

[Mesa-dev] [PATCH 1/2] intel: Fix ROUND_DOWN_TO macro

2011-04-11 Thread Ian Romanick
From: Ian Romanick Previously the macro would (ALIGN(value - alignment - 1, alignment)). At the very least, this was missing parenthesis around "alignment - 1". As a result, if value was already aligned, it would be reduced by alignment. Condisder: x = ROUND_DOWN_TO(256, 128); This becom