From 446972bc2756cf9770a82f51aa0dc4f529c6cae5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Oct 2006 20:02:42 +0000 Subject: Want to stop passing x/y/width/height to Clear() function. 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. --- src/mesa/drivers/dri/r200/r200_ioctl.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/mesa/drivers/dri/r200') diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index 650d7cfdf2b..efa0b64ed25 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -605,18 +605,18 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv ) /* ================================================================ * 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"); } { @@ -653,7 +653,7 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, 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 ) @@ -670,12 +670,18 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, } } + 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 ) { @@ -717,7 +723,8 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, 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; @@ -739,6 +746,7 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, n++; } } else { + /* clear whole window */ for ( ; i < nr ; i++ ) { *b++ = box[i]; n++; -- cgit v1.2.3