-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.c,v 1.5 2002/10/30 12:51:38 alanh Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
#include "r128_tex.h"
#include "r128_state.h"
+#include "drirenderbuffer.h"
+
+
#if DEBUG_LOCKING
char *prevLockFile = NULL;
int prevLockLine = 0;
static void
r128UpdatePageFlipping( r128ContextPtr rmesa )
{
- int use_back;
-
rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
-
- use_back = (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT);
- use_back ^= (rmesa->sarea->pfCurrentPage == 1);
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API )
- fprintf(stderr, "%s allow %d current %d\n", __FUNCTION__,
- rmesa->doPageFlip,
- rmesa->sarea->pfCurrentPage );
-
- if ( use_back ) {
- rmesa->drawOffset = rmesa->r128Screen->backOffset;
- rmesa->drawPitch = rmesa->r128Screen->backPitch;
- } else {
- rmesa->drawOffset = rmesa->r128Screen->frontOffset;
- rmesa->drawPitch = rmesa->r128Screen->frontPitch;
+ if (rmesa->glCtx->WinSysDrawBuffer) {
+ driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
+ rmesa->sarea->pfCurrentPage);
}
-
- rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) |
- (rmesa->drawOffset >> 5));
rmesa->new_state |= R128_NEW_WINDOW;
}
-/* Update the hardware state. This is called if another context has
+/* Update the hardware state. This is called if another main/context.has
* grabbed the hardware lock, which includes the X server. This
* function also updates the driver's window state after the X server
* moves, resizes or restacks a window -- the change will be reflected
if ( rmesa->lastStamp != dPriv->lastStamp ) {
r128UpdatePageFlipping( rmesa );
+ driUpdateFramebufferSize(rmesa->glCtx, dPriv);
rmesa->lastStamp = dPriv->lastStamp;
rmesa->new_state |= R128_NEW_CLIP;
- rmesa->tnl_state = ~0;
+ RENDERINPUTS_ONES( rmesa->tnl_state_bitset );
}
rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_CLIPRECTS;