r300: Page flipping fixes.
authorMichel Dänzer <michel@tungstengraphics.com>
Thu, 29 Mar 2007 07:42:37 +0000 (09:42 +0200)
committerMichel Dänzer <michel@tungstengraphics.com>
Sun, 29 Apr 2007 11:52:48 +0000 (13:52 +0200)
Mostly making sure the page flipping state is respected when necessary.

src/mesa/drivers/dri/r300/r300_ioctl.c
src/mesa/drivers/dri/r300/radeon_context.c
src/mesa/drivers/dri/r300/radeon_lock.c
src/mesa/drivers/dri/r300/radeon_lock.h
src/mesa/drivers/dri/r300/radeon_state.c

index 90ac9881e8f7cf85285b3cd01743b1be0f7fb0d5..c4dc97b8d4959acffb91e57269b292be591ac0a4 100644 (file)
@@ -370,7 +370,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask)
                _swrast_Clear(ctx, mask);
        }
 
-       swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1);
+       swapped = r300->radeon.sarea->pfCurrentPage == 1;
 
        /* Make sure it fits there. */
        r300EnsureCmdBufSpace(r300, 421*3, __FUNCTION__);
index ef1f25dd413ff1fa1e65023a8fd3163b9ab66072..9b3f89050764f22bb901bd9b7a02d8cc27e59b1e 100644 (file)
@@ -293,6 +293,8 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
                                    driverPrivate);
 
                _mesa_update_state(radeon->glCtx);              
+
+               radeonUpdatePageFlipping(radeon);
        } else {
                if (RADEON_DEBUG & DEBUG_DRI)
                        fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
index ec501c3dc0615e11ac5c9246b629b7da2a7571fc..84181e2e99e12a1d15f800ce1ee0c43582ebc734 100644 (file)
@@ -50,13 +50,14 @@ int prevLockLine = 0;
 
 /* Turn on/off page flipping according to the flags in the sarea:
  */
-static void radeonUpdatePageFlipping(radeonContextPtr radeon)
+void radeonUpdatePageFlipping(radeonContextPtr radeon)
 {
        int use_back;
 
        radeon->doPageFlip = radeon->sarea->pfState;
         if (radeon->glCtx->WinSysDrawBuffer) {
            driFlipRenderbuffers(radeon->glCtx->WinSysDrawBuffer, radeon->sarea->pfCurrentPage);
+           r300UpdateDrawBuffer(radeon->glCtx);
         }
 
        use_back = (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT);
index 632329fde1ee408c4ece6e786ff84ca864ce3b3e..b11ddf0895e3c7aefafa20a7a1a62616c51a30f0 100644 (file)
@@ -41,6 +41,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "radeon_context.h"
 
 extern void radeonGetLock(radeonContextPtr radeon, GLuint flags);
+extern void radeonUpdatePageFlipping(radeonContextPtr radeon);
 
 /* Turn DEBUG_LOCKING on to find locking conflicts.
  */
index 902e9583a6336b6528f5d198118e4de1a05a1bbd..82bfd951b9245317d67f4a55bc0b4acbc40d82b2 100644 (file)
@@ -154,7 +154,8 @@ void radeonSetCliprects(radeonContextPtr radeon)
 
        if (draw_fb->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) {
                /* Can't ignore 2d windows if we are page flipping. */
-               if (drawable->numBackClipRects == 0 || radeon->doPageFlip) {
+               if (drawable->numBackClipRects == 0 || radeon->doPageFlip ||
+                   radeon->sarea->pfCurrentPage == 1) {
                        radeon->numClipRects = drawable->numClipRects;
                        radeon->pClipRects = drawable->pClipRects;
                } else {