Module: Mesa
Branch: main
Commit: 3c684d10be87467f06d9b73c4f9ccb2cce154dee
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c684d10be87467f06d9b73c4f9ccb2cce154dee

Author: Boris Brezillon <[email protected]>
Date:   Mon May 10 13:00:10 2021 +0200

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 <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Tested-by: Icecream95 <[email protected]>
Reviewed-by:  Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10842>

---

 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);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to