From: Rob Clark Date: Thu, 6 Sep 2018 11:52:01 +0000 (-0400) Subject: freedreno: fix FD_MESA_DEBUG=flush X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7fa44cd33378c6058b8069e6edcae1963c96bd3;p=mesa.git freedreno: fix FD_MESA_DEBUG=flush 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 --- diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c b/src/gallium/drivers/freedreno/freedreno_batch.c index ff8298e82a1..8dc0d7c612a 100644 --- a/src/gallium/drivers/freedreno/freedreno_batch.c +++ b/src/gallium/drivers/freedreno/freedreno_batch.c @@ -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); } diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index f55905e7bfe..0f382e61ca4 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -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