fix up radeon span functions using latest r200 code from Brian,
[mesa.git] / src / mesa / drivers / dri / i915 / intel_batchbuffer.c
index 2062c9079ea6c8ec9c1a63d623999e07dbfcf070..84ec70e2b9eaba6003e91bf333e9ca041e173658 100644 (file)
@@ -51,8 +51,8 @@ static void intel_fill_box( intelContextPtr intel,
 {
    intelEmitFillBlitLocked( intel, 
                            intel->intelScreen->cpp,
-                           intel->intelScreen->backPitch,
-                           intel->intelScreen->frontOffset,
+                           intel->intelScreen->back.pitch,
+                           intel->intelScreen->front.offset,
                            x, y, w, h,
                            INTEL_PACKCOLOR(intel->intelScreen->fbFormat,
                                            r,g,b,0xff));
@@ -338,7 +338,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv )
       __DRIdrawablePrivate *dPriv = intel->driDrawable;
       int nbox = dPriv->numClipRects;
       drm_clip_rect_t *pbox = dPriv->pClipRects;
-      int pitch = intelScreen->frontPitch;
+      int pitch = intelScreen->front.pitch;
       int cpp = intelScreen->cpp;
       int i;
       GLuint CMD, BR13;
@@ -378,17 +378,17 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv )
         OUT_BATCH( (pbox->y2 << 16) | pbox->x2 );
 
         if (intel->sarea->pf_current_page == 0) 
-           OUT_BATCH( intelScreen->frontOffset );
+           OUT_BATCH( intelScreen->front.offset );
         else
-           OUT_BATCH( intelScreen->backOffset );                       
+           OUT_BATCH( intelScreen->back.offset );                      
 
         OUT_BATCH( (pbox->y1 << 16) | pbox->x1 );
         OUT_BATCH( BR13 & 0xffff );
 
         if (intel->sarea->pf_current_page == 0) 
-           OUT_BATCH( intelScreen->backOffset );                       
+           OUT_BATCH( intelScreen->back.offset );                      
         else
-           OUT_BATCH( intelScreen->frontOffset );
+           OUT_BATCH( intelScreen->front.offset );
 
         ADVANCE_BATCH();
       }
@@ -502,7 +502,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
    intelScreenPrivate *intelScreen = intel->intelScreen;
    GLuint clear_depth, clear_color;
    GLint cx, cy;
-   GLint pitch = intelScreen->frontPitch;
+   GLint pitch = intelScreen->front.pitch;
    GLint cpp = intelScreen->cpp;
    GLint i;
    GLuint BR13, CMD, D_CMD;
@@ -512,11 +512,11 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
    clear_color = intel->ClearColor;
    clear_depth = 0;
 
-   if (flags & DD_DEPTH_BIT) {
+   if (flags & BUFFER_BIT_DEPTH) {
       clear_depth = (GLuint)(ctx->Depth.Clear * intel->ClearDepth);
    }
 
-   if (flags & DD_STENCIL_BIT) {
+   if (flags & BUFFER_BIT_STENCIL) {
       clear_depth |= (ctx->Stencil.Clear & 0xff) << 24;
    }
 
@@ -531,8 +531,8 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
             XY_COLOR_BLT_WRITE_ALPHA | 
             XY_COLOR_BLT_WRITE_RGB);
       D_CMD = XY_COLOR_BLT_CMD;
-      if (flags & DD_DEPTH_BIT) D_CMD |= XY_COLOR_BLT_WRITE_RGB;
-      if (flags & DD_STENCIL_BIT) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA;
+      if (flags & BUFFER_BIT_DEPTH) D_CMD |= XY_COLOR_BLT_WRITE_RGB;
+      if (flags & BUFFER_BIT_STENCIL) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA;
       break;
    default:
       BR13 = (0xF0 << 16) | (pitch * cpp) | (1<<24);
@@ -552,9 +552,9 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
       if ( intel->sarea->pf_current_page == 1 ) {
         GLuint tmp = flags;
 
-        flags &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT);
-        if ( tmp & DD_FRONT_LEFT_BIT ) flags |= DD_BACK_LEFT_BIT;
-        if ( tmp & DD_BACK_LEFT_BIT )  flags |= DD_FRONT_LEFT_BIT;
+        flags &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
+        if ( tmp & BUFFER_BIT_FRONT_LEFT ) flags |= BUFFER_BIT_BACK_LEFT;
+        if ( tmp & BUFFER_BIT_BACK_LEFT )  flags |= BUFFER_BIT_FRONT_LEFT;
       }
 
       for (i = 0 ; i < intel->numClipRects ; i++) 
@@ -590,35 +590,35 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
             b.y2 > intelScreen->height)
            continue;
 
-        if ( flags & DD_FRONT_LEFT_BIT ) {         
+        if ( flags & BUFFER_BIT_FRONT_LEFT ) {     
            BEGIN_BATCH( 6);        
            OUT_BATCH( CMD );
            OUT_BATCH( BR13 );
            OUT_BATCH( (b.y1 << 16) | b.x1 );
            OUT_BATCH( (b.y2 << 16) | b.x2 );
-           OUT_BATCH( intelScreen->frontOffset );
+           OUT_BATCH( intelScreen->front.offset );
            OUT_BATCH( clear_color );
            ADVANCE_BATCH();
         }
 
-        if ( flags & DD_BACK_LEFT_BIT ) {
+        if ( flags & BUFFER_BIT_BACK_LEFT ) {
            BEGIN_BATCH( 6); 
            OUT_BATCH( CMD );
            OUT_BATCH( BR13 );
            OUT_BATCH( (b.y1 << 16) | b.x1 );
            OUT_BATCH( (b.y2 << 16) | b.x2 );
-           OUT_BATCH( intelScreen->backOffset );
+           OUT_BATCH( intelScreen->back.offset );
            OUT_BATCH( clear_color );
            ADVANCE_BATCH();
         }
 
-        if ( flags & (DD_STENCIL_BIT | DD_DEPTH_BIT) ) {
+        if ( flags & (BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH) ) {
            BEGIN_BATCH( 6);
            OUT_BATCH( D_CMD );
            OUT_BATCH( BR13 );
            OUT_BATCH( (b.y1 << 16) | b.x1 );
            OUT_BATCH( (b.y2 << 16) | b.x2 );
-           OUT_BATCH( intelScreen->depthOffset );
+           OUT_BATCH( intelScreen->depth.offset );
            OUT_BATCH( clear_depth );
            ADVANCE_BATCH();
         }