The coordinates need to be computed after we've got the hw lock.
Code updated to:
1. Ignore all/x/y/width/height/ params passed to Clear func.
2. Pass 0,0,0,0,0 to _swrast_Clear() until they're totally removed.
}
static void
-ffb_do_clear(ffbContextPtr fmesa, __DRIdrawablePrivate *dPriv,
- GLboolean all, GLint cx, GLint cy, GLint cwidth,
- GLint cheight)
+ffb_do_clear(GLcontext *ctx, __DRIdrawablePrivate *dPriv)
{
+ ffbContextPtr fmesa = FFB_CONTEXT(ctx);
FFBDRIPtr gDRIPriv = (FFBDRIPtr) fmesa->driScreen->pDevPriv;
ffb_fbcPtr ffb = fmesa->regs;
drm_clip_rect_t *box = dPriv->pClipRects;
int nc = dPriv->numClipRects;
+ GLint cx, cy, cw, ch;
+
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
- cy = dPriv->h - cy - cheight;
+ cy = dPriv->h - cy - ch;
cx += dPriv->x;
cy += dPriv->y;
int paligned_h, paligned_w = 0;
int extra_work;
- if (!all) {
- if (x < cx) {
- width -= cx - x;
- x = cx;
- }
- if (y < cy) {
- height -= cy - y;
- y = cy;
- }
- if (x + width > cx + cwidth)
- width = cx + cwidth - x;
- if (y + height > cy + cheight)
- height = cy + cheight - y;
- if (width <= 0)
- continue;
- if (height <= 0)
- continue;
- }
-
if (BOX_AREA(width, height) < gDRIPriv->fastfill_small_area) {
FFBFifo(fmesa, 5);
ffb->drawop = FFB_DRAWOP_RECTANGLE;
}
}
-void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cwidth, GLint cheight)
+void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwidthFoo, GLint cheightFoo)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
unsigned int stcmask = BUFFER_BIT_STENCIL;
#ifdef CLEAR_TRACE
- fprintf(stderr, "ffbDDClear: mask(%08x) all(%d) "
- "[x(%x)y(%x)w(%x)h(%x)]\n",
- mask, (int) all, cx, cy, cwidth, cheight);
+ fprintf(stderr, "ffbDDClear: mask(%08x) \n", mask);
#endif
if (!(fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS))
stcmask = 0;
if (mask & stcmask)
ffb->consty = fmesa->clear_stencil;
- ffb_do_clear(fmesa, dPriv, all, cx, cy, cwidth, cheight);
+ ffb_do_clear(ctx, dPriv);
FFBFifo(fmesa, 6);
ffb->ppc = fmesa->ppc;
}
if (mask)
- _swrast_Clear(ctx, mask, all, cx, cy, cwidth, cheight);
+ _swrast_Clear(ctx, mask, 0, 0, 0, 0, 0);
}
#define DEPTH_SCALE ((1<<16)-1)
-static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = imesa->driDrawable;
}
if (clear.flags) {
+ GLint cx, cy, cw, ch;
+
LOCK_HARDWARE( imesa );
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* flip top to bottom */
cy = dPriv->h-cy-ch;
cx += imesa->drawX;
drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes;
int n = 0;
- if (!all) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear sub region */
for ( ; i < nr ; i++) {
GLint x = box[i].x1;
GLint y = box[i].y1;
n++;
}
} else {
+ /* clear whole buffer */
for ( ; i < nr ; i++) {
*b++ = box[i];
n++;
}
if (mask)
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
}
* Buffer clear
*/
-static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
GLuint flags = 0;
GLint i;
GLint ret;
+ GLint cx, cy, cw, ch;
if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s: all=%d %d,%d %dx%d\n",
- __FUNCTION__, all, cx, cy, cw, ch );
+ fprintf( stderr, "mach64DDClear\n");
}
#if ENABLE_PERF_BOXES
}
if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
if ( !flags )
return;
LOCK_HARDWARE( mmesa );
- /* This needs to be in the locked region, so updated drawable origin is used */
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* Flip top to bottom */
cx += mmesa->drawX;
cy = mmesa->drawY + dPriv->h - cy - ch;
drm_clip_rect_t *b = mmesa->sarea->boxes;
GLint n = 0;
- if ( !all ) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++ ) {
GLint x = box[i].x1;
GLint y = box[i].y1;
n++;
}
} else {
+ /* clear whole window */
for ( ; i < nr ; i++ ) {
*b++ = box[i];
n++;
static void
-mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
int i;
static int nrclears;
drm_mga_clear_t clear;
+ GLint cx, cy, cw, ch;
FLUSH_BATCH( mmesa );
if ( flags ) {
LOCK_HARDWARE( mmesa );
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
if ( mmesa->dirty_cliprects )
mgaUpdateRects( mmesa, (MGA_FRONT | MGA_BACK) );
drm_clip_rect_t *b = mmesa->sarea->boxes;
int n = 0;
- if (!all) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++) {
GLint x = box[i].x1;
GLint y = box[i].y1;
n++;
}
} else {
+ /* clear whole window */
for ( ; i < nr ; i++) {
*b++ = box[i];
n++;
}
if (mask)
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
}
* Buffer clear
*/
-static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->driDrawable;
GLint i;
GLint ret;
GLuint depthmask = 0;
+ GLint cx, cy, cw, ch;
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s:\n", __FUNCTION__ );
if ( flags ) {
+ LOCK_HARDWARE( rmesa );
+
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* Flip top to bottom */
cx += dPriv->x;
cy = dPriv->y + dPriv->h - cy - ch;
- LOCK_HARDWARE( rmesa );
-
/* FIXME: Do we actually need this?
*/
if ( rmesa->dirty & ~R128_UPLOAD_CLIPRECTS ) {
drm_clip_rect_t *b = rmesa->sarea->boxes;
GLint n = 0;
- if ( !all ) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++ ) {
GLint x = box[i].x1;
GLint y = box[i].y1;
n++;
}
} else {
+ /* clear whole window */
for ( ; i < nr ; i++ ) {
*b++ = box[i];
n++;
}
if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
}
/* ================================================================
* Buffer clear
*/
-static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
GLuint flags = 0;
GLuint color_mask = 0;
GLint ret, i;
+ GLint cx, cy, cw, ch;
if ( R200_DEBUG & DEBUG_IOCTL ) {
- fprintf( stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n",
- __FUNCTION__, all, cx, cy, cw, ch );
+ fprintf( stderr, "r200Clear\n");
}
{
if ( mask ) {
if (R200_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask);
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
}
if ( !flags )
}
}
+ LOCK_HARDWARE( rmesa );
+
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* Flip top to bottom */
cx += dPriv->x;
cy = dPriv->y + dPriv->h - cy - ch;
- LOCK_HARDWARE( rmesa );
-
/* Throttle the number of clear ioctls we do.
*/
while ( 1 ) {
drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
GLint n = 0;
- if ( !all ) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++ ) {
GLint x = box[i].x1;
GLint y = box[i].y1;
n++;
}
} else {
+ /* clear whole window */
for ( ; i < nr ; i++ ) {
*b++ = box[i];
n++;
/**
* Buffer clear
*/
-static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
+static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable;
int swapped;
if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n",
- __FUNCTION__, all, cx, cy, cw, ch);
+ fprintf(stderr, "r300Clear\n");
{
LOCK_HARDWARE(&r300->radeon);
if (RADEON_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n",
__FUNCTION__, mask);
- _swrast_Clear(ctx, mask, all, cx, cy, cw, ch);
+ _swrast_Clear(ctx, mask, 0, 0, 0, 0, 0);
}
swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1);
*/
#define RADEON_MAX_CLEARS 256
-static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
GLuint flags = 0;
GLuint color_mask = 0;
GLint ret, i;
+ GLint cx, cy, cw, ch;
if ( RADEON_DEBUG & DEBUG_IOCTL ) {
- fprintf( stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n",
- __FUNCTION__, all, cx, cy, cw, ch );
+ fprintf( stderr, "radeonClear\n");
}
{
if ( mask ) {
if (RADEON_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask);
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
}
if ( !flags )
LOCK_HARDWARE( rmesa );
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* Throttle the number of clear ioctls we do.
*/
while ( 1 ) {
drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
GLint n = 0;
- if ( !all ) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++ ) {
GLint x = box[i].x1;
GLint y = box[i].y1;
n++;
}
} else {
+ /* clear whole buffer */
for ( ; i < nr ; i++ ) {
*b++ = box[i];
n++;
* Buffer clear
*/
-static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{
s3vContextPtr vmesa = S3V_CONTEXT(ctx);
unsigned int _stride;
+ GLint cx = ctx->DrawBuffer->_Xmin;
+ GLint cy = ctx->DrawBuffer->_Ymin;
+ GLint cw = ctx->DrawBuffer->_Xmax - cx;
+ GLint ch = ctx->DrawBuffer->_Ymax - cy;
+
+ /* XXX FIX ME: the cx,cy,cw,ch vars are currently ignored! */
vmesa->restore_primitive = -1;
if (mask & BUFFER_BIT_DEPTH) { /* depth */
DEBUG(("BUFFER_BIT_DEPTH\n"));
- _stride = ((cw+31)&~31) * 2;
+ _stride = ((cw+31)&~31) * 2; /* XXX cw or Buffer->Width??? */
DMAOUT_CHECK(BITBLT_SRC_BASE, 15);
DMAOUT(0);
if ( mask )
DEBUG(("still masked ;3(\n")); */ /* yes */
#else
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
#endif
}
}
-static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
+ savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
GLuint colorMask, depthMask, clearColor, clearDepth, flags;
+ GLint cx = ctx->DrawBuffer->_Xmin;
+ GLint cy = ctx->DrawBuffer->_Ymin;
+ GLint cw = ctx->DrawBuffer->_Xmax - cx;
+ GLint ch = ctx->DrawBuffer->_Ymax - cy;
+
+ /* XXX FIX ME: the cx,cy,cw,ch vars are currently ignored! */
if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
fprintf (stderr, "%s\n", __FUNCTION__);
}
if (mask)
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
}
/*
}
void
-sis6326DDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height)
+sis6326DDClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
+ GLint xFoo, GLint yFoo, GLint widthFoo, GLint heightFoo)
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
GLint x1, y1, width1, height1;
- if (all) {
- GLframebuffer *buffer = ctx->DrawBuffer;
-
- x1 = 0;
- y1 = 0;
- width1 = buffer->Width;
- height1 = buffer->Height;
- } else {
- x1 = x;
- y1 = Y_FLIP(y+height-1);
- width1 = width;
- height1 = height;
- }
+ /* get region after locking: */
+ x1 = ctx->DrawBuffer->_Xmin;
+ y1 = ctx->DrawBuffer->_Ymin;
+ width1 = ctx->DrawBuffer->_Xmax - x1;
+ height1 = ctx->DrawBuffer->_Ymax - y1;
+ y1 = Y_FLIP(y1 + height1 - 1);
+
/* XXX: Scissoring */
fprintf(stderr, "Clear\n");
UNLOCK_HARDWARE();
if (mask != 0)
- _swrast_Clear(ctx, mask, all, x1, y1, width, height);
+ _swrast_Clear(ctx, mask, 0, 0, 0, 0, 0);
}
}
void
-sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean allFoo,
+ GLint xFoo, GLint yFoo, GLint widthFoo, GLint heightFoo )
{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- GLint x1, y1, width1, height1;
+ sisContextPtr smesa = SIS_CONTEXT(ctx);
- if (all) {
- GLframebuffer *buffer = ctx->DrawBuffer;
+ GLint x1, y1, width1, height1;
- x1 = 0;
- y1 = 0;
- width1 = buffer->Width;
- height1 = buffer->Height;
- } else {
- x1 = x;
- y1 = Y_FLIP(y+height-1);
- width1 = width;
- height1 = height;
- }
- /* XXX: Scissoring */
+ /* get region after locking: */
+ x1 = ctx->DrawBuffer->_Xmin;
+ y1 = ctx->DrawBuffer->_Ymin;
+ width1 = ctx->DrawBuffer->_Xmax - x1;
+ height1 = ctx->DrawBuffer->_Ymax - y1;
+ y1 = Y_FLIP(y1 + height1 - 1);
/* Mask out any non-existent buffers */
if (ctx->Visual.depthBits == 0 || !ctx->Depth.Mask)
UNLOCK_HARDWARE();
if (mask != 0)
- _swrast_Clear( ctx, mask, all, x1, y1, width, height );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0);
}
/* Clear the color and/or depth buffers.
*/
static void tdfxClear( GLcontext *ctx,
- GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+ GLbitfield mask, GLboolean all,
+ GLint xFoo, GLint yFoo, GLint widthFoo, GLint heightFoo)
{
tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
fxMesa->haveHwStencil ? fxMesa->glCtx->Visual.stencilBits : 0;
if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %d, %d, %d, %d )\n",
- __FUNCTION__, (int) x, (int) y, (int) width, (int) height );
+ fprintf( stderr, "tdfxClear(0x%x)\n", mask);
}
/* Need this check to respond to glScissor and clipping updates */
}
if (softwareMask)
- _swrast_Clear( ctx, softwareMask, all, x, y, width, height );
+ _swrast_Clear( ctx, softwareMask, 0, 0, 0, 0, 0);
}
static void tridentDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{
tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
int busy;
GLuint flags = 0;
GLint i;
+ GLint cx, cy, cw, ch;
#define DRM_TRIDENT_FRONT 0x01
#define DRM_TRIDENT_BACK 0x02
LOCK_HARDWARE(tmesa);
+ /* get region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
if ( flags ) {
cx += tmesa->drawX;
UNLOCK_HARDWARE(tmesa);
if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0);
}
static void tridentDDShadeModel( GLcontext *ctx, GLenum mode )
static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = vmesa->driDrawable;
if (flag) {
drm_clip_rect_t *boxes, *tmp_boxes = 0;
int nr = 0;
+ GLint cx, cy, cw, ch;
LOCK_HARDWARE(vmesa);
+ /* get region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* flip top to bottom */
cy = dPriv->h - cy - ch;
cx += vmesa->drawX + vmesa->drawXoff;
}
if (mask)
- _swrast_Clear(ctx, mask, all, cx, cy, cw, ch);
+ _swrast_Clear(ctx, mask, 0, 0, 0, 0, 0);
}