checkpoint: more intel_renderbuffer removal
authorBrian <brian@i915.localnet.net>
Thu, 9 Aug 2007 17:11:11 +0000 (11:11 -0600)
committerBrian <brian@i915.localnet.net>
Thu, 9 Aug 2007 20:26:31 +0000 (14:26 -0600)
src/mesa/drivers/dri/intel_winsys/intel_blit.c
src/mesa/drivers/dri/intel_winsys/intel_buffers.c
src/mesa/drivers/dri/intel_winsys/intel_fbo.c

index 8e878f00887d64481670ea8c707ba0b5941de5b5..7e30c7d034e56cc5c2a1b58225ada109ea062116 100644 (file)
@@ -86,20 +86,37 @@ intelCopyBuffer(__DRIdrawablePrivate * dPriv,
 
    if (dPriv && dPriv->numClipRects) {
       struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
+#if 0
       const struct pipe_region *backRegion
         = intel_fb->Base._ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT ?
           intel_get_rb_region(&intel_fb->Base, BUFFER_FRONT_LEFT) :
           intel_get_rb_region(&intel_fb->Base, BUFFER_BACK_LEFT);
+#endif
       const int backWidth = intel_fb->Base.Width;
       const int backHeight = intel_fb->Base.Height;
       const int nbox = dPriv->numClipRects;
       const drm_clip_rect_t *pbox = dPriv->pClipRects;
       const int pitch = intelScreen->front.pitch / intelScreen->front.cpp;
+#if 0
       const int srcpitch = backRegion->pitch;
+#endif
       const int cpp = intelScreen->front.cpp;
       int BR13, CMD;
       int i;
 
+      const struct pipe_surface *backSurf;
+      const struct pipe_region *backRegion;
+      int srcpitch;
+
+      /* blit from back color buffer if it exists, else front buffer */
+      if (intel_fb->Base.Attachment[BUFFER_BACK_LEFT].Renderbuffer)
+         backSurf = intel_fb->Base.Attachment[BUFFER_BACK_LEFT].Renderbuffer->surface;
+      else
+         backSurf = intel_fb->Base.Attachment[BUFFER_FRONT_LEFT].Renderbuffer->surface;
+
+      backRegion = backSurf->region;
+      srcpitch = backRegion->pitch;
+
       ASSERT(intel_fb);
       ASSERT(intel_fb->Base.Name == 0);    /* Not a user-created FBO */
       ASSERT(backRegion);
index 33fa4b9b40947fcc13fdd2b4645dafb83eb2157e..c4db4467881f530ecf414a63c0364fe7c60fb591 100644 (file)
@@ -217,8 +217,10 @@ intelWindowMoved(struct intel_context *intel)
       }
 
       intel_fb->pf_active = pf_active;
+#if 0
       intel_flip_renderbuffers(intel_fb);
       intel_draw_buffer(&intel->ctx, intel->ctx.DrawBuffer);
+#endif
 
       /* Update vblank info
        */
@@ -359,8 +361,10 @@ intelPageFlip(const __DRIdrawablePrivate * dPriv)
         ++intel_fb->pf_seq;
    }
 
+#if 0
    intel_flip_renderbuffers(intel_fb);
    intel_draw_buffer(&intel->ctx, &intel_fb->Base);
+#endif
 
    if (INTEL_DEBUG & DEBUG_IOCTL)
       fprintf(stderr, "%s: success\n", __FUNCTION__);
@@ -430,8 +434,10 @@ intelScheduleSwap(const __DRIdrawablePrivate * dPriv, GLboolean *missed_target)
 #endif
 
       if (swap.seqtype & DRM_VBLANK_FLIP) {
+#if 0
         intel_flip_renderbuffers(intel_fb);
         intel_draw_buffer(&intel->ctx, intel->ctx.DrawBuffer);
+#endif
       }
 
       ret = GL_TRUE;
index c80fd69fdb12df491c2321799ac6b90e51fc460d..ff786de1e353efd57c5ae096b182613fc2ba6c9b 100644 (file)
@@ -74,7 +74,7 @@ intel_get_renderbuffer(struct gl_framebuffer *fb, GLuint attIndex)
    return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
 }
 
-
+#if 0
 void
 intel_flip_renderbuffers(struct intel_framebuffer *intel_fb)
 {
@@ -109,6 +109,7 @@ intel_flip_renderbuffers(struct intel_framebuffer *intel_fb)
       _mesa_reference_renderbuffer(&tmp_rb, NULL);
    }
 }
+#endif
 
 
 struct pipe_region *
@@ -321,6 +322,7 @@ intel_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb,
    }
 
    /* Make sure all window system renderbuffers are up to date */
+#if 0
    for (i = 0; i < 3; i++) {
       struct gl_renderbuffer *rb = &intel_fb->color_rb[i]->Base;
 
@@ -329,6 +331,7 @@ intel_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb,
         rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height);
       }
    }
+#endif
 }
 
 static GLboolean