llvmpipe: move rasterizer to screen instead of setup context
[profile/ivi/mesa.git] / src / gallium / drivers / i915 / i915_flush.c
index 9671464..a2c70b1 100644 (file)
@@ -38,9 +38,9 @@
 #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);
 
@@ -67,11 +67,9 @@ 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:
     */
@@ -83,5 +81,17 @@ static void i915_flush( struct pipe_context *pipe,
 
 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;
 }