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/i810/i810ioctl.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/i810/i810ioctl.c') diff --git a/src/mesa/drivers/dri/i810/i810ioctl.c b/src/mesa/drivers/dri/i810/i810ioctl.c index ba651555a6..9e52d80a8b 100644 --- a/src/mesa/drivers/dri/i810/i810ioctl.c +++ b/src/mesa/drivers/dri/i810/i810ioctl.c @@ -48,8 +48,8 @@ static drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa ) #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; @@ -80,8 +80,16 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, } 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; @@ -94,7 +102,8 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, 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; @@ -116,6 +125,7 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, n++; } } else { + /* clear whole buffer */ for ( ; i < nr ; i++) { *b++ = box[i]; n++; @@ -132,7 +142,7 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 ); } -- cgit v1.2.3