Enable drawing directly to the (now tiled) front buffer.
authorFelix Kuehling <fxkuehl@gmx.de>
Fri, 26 Mar 2004 23:27:24 +0000 (23:27 +0000)
committerFelix Kuehling <fxkuehl@gmx.de>
Fri, 26 Mar 2004 23:27:24 +0000 (23:27 +0000)
src/mesa/drivers/dri/savage/savageioctl.c
src/mesa/drivers/dri/savage/savagestate.c

index 1384ce6099a3ad4380ad347a47791d770952d059..c5d234b37a1894d84630d071a1dd388a4eb6fc52 100644 (file)
@@ -71,7 +71,7 @@ static void savage_BCI_clear(GLcontext *ctx, drm_savage_clear_t *pclear)
                    pbox->y2 > imesa->savageScreen->height)
                        continue;
 
-               if ( (pclear->flags & SAVAGE_FRONT) && imesa->IsFullScreen) {
+               if ( pclear->flags & SAVAGE_FRONT ) {
                        bciptr = savageDMAAlloc (imesa, 8);
                        WRITE_CMD((bciptr) , 0x4BCC8C00,uint32_t);
                        WRITE_CMD((bciptr) , imesa->savageScreen->frontOffset,uint32_t);
@@ -81,7 +81,7 @@ static void savage_BCI_clear(GLcontext *ctx, drm_savage_clear_t *pclear)
                        WRITE_CMD((bciptr) , (height << 16) | width,uint32_t);
                        savageDMACommit (imesa, bciptr);
                }
-               else if ( pclear->flags & (SAVAGE_BACK|SAVAGE_FRONT) ) {
+               if ( pclear->flags & SAVAGE_BACK ) {
                        bciptr = savageDMAAlloc (imesa, 8);
                        WRITE_CMD((bciptr) , 0x4BCC8C00,uint32_t);
                        WRITE_CMD((bciptr) , imesa->savageScreen->backOffset,uint32_t);
index 5fdafa4288b296f59386e85f64e6e2ca84f69ffe..599dbaa3ea06a5db7092d4a6250d194eed5f177e 100644 (file)
@@ -642,18 +642,11 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode )
     case DD_FRONT_LEFT_BIT:
         imesa->IsDouble = GL_FALSE;
       
-        if(imesa->IsFullScreen)
-        {
-            imesa->drawMap = (char *)imesa->apertureBase[TARGET_FRONT];
-            imesa->readMap = (char *)imesa->apertureBase[TARGET_FRONT];
-        }
-        else
-        {
-            imesa->drawMap = (char *)imesa->apertureBase[TARGET_BACK];
-            imesa->readMap = (char *)imesa->apertureBase[TARGET_BACK];
-        }
+       imesa->drawMap = (char *)imesa->apertureBase[TARGET_FRONT];
+       imesa->readMap = (char *)imesa->apertureBase[TARGET_FRONT];
+       imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->frontOffset>>11;
         imesa->NotFirstFrame = GL_FALSE;
-        imesa->dirty |= SAVAGE_UPLOAD_BUFFERS;
+        imesa->dirty |= SAVAGE_UPLOAD_BUFFERS | SAVAGE_UPLOAD_CTX;
         savageXMesaSetFrontClipRects( imesa );
        FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
        break;
@@ -661,8 +654,9 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode )
         imesa->IsDouble = GL_TRUE;
         imesa->drawMap = (char *)imesa->apertureBase[TARGET_BACK];
         imesa->readMap = (char *)imesa->apertureBase[TARGET_BACK];
+       imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11;
         imesa->NotFirstFrame = GL_FALSE;
-        imesa->dirty |= SAVAGE_UPLOAD_BUFFERS;
+        imesa->dirty |= SAVAGE_UPLOAD_BUFFERS | SAVAGE_UPLOAD_CTX;
         savageXMesaSetBackClipRects( imesa );
        FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
        break;
@@ -1838,13 +1832,6 @@ void savageDDRenderStart(GLcontext *ctx)
 
 void savageDDRenderEnd(GLcontext *ctx)
 {
-    savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
-       
-    if(!imesa->IsDouble)
-    {
-        savageSwapBuffers(imesa->driDrawable);
-    }
-       
 }
 
 static void savageDDInvalidateState( GLcontext *ctx, GLuint new_state )