[Mesa-dev] [PATCH] isl: round format alignment to nearest power of 2

2016-08-24 Thread Lionel Landwerlin
A few inline asserts in anv assume alignments are power of 2, but with formats like R8G8B8 we have odd alignments. v2: round up to power of 2 (Ilia) v3: reuse util_next_power_of_two() from gallium/aux/util/u_math.h (Ilia) Signed-off-by: Lionel Landwerlin Cc: Ilia Mirkin Cc: Jason Ekstrand ---

Re: [Mesa-dev] [PATCH] isl: round format alignment to nearest power of 2

2016-08-24 Thread Ilia Mirkin
You may be interested in the implementation in gallium/aux/util/u_math.h: /** * Returns the smallest power of two >= x */ static inline unsigned util_next_power_of_two(unsigned x) { #if defined(HAVE___BUILTIN_CLZ) if (x <= 1) return 1; return (1 << ((sizeof(unsigned) * 8) - __built

[Mesa-dev] [PATCH] isl: round format alignment to nearest power of 2

2016-08-24 Thread Lionel Landwerlin
A few inline asserts in anv assume alignments are power of 2, but with formats like R8G8B8 we have odd alignments. v2: round up to power of 2 (Ilia) Signed-off-by: Lionel Landwerlin Cc: Ilia Mirkin Cc: Jason Ekstrand --- src/intel/isl/isl.c | 1 + src/intel/isl/isl_priv.h | 10 +

Re: [Mesa-dev] [PATCH] isl: round format alignment to nearest power of 2

2016-08-23 Thread Jason Ekstrand
On Tue, Aug 23, 2016 at 5:41 PM, Ilia Mirkin wrote: > On Fri, Aug 19, 2016 at 7:44 PM, Lionel Landwerlin > wrote: > > A few inline asserts in anv assume alignments are power of 2, but with > > formats like R8G8B8 we have odd alignments. > > > > Signed-off-by: Lionel Landwerlin > > --- > > src/

Re: [Mesa-dev] [PATCH] isl: round format alignment to nearest power of 2

2016-08-23 Thread Ilia Mirkin
On Fri, Aug 19, 2016 at 7:44 PM, Lionel Landwerlin wrote: > A few inline asserts in anv assume alignments are power of 2, but with > formats like R8G8B8 we have odd alignments. > > Signed-off-by: Lionel Landwerlin > --- > src/intel/isl/isl.c | 1 + > src/intel/isl/isl_priv.h | 6 ++ > 2

Re: [Mesa-dev] [PATCH] isl: round format alignment to nearest power of 2

2016-08-23 Thread Jason Ekstrand
This seems perfectly reasonable. I don't think rounding up to a power of two can hurt. Reviewed-by: Jason Ekstrand On Mon, Aug 22, 2016 at 10:46 AM, Lionel Landwerlin < lionel.g.landwer...@intel.com> wrote: > The one I actually wanted to Cc you on :) > > > On 20/08/16 00:44, Lionel Landwerlin

Re: [Mesa-dev] [PATCH] isl: round format alignment to nearest power of 2

2016-08-22 Thread Lionel Landwerlin
The one I actually wanted to Cc you on :) On 20/08/16 00:44, Lionel Landwerlin wrote: A few inline asserts in anv assume alignments are power of 2, but with formats like R8G8B8 we have odd alignments. Signed-off-by: Lionel Landwerlin --- src/intel/isl/isl.c | 1 + src/intel/isl/isl_pri

[Mesa-dev] [PATCH] isl: round format alignment to nearest power of 2

2016-08-19 Thread Lionel Landwerlin
A few inline asserts in anv assume alignments are power of 2, but with formats like R8G8B8 we have odd alignments. Signed-off-by: Lionel Landwerlin --- src/intel/isl/isl.c | 1 + src/intel/isl/isl_priv.h | 6 ++ 2 files changed, 7 insertions(+) diff --git a/src/intel/isl/isl.c b/src/in