intel: fix batch flushing problem with cliprects handling.
authorDave Airlie <airlied@linux.ie>
Thu, 10 Jul 2008 21:28:55 +0000 (07:28 +1000)
committerDave Airlie <airlied@linux.ie>
Thu, 10 Jul 2008 21:28:55 +0000 (07:28 +1000)
pointed out and debugged by stringfellow on #dri-devel

src/mesa/drivers/dri/intel/intel_batchbuffer.h
src/mesa/drivers/dri/intel/intel_blit.c

index 2d636df2ce5ab551cb0df93d9c2eb55aeedf4c05..0da602010e8d44bb3e15f38b3ecde108b309994a 100644 (file)
@@ -118,8 +118,10 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
       if (batch->cliprect_mode == IGNORE_CLIPRECTS) {
         batch->cliprect_mode = cliprect_mode;
       } else {
-        if (batch->cliprect_mode != cliprect_mode)
+        if (batch->cliprect_mode != cliprect_mode) {
            intel_batchbuffer_flush(batch);
+           batch->cliprect_mode = cliprect_mode;
+        }
       }
    }
 }
index d9dbbb248250dea602807109d70f022dfe97c08e..25ac609f13309274fe5ce585696c57c26689d469 100644 (file)
@@ -123,7 +123,8 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
         dst_pitch /= 4;
       }
 #endif
-
+      /* do space/cliprects check before going any further */
+      intel_batchbuffer_require_space(intel->batch, 8 * 4, REFERENCES_CLIPRECTS);
    again:
       ret = dri_bufmgr_check_aperture_space(dst->buffer);
       ret |= dri_bufmgr_check_aperture_space(src->buffer);
@@ -278,6 +279,8 @@ intelEmitCopyBlit(struct intel_context *intel,
    int ret;
    BATCH_LOCALS;
 
+   /* do space/cliprects check before going any further */
+   intel_batchbuffer_require_space(intel->batch, 8 * 4, NO_LOOP_CLIPRECTS);
  again:
    ret = dri_bufmgr_check_aperture_space(dst_buffer);
    ret |= dri_bufmgr_check_aperture_space(src_buffer);