summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgareth <gareth>2001-03-06 01:42:27 +0000
committergareth <gareth>2001-03-06 01:42:27 +0000
commit3b1376139cf0aca4f5cfd395be0212ab37cb6648 (patch)
treeaefe8929f02ee4672a5deec19e4bc01168003f26
parentd65676277c071108045395ed0a3bd9e8dffb18f7 (diff)
Grab latest updates from trunk.tdfx-3-1-0-20010305-merge
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810ioctl.c9
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810span.c13
2 files changed, 15 insertions, 7 deletions
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
index 2f16e33d7..146b6c1b9 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
@@ -200,7 +200,6 @@ void i810DmaFinish( i810ContextPtr imesa )
FLUSH_BATCH( imesa );
if (imesa->sarea->last_quiescent != imesa->sarea->last_enqueue) {
-
if (I810_DEBUG&DEBUG_VERBOSE_IOCTL)
fprintf(stderr, "i810DmaFinish\n");
@@ -214,14 +213,22 @@ void i810DmaFinish( i810ContextPtr imesa )
void i810RegetLockQuiescent( i810ContextPtr imesa )
{
+ /* XXX I disabled this conditional. Doing so fixes all the readpixels
+ * problems. The problem was that we'd sometimes read from the frame
+ * buffer (via the span functions) before rendering was completed.
+ * Taking out this conditional solves that problem. (BrianP)
+ *
if (imesa->sarea->last_quiescent != imesa->sarea->last_enqueue) {
+ */
if (I810_DEBUG&DEBUG_VERBOSE_IOCTL)
fprintf(stderr, "i810RegetLockQuiescent\n");
drmUnlock(imesa->driFd, imesa->hHWContext);
i810GetLock( imesa, DRM_LOCK_QUIESCENT );
imesa->sarea->last_quiescent = imesa->sarea->last_enqueue;
+ /*
}
+ */
}
void i810WaitAgeLocked( i810ContextPtr imesa, int age )
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810span.c b/xc/lib/GL/mesa/src/drv/i810/i810span.c
index 88b5f9236..4bf02ad13 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810span.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810span.c
@@ -30,7 +30,7 @@
dPriv->x * 2 + \
dPriv->y * pitch)
-#define INIT_MONO_PIXEL(p)
+#define INIT_MONO_PIXEL(p)
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
_y >= miny && _y < maxy)
@@ -51,6 +51,7 @@
#define HW_LOCK() \
i810ContextPtr imesa = I810_CONTEXT(ctx); \
FLUSH_BATCH(imesa); \
+ i810DmaFinish(imesa); \
LOCK_HARDWARE_QUIESCENT(imesa);
#define HW_CLIPLOOP() \
@@ -86,9 +87,9 @@
#define READ_RGBA( rgba, _x, _y ) \
do { \
GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
- rgba[0] = (p >> 8) & 0xf8; \
- rgba[1] = (p >> 3) & 0xfc; \
- rgba[2] = (p << 3) & 0xf8; \
+ rgba[0] = (((p >> 11) & 0x1f) * 255) / 31; \
+ rgba[1] = (((p >> 5) & 0x3f) * 255) / 63; \
+ rgba[2] = (((p >> 0) & 0x1f) * 255) / 31; \
rgba[3] = 255; \
} while(0)
@@ -129,7 +130,7 @@ do { \
*(GLushort *)(buf + _x*2 + _y*pitch) = d;
#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + _x*2 + _y*pitch);
+ d = *(GLushort *)(buf + _x*2 + _y*pitch);
/* d = 0xffff; */
@@ -145,7 +146,7 @@ void i810DDInitSpanFuncs( GLcontext *ctx )
ctx->Driver.WriteRGBSpan = i810WriteRGBSpan_565;
ctx->Driver.WriteMonoRGBASpan = i810WriteMonoRGBASpan_565;
ctx->Driver.WriteRGBAPixels = i810WriteRGBAPixels_565;
- ctx->Driver.WriteMonoRGBAPixels = i810WriteMonoRGBAPixels_565;
+ ctx->Driver.WriteMonoRGBAPixels = i810WriteMonoRGBAPixels_565;
ctx->Driver.ReadRGBASpan = i810ReadRGBASpan_565;
ctx->Driver.ReadRGBAPixels = i810ReadRGBAPixels_565;
} else {