Am 2004.10.16 00:59:07 +0200 schrieb(en) Ian Romanick: > Andreas Stenglein wrote: > > > Could someone else with an R100 test? > > see attached patch ( some changes to make mesa compile with gcc2.95.3 omitted) > > What were those changes? Were they to avoid the SSE2 code?
1) basically some brackets{} , see attached (complete) patch. 2) no, but sse2 code won't run on my box. Only x86/MMX+/3DNow!+/SSE > In any case, your patch looks good to me. In fact, it looks almost > identical to one that I'm about to commit to the MGA driver. ;) since the old r200 and radeon code was identical, it is identical to your r200 patch, I only changed "r200" -> "radeon" Unfortunately it doesnt work well on my box when applied to mesa-cvs HEAD. > > @Ian: > > maybe you could try on your "bad" r128 with an older version of mesa. > > I'm going to try this weekend. Fun stuff. :( greetings, Andreas
Index: Mesa/configs/linux-dri =================================================================== RCS file: /cvs/mesa/Mesa/configs/linux-dri,v retrieving revision 1.14 diff -u -r1.14 linux-dri --- Mesa/configs/linux-dri 7 Oct 2004 23:30:29 -0000 1.14 +++ Mesa/configs/linux-dri 14 Oct 2004 11:29:58 -0000 @@ -16,7 +16,7 @@ PIC_FLAGS = -fPIC CFLAGS = -DDRI_NEW_INTERFACE_ONLY $(WARN_FLAGS) -g $(OPT_FLAGS) $(ASM_FLAGS) \ - -std=c99 $(PIC_FLAGS) -ffast-math $(SOURCE_FLAGS) -DPTHREADS \ + $(PIC_FLAGS) -ffast-math $(SOURCE_FLAGS) -DPTHREADS \ -DUSE_EXTERNAL_DXTN_LIB=1 \ -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions Index: Mesa/src/mesa/drivers/dri/common/spantmp2.h =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/common/spantmp2.h,v retrieving revision 1.1 diff -u -r1.1 spantmp2.h --- Mesa/src/mesa/drivers/dri/common/spantmp2.h 14 Oct 2004 00:59:12 -0000 1.1 +++ Mesa/src/mesa/drivers/dri/common/spantmp2.h 14 Oct 2004 11:30:00 -0000 @@ -378,6 +378,7 @@ __asm__ __volatile__( "emms" ); #endif + { HW_LOCK() { GLint x1,n1; @@ -400,6 +401,7 @@ HW_ENDCLIPLOOP(); } HW_UNLOCK(); + } #ifndef USE_INNER_EMMS __asm__ __volatile__( "emms" ); #endif @@ -449,6 +451,7 @@ __asm__ __volatile__( "emms" ); #endif + { HW_LOCK() { GLint x1,n1; @@ -471,6 +474,7 @@ HW_ENDCLIPLOOP(); } HW_UNLOCK(); + } #ifndef USE_INNER_EMMS __asm__ __volatile__( "emms" ); #endif Index: Mesa/src/mesa/drivers/dri/r200/r200_tcl.c =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_tcl.c,v retrieving revision 1.12 diff -u -r1.12 r200_tcl.c --- Mesa/src/mesa/drivers/dri/r200/r200_tcl.c 24 Sep 2004 04:20:58 -0000 1.12 +++ Mesa/src/mesa/drivers/dri/r200/r200_tcl.c 14 Oct 2004 11:30:03 -0000 @@ -101,7 +101,11 @@ }; +#if 0 #define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx); (void)rmesa +#else +#define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx) +#endif #define ELT_TYPE GLushort #define ELT_INIT(prim, hw_prim) \ Index: Mesa/src/mesa/drivers/dri/radeon/radeon_span.c =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/radeon/radeon_span.c,v retrieving revision 1.3 diff -u -r1.3 radeon_span.c --- Mesa/src/mesa/drivers/dri/radeon/radeon_span.c 21 Mar 2004 17:05:04 -0000 1.3 +++ Mesa/src/mesa/drivers/dri/radeon/radeon_span.c 14 Oct 2004 11:30:05 -0000 @@ -123,61 +123,27 @@ /* 16 bit, RGB565 color spanline and pixel functions */ -#define INIT_MONO_PIXEL(p, color) \ - p = PACK_COLOR_565( color[0], color[1], color[2] ) -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 8) | \ - (((int)g & 0xfc) << 3) | \ - (((int)b & 0xf8) >> 3)) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLushort *)(buf + _x*2 + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \ - rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \ - rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \ - rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \ - rgba[3] = 0xff; \ - } while (0) - -#define TAG(x) radeon##x##_RGB565 -#include "spantmp.h" +#define GET_SRC_PTR(_x, _y) (read_buf + _x * 2 + _y * pitch) +#define GET_DST_PTR(_x, _y) ( buf + _x * 2 + _y * pitch) +#define SPANTMP_PIXEL_FMT GL_RGB +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5 + +#define TAG(x) radeon##x##_RGB565 +#define TAG2(x,y) radeon##x##_RGB565##y +#include "spantmp2.h" /* 32 bit, ARGB8888 color spanline and pixel functions */ -#undef INIT_MONO_PIXEL -#define INIT_MONO_PIXEL(p, color) \ - p = PACK_COLOR_8888( color[3], color[0], color[1], color[2] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ -do { \ - *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \ - (g << 8) | \ - (r << 16) | \ - (a << 24) ); \ -} while (0) - -#define WRITE_PIXEL( _x, _y, p ) \ -do { \ - *(GLuint *)(buf + _x*4 + _y*pitch) = p; \ -} while (0) - -#define READ_RGBA( rgba, _x, _y ) \ -do { \ - volatile GLuint *ptr = (volatile GLuint *)(read_buf + _x*4 + _y*pitch); \ - GLuint p = *ptr; \ - rgba[0] = (p >> 16) & 0xff; \ - rgba[1] = (p >> 8) & 0xff; \ - rgba[2] = (p >> 0) & 0xff; \ - rgba[3] = (p >> 24) & 0xff; \ -} while (0) - -#define TAG(x) radeon##x##_ARGB8888 -#include "spantmp.h" +#define GET_SRC_PTR(_x, _y) (read_buf + _x * 4 + _y * pitch) +#define GET_DST_PTR(_x, _y) ( buf + _x * 4 + _y * pitch) +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV + +#define TAG(x) radeon##x##_ARGB8888 +#define TAG2(x,y) radeon##x##_ARGB8888##y +#include "spantmp2.h" /* ================================================================ @@ -363,23 +329,11 @@ switch ( rmesa->radeonScreen->cpp ) { case 2: - swdd->WriteRGBASpan = radeonWriteRGBASpan_RGB565; - swdd->WriteRGBSpan = radeonWriteRGBSpan_RGB565; - swdd->WriteMonoRGBASpan = radeonWriteMonoRGBASpan_RGB565; - swdd->WriteRGBAPixels = radeonWriteRGBAPixels_RGB565; - swdd->WriteMonoRGBAPixels = radeonWriteMonoRGBAPixels_RGB565; - swdd->ReadRGBASpan = radeonReadRGBASpan_RGB565; - swdd->ReadRGBAPixels = radeonReadRGBAPixels_RGB565; + radeonInitPointers_RGB565( swdd ); break; case 4: - swdd->WriteRGBASpan = radeonWriteRGBASpan_ARGB8888; - swdd->WriteRGBSpan = radeonWriteRGBSpan_ARGB8888; - swdd->WriteMonoRGBASpan = radeonWriteMonoRGBASpan_ARGB8888; - swdd->WriteRGBAPixels = radeonWriteRGBAPixels_ARGB8888; - swdd->WriteMonoRGBAPixels = radeonWriteMonoRGBAPixels_ARGB8888; - swdd->ReadRGBASpan = radeonReadRGBASpan_ARGB8888; - swdd->ReadRGBAPixels = radeonReadRGBAPixels_ARGB8888; + radeonInitPointers_ARGB8888( swdd ); break; default: Index: Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.c =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.c,v retrieving revision 1.13 diff -u -r1.13 radeon_swtcl.c --- Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.c 24 Sep 2004 03:09:49 -0000 1.13 +++ Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.c 14 Oct 2004 11:30:06 -0000 @@ -508,7 +508,11 @@ +#if 0 #define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx); (void)rmesa +#else +#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx) +#endif #define ELTS_VARS( buf ) GLushort *dest = buf #define INIT( prim ) radeonDmaPrimitive( rmesa, prim ) #define ELT_INIT(prim) radeonEltPrimitive( rmesa, prim ) Index: Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c,v retrieving revision 1.6 diff -u -r1.6 radeon_tcl.c --- Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c 24 Sep 2004 03:09:49 -0000 1.6 +++ Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c 14 Oct 2004 11:30:07 -0000 @@ -105,7 +105,11 @@ }; +#if 0 #define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx); (void)rmesa +#else +#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx) +#endif #define ELT_TYPE GLushort #define ELT_INIT(prim, hw_prim) \