diff -ur mesa3/src/mesa/drivers/dri/unichrome/via_context.c mesa4/src/mesa/drivers/dri/unichrome/via_context.c --- mesa3/src/mesa/drivers/dri/unichrome/via_context.c 2007-02-26 15:56:46.000000000 +0000 +++ mesa4/src/mesa/drivers/dri/unichrome/via_context.c 2007-02-28 20:11:28.000000000 +0000 @@ -766,8 +766,6 @@ drawable); } - draw_buffer->drawXoff = (GLuint)(((drawable->x * bytePerPixel) & 0x1f) / - bytePerPixel); draw_buffer->drawX = drawable->x; draw_buffer->drawY = drawable->y; draw_buffer->drawW = drawable->w; @@ -780,8 +778,6 @@ readable); } - read_buffer->drawXoff = (GLuint)(((readable->x * bytePerPixel) & 0x1f) / - bytePerPixel); read_buffer->drawX = readable->x; read_buffer->drawY = readable->y; read_buffer->drawW = readable->w; diff -ur mesa3/src/mesa/drivers/dri/unichrome/via_context.h mesa4/src/mesa/drivers/dri/unichrome/via_context.h --- mesa3/src/mesa/drivers/dri/unichrome/via_context.h 2007-02-26 14:56:01.000000000 +0000 +++ mesa4/src/mesa/drivers/dri/unichrome/via_context.h 2007-02-28 20:12:14.000000000 +0000 @@ -104,11 +104,6 @@ int drawW; int drawH; - int drawXoff; /* drawX is 32byte aligned - this is - * the delta to the real origin, in - * pixel units. - */ - __DRIdrawablePrivate *dPriv; }; diff -ur mesa3/src/mesa/drivers/dri/unichrome/via_ioctl.c mesa4/src/mesa/drivers/dri/unichrome/via_ioctl.c --- mesa3/src/mesa/drivers/dri/unichrome/via_ioctl.c 2007-02-26 15:56:46.000000000 +0000 +++ mesa4/src/mesa/drivers/dri/unichrome/via_ioctl.c 2007-02-28 19:23:54.000000000 +0000 @@ -276,7 +276,7 @@ /* flip top to bottom */ cy = dPriv->h - cy - ch; - cx += vrb->drawX + vrb->drawXoff; + cx += vrb->drawX; cy += vrb->drawY; if (!all) { @@ -768,7 +768,7 @@ vb[4] = (HC_SubA_HDBBasL << 24) | (offset & 0xFFFFFF); vb[5] = (HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000) >> 24); - vb[6] = (HC_SubA_HSPXYOS << 24) | ((31 - buffer->drawXoff) << HC_HSPXOS_SHIFT); + vb[6] = (HC_SubA_HSPXYOS << 24); vb[7] = (HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch; } @@ -891,8 +891,8 @@ for (i = 0; i < vmesa->numClipRects; i++) { drm_clip_rect_t b; - b.x1 = pbox[i].x1 - vrb->drawXoff; - b.x2 = pbox[i].x2 - vrb->drawXoff; + b.x1 = pbox[i].x1; + b.x2 = pbox[i].x2; b.y1 = pbox[i].y1; b.y2 = pbox[i].y2; @@ -900,8 +900,6 @@ !intersect_rect(&b, &b, &vmesa->scissorRect)) continue; - b.x1 += vrb->drawXoff; - b.x2 += vrb->drawXoff; via_emit_cliprect(vmesa, &b); diff -ur mesa3/src/mesa/drivers/dri/unichrome/via_span.c mesa4/src/mesa/drivers/dri/unichrome/via_span.c --- mesa3/src/mesa/drivers/dri/unichrome/via_span.c 2007-02-26 14:56:01.000000000 +0000 +++ mesa4/src/mesa/drivers/dri/unichrome/via_span.c 2007-02-28 19:24:30.000000000 +0000 @@ -46,7 +46,7 @@ GLuint pitch = vrb->pitch; \ GLuint height = dPriv->h; \ GLint p = 0; \ - char *buf = (char *)(vrb->origMap + vrb->drawXoff * vrb->bpp); \ + char *buf = (char *)(vrb->origMap); \ (void) p; /* ================================================================ @@ -82,7 +82,7 @@ __DRIdrawablePrivate *dPriv = vrb->dPriv; \ GLuint depth_pitch = vrb->pitch; \ GLuint height = dPriv->h; \ - char *buf = (char *)(vrb->map + (vrb->drawXoff * vrb->bpp/8)) + char *buf = (char *)(vrb->map) #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS diff -ur mesa3/src/mesa/drivers/dri/unichrome/via_state.c mesa4/src/mesa/drivers/dri/unichrome/via_state.c --- mesa3/src/mesa/drivers/dri/unichrome/via_state.c 2007-02-27 00:52:33.000000000 +0000 +++ mesa4/src/mesa/drivers/dri/unichrome/via_state.c 2007-02-28 20:14:02.000000000 +0000 @@ -500,10 +500,8 @@ OUT_RING( HC_HEADER2 ); OUT_RING( (HC_ParaType_NotTex << 16) ); - OUT_RING( (HC_SubA_HSPXYOS << 24) | - (((32- vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT)); - OUT_RING( (HC_SubA_HSPXYOS << 24) | - (((32 - vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT)); + OUT_RING( (HC_SubA_HSPXYOS << 24); + OUT_RING( (HC_SubA_HSPXYOS << 24); ADVANCE_RING(); } @@ -716,8 +714,7 @@ */ -/* Using drawXoff like this is incorrect outside of locked regions. - * This hardware just isn't capable of private back buffers without +/* This hardware just isn't capable of private back buffers without * glitches and/or a hefty locking scheme. */ void viaCalcViewport(GLcontext *ctx)