freedreno: fix FD_MESA_DEBUG=flush
authorRob Clark <robdclark@gmail.com>
Thu, 6 Sep 2018 11:52:01 +0000 (07:52 -0400)
committerRob Clark <robdclark@gmail.com>
Thu, 27 Sep 2018 19:25:49 +0000 (15:25 -0400)
The logic to force a flush every draw was short-circuited with newer
kernels.  Also it should apply to clears as well.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_batch.c
src/gallium/drivers/freedreno/freedreno_draw.c

index ff8298e82a1827fc2f144375b8e3fbc959df1c83..8dc0d7c612acb6ce0ff0bb5b32746271e9cc0463 100644 (file)
@@ -483,12 +483,16 @@ fd_batch_check_size(struct fd_batch *batch)
 {
        debug_assert(!batch->flushed);
 
+       if (unlikely(fd_mesa_debug & FD_DBG_FLUSH)) {
+               fd_batch_flush(batch, true, false);
+               return;
+       }
+
        if (fd_device_version(batch->ctx->screen->dev) >= FD_VERSION_UNLIMITED_CMDS)
                return;
 
        struct fd_ringbuffer *ring = batch->draw;
-       if (((ring->cur - ring->start) > (ring->size/4 - 0x1000)) ||
-                       (fd_mesa_debug & FD_DBG_FLUSH))
+       if ((ring->cur - ring->start) > (ring->size/4 - 0x1000))
                fd_batch_flush(batch, true, false);
 }
 
index f55905e7bfe4247a44a9b0d0f4ae271668223c83..0f382e61ca44066c4196b8f76c92abc9debbd348 100644 (file)
@@ -429,6 +429,8 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
        if (fallback) {
                fd_blitter_clear(pctx, buffers, color, depth, stencil);
        }
+
+       fd_batch_check_size(batch);
 }
 
 static void