Merge commit 'origin/gallium-0.1' into gallium-0.2
[mesa.git] / src / mesa / drivers / dri / intel / intel_batchbuffer.h
index d3c656c80344734fb963e0bb171fca6ef6702970..1f8096b32ecbae2bc1c897df9eeb8ff3d8096352 100644 (file)
@@ -1,11 +1,11 @@
 #ifndef INTEL_BATCHBUFFER_H
 #define INTEL_BATCHBUFFER_H
 
-#include "mtypes.h"
+#include "main/mtypes.h"
 
-#include "dri_bufmgr.h"
-
-struct intel_context;
+#include "intel_context.h"
+#include "intel_bufmgr.h"
+#include "intel_reg.h"
 
 #define BATCH_SZ 16384
 #define BATCH_RESERVED 16
@@ -119,8 +119,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;
+        }
       }
    }
 }
@@ -144,4 +146,11 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
 #define ADVANCE_BATCH() do { } while(0)
 
 
+static INLINE void
+intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch)
+{
+   intel_batchbuffer_require_space(batch, 4, IGNORE_CLIPRECTS);
+   intel_batchbuffer_emit_dword(batch, MI_FLUSH);
+}
+
 #endif