Am 2004.10.13 23:37:12 +0200 schrieb(en) Ian Romanick: > Michel Dänzer wrote: > > > Anyway, I think we're on a tangent here, as the problem doesn't seem to > > be PPC specific at all. > > I dug out the Rage 128 that I have for the PC, and it works just fine. > glxgears, readpix, all of it. :( > > The PCI ID on on the PC version is 1002:5046, and on the Mac it's > 1002:5246. Could this be a PRO vs. non-PRO issue? Andreas, what's the > PCI ID on your card? If this isn't an endian problem, my guess is that > there's some hardware bug in the non-PRO version that was fixed in the > PRO. It would be like the R200 vs. RV250 texturing bugs. :( >
Hm... some more confusion: 0) I updated my "Mesa_orig" tree. 1) Then translated your readpix changes from r200_span.c to radeon_span.c, and then got the hang with glxgears/readpix. 2) After reboot I "backported" mesa/sources, radeon_span.c etc. to mesa cvs (including tvertex patch) from before 25.Sep.2004 That worked fine, no hang: I got 6.6MPixel/second where the old code showed only 3.5Mpixel/second. My current card: 1002:5157 ATI Technologies Inc Radeon RV200 QW [Radeon 7500] (rev 0). Could someone else with an R100 test? see attached patch ( some changes to make mesa compile with gcc2.95.3 omitted) @Ian: maybe you could try on your "bad" r128 with an older version of mesa.
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: