i915g: Don't avoid flushing when we have a pending fence.
authorStéphane Marchesin <marcheu@chromium.org>
Thu, 19 Jan 2012 03:24:18 +0000 (19:24 -0800)
committerStéphane Marchesin <marcheu@chromium.org>
Thu, 19 Jan 2012 03:25:41 +0000 (19:25 -0800)
Otherwise the fence will never arrive.
Also check for a NULL i915->batch.

NOTE: This is a candidate for the 8.0 branch.

src/gallium/drivers/i915/i915_flush.c

index 5d8e3c8274f5a7e10b66bdf6462cf70bc58ef09c..0a0ca7885da9612214786e06f4227e85211ab15d 100644 (file)
@@ -45,7 +45,10 @@ static void i915_flush_pipe( struct pipe_context *pipe,
 
    draw_flush(i915->draw);
 
-   if (i915->batch->map == i915->batch->ptr) {
+   /* Only shortcut this if we have no fence, otherwise we must flush the
+    * empty batchbuffer to get our fence back.
+    */
+   if (!fence && i915->batch && (i915->batch->map == i915->batch->ptr)) {
       return;
    }