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/mga/mgaioctl.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/mga') diff --git a/src/mesa/drivers/dri/mga/mgaioctl.c b/src/mesa/drivers/dri/mga/mgaioctl.c index 6e653f8c73..c9fa9d1294 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.c +++ b/src/mesa/drivers/dri/mga/mgaioctl.c @@ -204,8 +204,8 @@ drmBufPtr mga_get_buffer_ioctl( mgaContextPtr mmesa ) 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; @@ -218,6 +218,7 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, int i; static int nrclears; drm_mga_clear_t clear; + GLint cx, cy, cw, ch; FLUSH_BATCH( mmesa ); @@ -250,6 +251,12 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, 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) ); @@ -269,7 +276,8 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, 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; @@ -291,6 +299,7 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, n++; } } else { + /* clear whole window */ for ( ; i < nr ; i++) { *b++ = box[i]; n++; @@ -325,7 +334,7 @@ mgaClear( 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