[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Frieder Ferlemann
Hi Alex, not tested (admittedly I haven't compiled it), and probably not really relevant but these switch cases could be more compact: +static inline GLint r600_2d_tile_helper(const struct radeon_renderbuffer * rrb, +GLint x, GLint y, GLint is_depth, GLint is_stencil) ... +

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
> +static inline GLint r600_log2(GLint n) > +{ > + ? ? ? GLint log2 = 0; > + > + ? ? ? while (n >>= 1) > + ? ? ? ? ? ? ? ++log2; > + ? ? ? return log2; > +} Does mesa not provide something like this? Matt

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >> +static inline GLint r600_log2(GLint n) >> +{ >> + ? ? ? GLint log2 = 0; >> + >> + ? ? ? while (n >>= 1) >> + ? ? ? ? ? ? ? ++log2; >> + ? ? ? return log2; >> +} > > Does mesa not provide something like this? The only one I could find was a

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
On Thu, 27 May 2010 11:20:59 -0400 Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: > >> +static inline GLint r600_log2(GLint n) > >> +{ > >> + ? ? ? GLint log2 = 0; > >> + > >> + ? ? ? while (n >>= 1) > >> + ? ? ? ? ? ? ? ++log2; > >> + ? ? ? return log2; > >> +} > > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Brian Paul
Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >>> +static inline GLint r600_log2(GLint n) >>> +{ >>> + GLint log2 = 0; >>> + >>> + while (n >>= 1) >>> + ++log2; >>> + return log2; >>> +} >> Does mesa not provide something like this? > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > Alex Deucher wrote: >> >> On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: +static inline GLint r600_log2(GLint n) +{ + ? ? ? GLint log2 = 0; + + ? ? ? while (n >>= 1) + ? ? ? ? ? ? ? ++log2; + ? ? ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
> Note if it is known that x and y are less than or equal to 7 it can be > done in 11 operations. And bsr is one instruction for x86, cntlzw for ppc Alan

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Frieder Ferlemann
Hi, Am 28.05.2010 00:04, schrieb Conn Clark: > On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > > This code could be written with a faster algorithm requiring just 13 > operations > > + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] > + pixel_number |= ((

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 4:01 PM, Frieder Ferlemann wrote: > Hi, > > Am 28.05.2010 00:04, schrieb Conn Clark: >> On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: >> >> This code could be written with a faster algorithm requiring ?just 13 >> operations >> >> + ? ? ? ? ? ? ? pixel_number |= ((x >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Alan Cox
> Look up tables have some hidden penalties but I think it might be a > win. Looks like we may have to benchmark the solutions against one > another to really know which is best in real life. For x86 and ppc the single assembler instruction is fastest. Can you wire an R600 to anything else ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Frieder Ferlemann
Hi Alex, not tested (admittedly I haven't compiled it), and probably not really relevant but these switch cases could be more compact: +static inline GLint r600_2d_tile_helper(const struct radeon_renderbuffer * rrb, +GLint x, GLint y, GLint is_depth, GLint is_stencil) ... +

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
> +static inline GLint r600_log2(GLint n) > +{ > + ? ? ? GLint log2 = 0; > + > + ? ? ? while (n >>= 1) > + ? ? ? ? ? ? ? ++log2; > + ? ? ? return log2; > +} Does mesa not provide something like this? Matt

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >> +static inline GLint r600_log2(GLint n) >> +{ >> + ? ? ? GLint log2 = 0; >> + >> + ? ? ? while (n >>= 1) >> + ? ? ? ? ? ? ? ++log2; >> + ? ? ? return log2; >> +} > > Does mesa not provide something like this? The only one I could find was a

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
On Thu, 27 May 2010 11:20:59 -0400 Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: > >> +static inline GLint r600_log2(GLint n) > >> +{ > >> + ? ? ? GLint log2 = 0; > >> + > >> + ? ? ? while (n >>= 1) > >> + ? ? ? ? ? ? ? ++log2; > >> + ? ? ? return log2; > >> +} > > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Brian Paul
Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >>> +static inline GLint r600_log2(GLint n) >>> +{ >>> + GLint log2 = 0; >>> + >>> + while (n >>= 1) >>> + ++log2; >>> + return log2; >>> +} >> Does mesa not provide something like this? > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > Alex Deucher wrote: >> >> On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: +static inline GLint r600_log2(GLint n) +{ + ? ? ? GLint log2 = 0; + + ? ? ? while (n >>= 1) + ? ? ? ? ? ? ? ++log2; + ? ? ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
> Note if it is known that x and y are less than or equal to 7 it can be > done in 11 operations. And bsr is one instruction for x86, cntlzw for ppc Alan

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Frieder Ferlemann
Hi, Am 28.05.2010 00:04, schrieb Conn Clark: > On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > > This code could be written with a faster algorithm requiring just 13 > operations > > + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] > + pixel_number |= ((

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 4:01 PM, Frieder Ferlemann wrote: > Hi, > > Am 28.05.2010 00:04, schrieb Conn Clark: >> On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: >> >> This code could be written with a faster algorithm requiring ?just 13 >> operations >> >> + ? ? ? ? ? ? ? pixel_number |= ((x >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Alan Cox
> Look up tables have some hidden penalties but I think it might be a > win. Looks like we may have to benchmark the solutions against one > another to really know which is best in real life. For x86 and ppc the single assembler instruction is fastest. Can you wire an R600 to anything else ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Frieder Ferlemann
Hi Alex, not tested (admittedly I haven't compiled it), and probably not really relevant but these switch cases could be more compact: +static inline GLint r600_2d_tile_helper(const struct radeon_renderbuffer * rrb, +GLint x, GLint y, GLint is_depth, GLint is_stencil) ... +

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
> +static inline GLint r600_log2(GLint n) > +{ > + ? ? ? GLint log2 = 0; > + > + ? ? ? while (n >>= 1) > + ? ? ? ? ? ? ? ++log2; > + ? ? ? return log2; > +} Does mesa not provide something like this? Matt

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >> +static inline GLint r600_log2(GLint n) >> +{ >> + ? ? ? GLint log2 = 0; >> + >> + ? ? ? while (n >>= 1) >> + ? ? ? ? ? ? ? ++log2; >> + ? ? ? return log2; >> +} > > Does mesa not provide something like this? The only one I could find was a

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
On Thu, 27 May 2010 11:20:59 -0400 Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: > >> +static inline GLint r600_log2(GLint n) > >> +{ > >> + ? ? ? GLint log2 = 0; > >> + > >> + ? ? ? while (n >>= 1) > >> + ? ? ? ? ? ? ? ++log2; > >> + ? ? ? return log2; > >> +} > > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Brian Paul
Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >>> +static inline GLint r600_log2(GLint n) >>> +{ >>> + GLint log2 = 0; >>> + >>> + while (n >>= 1) >>> + ++log2; >>> + return log2; >>> +} >> Does mesa not provide something like this? > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > Alex Deucher wrote: >> >> On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: +static inline GLint r600_log2(GLint n) +{ + ? ? ? GLint log2 = 0; + + ? ? ? while (n >>= 1) + ? ? ? ? ? ? ? ++log2; + ? ? ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
> Note if it is known that x and y are less than or equal to 7 it can be > done in 11 operations. And bsr is one instruction for x86, cntlzw for ppc Alan

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Frieder Ferlemann
Hi, Am 28.05.2010 00:04, schrieb Conn Clark: > On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > > This code could be written with a faster algorithm requiring just 13 > operations > > + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] > + pixel_number |= ((

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 4:01 PM, Frieder Ferlemann wrote: > Hi, > > Am 28.05.2010 00:04, schrieb Conn Clark: >> On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: >> >> This code could be written with a faster algorithm requiring ?just 13 >> operations >> >> + ? ? ? ? ? ? ? pixel_number |= ((x >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Alan Cox
> Look up tables have some hidden penalties but I think it might be a > win. Looks like we may have to benchmark the solutions against one > another to really know which is best in real life. For x86 and ppc the single assembler instruction is fastest. Can you wire an R600 to anything else ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Frieder Ferlemann
Hi Alex, not tested (admittedly I haven't compiled it), and probably not really relevant but these switch cases could be more compact: +static inline GLint r600_2d_tile_helper(const struct radeon_renderbuffer * rrb, +GLint x, GLint y, GLint is_depth, GLint is_stencil) ... +

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
> +static inline GLint r600_log2(GLint n) > +{ > + ? ? ? GLint log2 = 0; > + > + ? ? ? while (n >>= 1) > + ? ? ? ? ? ? ? ++log2; > + ? ? ? return log2; > +} Does mesa not provide something like this? Matt

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >> +static inline GLint r600_log2(GLint n) >> +{ >> + ? ? ? GLint log2 = 0; >> + >> + ? ? ? while (n >>= 1) >> + ? ? ? ? ? ? ? ++log2; >> + ? ? ? return log2; >> +} > > Does mesa not provide something like this? The only one I could find was a

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
On Thu, 27 May 2010 11:20:59 -0400 Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: > >> +static inline GLint r600_log2(GLint n) > >> +{ > >> + ? ? ? GLint log2 = 0; > >> + > >> + ? ? ? while (n >>= 1) > >> + ? ? ? ? ? ? ? ++log2; > >> + ? ? ? return log2; > >> +} > > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Brian Paul
Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >>> +static inline GLint r600_log2(GLint n) >>> +{ >>> + GLint log2 = 0; >>> + >>> + while (n >>= 1) >>> + ++log2; >>> + return log2; >>> +} >> Does mesa not provide something like this? > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > Alex Deucher wrote: >> >> On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: +static inline GLint r600_log2(GLint n) +{ + ? ? ? GLint log2 = 0; + + ? ? ? while (n >>= 1) + ? ? ? ? ? ? ? ++log2; + ? ? ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
> Note if it is known that x and y are less than or equal to 7 it can be > done in 11 operations. And bsr is one instruction for x86, cntlzw for ppc Alan

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Frieder Ferlemann
Hi, Am 28.05.2010 00:04, schrieb Conn Clark: > On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > > This code could be written with a faster algorithm requiring just 13 > operations > > + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] > + pixel_number |= ((

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 4:01 PM, Frieder Ferlemann wrote: > Hi, > > Am 28.05.2010 00:04, schrieb Conn Clark: >> On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: >> >> This code could be written with a faster algorithm requiring ?just 13 >> operations >> >> + ? ? ? ? ? ? ? pixel_number |= ((x >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Alan Cox
> Look up tables have some hidden penalties but I think it might be a > win. Looks like we may have to benchmark the solutions against one > another to really know which is best in real life. For x86 and ppc the single assembler instruction is fastest. Can you wire an R600 to anything else ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Frieder Ferlemann
Hi Alex, not tested (admittedly I haven't compiled it), and probably not really relevant but these switch cases could be more compact: +static inline GLint r600_2d_tile_helper(const struct radeon_renderbuffer * rrb, +GLint x, GLint y, GLint is_depth, GLint is_stencil) ... +

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
> +static inline GLint r600_log2(GLint n) > +{ > + ? ? ? GLint log2 = 0; > + > + ? ? ? while (n >>= 1) > + ? ? ? ? ? ? ? ++log2; > + ? ? ? return log2; > +} Does mesa not provide something like this? Matt

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >> +static inline GLint r600_log2(GLint n) >> +{ >> + ? ? ? GLint log2 = 0; >> + >> + ? ? ? while (n >>= 1) >> + ? ? ? ? ? ? ? ++log2; >> + ? ? ? return log2; >> +} > > Does mesa not provide something like this? The only one I could find was a

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
On Thu, 27 May 2010 11:20:59 -0400 Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: > >> +static inline GLint r600_log2(GLint n) > >> +{ > >> + ? ? ? GLint log2 = 0; > >> + > >> + ? ? ? while (n >>= 1) > >> + ? ? ? ? ? ? ? ++log2; > >> + ? ? ? return log2; > >> +} > > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Brian Paul
Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >>> +static inline GLint r600_log2(GLint n) >>> +{ >>> + GLint log2 = 0; >>> + >>> + while (n >>= 1) >>> + ++log2; >>> + return log2; >>> +} >> Does mesa not provide something like this? > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > Alex Deucher wrote: >> >> On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: +static inline GLint r600_log2(GLint n) +{ + ? ? ? GLint log2 = 0; + + ? ? ? while (n >>= 1) + ? ? ? ? ? ? ? ++log2; + ? ? ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
> Note if it is known that x and y are less than or equal to 7 it can be > done in 11 operations. And bsr is one instruction for x86, cntlzw for ppc Alan

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Frieder Ferlemann
Hi, Am 28.05.2010 00:04, schrieb Conn Clark: > On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > > This code could be written with a faster algorithm requiring just 13 > operations > > + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] > + pixel_number |= ((

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 4:01 PM, Frieder Ferlemann wrote: > Hi, > > Am 28.05.2010 00:04, schrieb Conn Clark: >> On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: >> >> This code could be written with a faster algorithm requiring ?just 13 >> operations >> >> + ? ? ? ? ? ? ? pixel_number |= ((x >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Alan Cox
> Look up tables have some hidden penalties but I think it might be a > win. Looks like we may have to benchmark the solutions against one > another to really know which is best in real life. For x86 and ppc the single assembler instruction is fastest. Can you wire an R600 to anything else ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Frieder Ferlemann
Hi Alex, not tested (admittedly I haven't compiled it), and probably not really relevant but these switch cases could be more compact: +static inline GLint r600_2d_tile_helper(const struct radeon_renderbuffer * rrb, +GLint x, GLint y, GLint is_depth, GLint is_stencil) ... +

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
> +static inline GLint r600_log2(GLint n) > +{ > + ? ? ? GLint log2 = 0; > + > + ? ? ? while (n >>= 1) > + ? ? ? ? ? ? ? ++log2; > + ? ? ? return log2; > +} Does mesa not provide something like this? Matt

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >> +static inline GLint r600_log2(GLint n) >> +{ >> + ? ? ? GLint log2 = 0; >> + >> + ? ? ? while (n >>= 1) >> + ? ? ? ? ? ? ? ++log2; >> + ? ? ? return log2; >> +} > > Does mesa not provide something like this? The only one I could find was a

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
On Thu, 27 May 2010 11:20:59 -0400 Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: > >> +static inline GLint r600_log2(GLint n) > >> +{ > >> + ? ? ? GLint log2 = 0; > >> + > >> + ? ? ? while (n >>= 1) > >> + ? ? ? ? ? ? ? ++log2; > >> + ? ? ? return log2; > >> +} > > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Brian Paul
Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >>> +static inline GLint r600_log2(GLint n) >>> +{ >>> + GLint log2 = 0; >>> + >>> + while (n >>= 1) >>> + ++log2; >>> + return log2; >>> +} >> Does mesa not provide something like this? > >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > Alex Deucher wrote: >> >> On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: +static inline GLint r600_log2(GLint n) +{ + ? ? ? GLint log2 = 0; + + ? ? ? while (n >>= 1) + ? ? ? ? ? ? ? ++log2; + ? ? ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
> Note if it is known that x and y are less than or equal to 7 it can be > done in 11 operations. And bsr is one instruction for x86, cntlzw for ppc Alan

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Frieder Ferlemann
Hi, Am 28.05.2010 00:04, schrieb Conn Clark: > On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > > This code could be written with a faster algorithm requiring just 13 > operations > > + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] > + pixel_number |= ((

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 4:01 PM, Frieder Ferlemann wrote: > Hi, > > Am 28.05.2010 00:04, schrieb Conn Clark: >> On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: >> >> This code could be written with a faster algorithm requiring ?just 13 >> operations >> >> + ? ? ? ? ? ? ? pixel_number |= ((x >

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-28 Thread Alan Cox
> Look up tables have some hidden penalties but I think it might be a > win. Looks like we may have to benchmark the solutions against one > another to really know which is best in real life. For x86 and ppc the single assembler instruction is fastest. Can you wire an R600 to anything else ?

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

[PATCH 1/3] r600: add span support for 2D tiling

2010-05-25 Thread Alex Deucher
Requires tiling config ioctl support from the drm to use. kms only. Signed-off-by: Alex Deucher --- .../drivers/dri/radeon/radeon_common_context.c |9 +- .../drivers/dri/radeon/radeon_common_context.h |7 + src/mesa/drivers/dri/radeon/radeon_screen.h|7 + src/mesa/dri

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Frieder Ferlemann
Hi Alex, not tested (admittedly I haven't compiled it), and probably not really relevant but these switch cases could be more compact: +static inline GLint r600_2d_tile_helper(const struct radeon_renderbuffer * rrb, +GLint x, GLint y, GLint is_depth, GLint is_stencil) ... +

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
> +static inline GLint r600_log2(GLint n) > +{ > +       GLint log2 = 0; > + > +       while (n >>= 1) > +               ++log2; > +       return log2; > +} Does mesa not provide something like this? Matt ___ dri-devel mailing list dri-devel@lists.freed

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >> +static inline GLint r600_log2(GLint n) >> +{ >> +       GLint log2 = 0; >> + >> +       while (n >>= 1) >> +               ++log2; >> +       return log2; >> +} > > Does mesa not provide something like this? The only one I could find was a

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
On Thu, 27 May 2010 11:20:59 -0400 Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: > >> +static inline GLint r600_log2(GLint n) > >> +{ > >> +       GLint log2 = 0; > >> + > >> +       while (n >>= 1) > >> +               ++log2; > >> +       return log2; > >> +} > > >

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Brian Paul
Alex Deucher wrote: On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: +static inline GLint r600_log2(GLint n) +{ + GLint log2 = 0; + + while (n >>= 1) + ++log2; + return log2; +} Does mesa not provide something like this? The only one I could find was a gal

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > Alex Deucher wrote: >> >> On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: +static inline GLint r600_log2(GLint n) +{ +       GLint log2 = 0; + +       while (n >>= 1) +               ++log2; +      

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
> Note if it is known that x and y are less than or equal to 7 it can be > done in 11 operations. And bsr is one instruction for x86, cntlzw for ppc Alan ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/lis

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Frieder Ferlemann
Hi, Am 28.05.2010 00:04, schrieb Conn Clark: > On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: > > This code could be written with a faster algorithm requiring just 13 > operations > > + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] > + pixel_number |= ((

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Conn Clark
On Thu, May 27, 2010 at 4:01 PM, Frieder Ferlemann wrote: > Hi, > > Am 28.05.2010 00:04, schrieb Conn Clark: >> On Thu, May 27, 2010 at 8:51 AM, Brian Paul wrote: >> >> This code could be written with a faster algorithm requiring  just 13 >> operations >> >> +               pixel_number |= ((x >

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
> Look up tables have some hidden penalties but I think it might be a > win. Looks like we may have to benchmark the solutions against one > another to really know which is best in real life. For x86 and ppc the single assembler instruction is fastest. Can you wire an R600 to anything else ? _

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
On Thu, May 27, 2010 at 7:52 PM, Alan Cox wrote: >> Look up tables have some hidden penalties but I think it might be a >> win. Looks like we may have to benchmark the solutions against one >> another to really know which is best in real life. > > For x86 and ppc the single assembler instruction i

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Frieder Ferlemann
Hi Alex, not tested (admittedly I haven't compiled it), and probably not really relevant but these switch cases could be more compact: +static inline GLint r600_2d_tile_helper(const struct radeon_renderbuffer * rrb, +GLint x, GLint y, GLint is_depth, GLint is_stencil) ... +

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Matt Turner
> +static inline GLint r600_log2(GLint n) > +{ > +       GLint log2 = 0; > + > +       while (n >>= 1) > +               ++log2; > +       return log2; > +} Does mesa not provide something like this? Matt ___ dri-devel mailing list dri-devel@lists.freed

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alex Deucher
On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: >> +static inline GLint r600_log2(GLint n) >> +{ >> +       GLint log2 = 0; >> + >> +       while (n >>= 1) >> +               ++log2; >> +       return log2; >> +} > > Does mesa not provide something like this? The only one I could find was a

Re: [PATCH 1/3] r600: add span support for 2D tiling

2010-05-27 Thread Alan Cox
On Thu, 27 May 2010 11:20:59 -0400 Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: > >> +static inline GLint r600_log2(GLint n) > >> +{ > >> +       GLint log2 = 0; > >> + > >> +       while (n >>= 1) > >> +               ++log2; > >> +       return log2; > >> +} > > >

  1   2   >