From 3c684d10be87467f06d9b73c4f9ccb2cce154dee Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 10 May 2021 13:00:10 +0200 Subject: [PATCH] panfrost: Don't freeze blit batches We don't want blit batches to interfere with subsequent draw calls, but we want to keep them in the list of pending batches (so they gets flushed when glFlush() is called), so calling panfrost_freeze_batch() is not an option. Reset the ctx->batch pointer manually. Note that there's no risk to have those batches re-used to queue unrelated draws because we created a unique pipe_surface object per blit call, and the batch logic use the surface pointers to calculate the batch key hash. Fixes: e1649e916d67 ("panfrost: Use pan_blit() when PAN_MESA_DEBUG=panblit") Reported-by: Icecream95 Signed-off-by: Boris Brezillon Tested-by: Icecream95 Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_blit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_blit.c b/src/gallium/drivers/panfrost/pan_blit.c index da12004f66d..3ebce136285 100644 --- a/src/gallium/drivers/panfrost/pan_blit.c +++ b/src/gallium/drivers/panfrost/pan_blit.c @@ -299,7 +299,14 @@ panfrost_blit(struct pipe_context *pipe, panfrost_batch_get_bifrost_tiler(batch, ~0) : 0; pan_blit(&bctx, &batch->pool, &batch->scoreboard, panfrost_batch_reserve_tls(batch, false), tiler); - panfrost_freeze_batch(batch); + + /* We don't want this batch to interfere with subsequent draw + * calls, but we want to keep it in the list of pending batches + * (so it gets flushed when glFlush() is called), so calling + * panfrost_freeze_batch() is not an option. Reset the + * ctx->batch pointer manually. + */ + ctx->batch = NULL; } while (pan_blit_next_surface(&bctx)); pan_blit_ctx_cleanup(&bctx);