llvmpipe: move rasterizer to screen instead of setup context
[profile/ivi/mesa.git] / src / gallium / drivers / i915 / i915_flush.c
index 1582168..a2c70b1 100644 (file)
 #include "i915_context.h"
 #include "i915_reg.h"
 #include "i915_batch.h"
+#include "i915_debug.h"
 
 
-static void i915_flush( struct pipe_context *pipe,
-                        unsigned flags,
-                        struct pipe_fence_handle **fence )
+static void i915_flush_pipe( struct pipe_context *pipe,
+                             unsigned flags,
+                             struct pipe_fence_handle **fence )
 {
    struct i915_context *i915 = i915_context(pipe);
 
@@ -66,21 +67,31 @@ static void i915_flush( struct pipe_context *pipe,
    }
 #endif
 
-#if 0
    if (i915->batch->map == i915->batch->ptr) {
       return;
    }
-#endif
 
    /* If there are no flags, just flush pending commands to hardware:
     */
    FLUSH_BATCH(fence);
    i915->vbo_flushed = 1;
-}
-
 
+   I915_DBG(DBG_FLUSH, "%s: #####\n", __FUNCTION__);
+}
 
 void i915_init_flush_functions( struct i915_context *i915 )
 {
-   i915->base.flush = i915_flush;
+   i915->base.flush = i915_flush_pipe;
+}
+
+/**
+ * Here we handle all the notifications that needs to go out on a flush.
+ * XXX might move above function to i915_pipe_flush.c and leave this here.
+ */
+void i915_flush(struct i915_context *i915, struct pipe_fence_handle **fence)
+{
+   struct i915_winsys_batchbuffer *batch = i915->batch;
+
+   batch->iws->batchbuffer_flush(batch, fence);
+   i915->hardware_dirty = ~0;
 }