Mesa (staging/21.1): freedreno/a6xx: Fix framebuffer_barrier crash
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jul 14 20:03:36 UTC 2021
Module: Mesa
Branch: staging/21.1
Commit: dc82f7b075416aebf944fed8b52dbec4b7e73b39
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dc82f7b075416aebf944fed8b52dbec4b7e73b39
Author: Rob Clark <robdclark at chromium.org>
Date: Wed Jun 30 09:49:40 2021 -0700
freedreno/a6xx: Fix framebuffer_barrier crash
This is emitting cmdstream, it should take the submit lock to (a) ensure
we actually have a batch, and (b) prevent it from being flushed from
under it. This was overlooked in the conversion.
Fixes: 02298ed1fc6 ("freedreno: Add submit lock")
Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11658>
(cherry picked from commit 525be273266fb78073286d8544e10f6d20f2d3a6)
---
.pick_status.json | 2 +-
src/gallium/drivers/freedreno/a6xx/fd6_emit.c | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 8325c9bc32f..bbbd3aaf868 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4855,7 +4855,7 @@
"description": "freedreno/a6xx: Fix framebuffer_barrier crash",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "02298ed1fc640f89d66c1e22e68e1f9fecc14205"
},
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
index 88aef02c77d..e648cc377d1 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
@@ -1378,10 +1378,12 @@ static void
fd6_framebuffer_barrier(struct fd_context *ctx) assert_dt
{
struct fd6_context *fd6_ctx = fd6_context(ctx);
- struct fd_batch *batch = ctx->batch;
+ struct fd_batch *batch = fd_context_batch_locked(ctx);
struct fd_ringbuffer *ring = batch->draw;
unsigned seqno;
+ fd_batch_needs_flush(batch);
+
seqno = fd6_event_write(batch, ring, RB_DONE_TS, true);
OUT_PKT7(ring, CP_WAIT_REG_MEM, 6);
@@ -1403,6 +1405,9 @@ fd6_framebuffer_barrier(struct fd_context *ctx) assert_dt
OUT_RING(ring, CP_WAIT_MEM_GTE_0_RESERVED(0));
OUT_RELOC(ring, control_ptr(fd6_ctx, seqno));
OUT_RING(ring, CP_WAIT_MEM_GTE_3_REF(seqno));
+
+ fd_batch_unlock_submit(batch);
+ fd_batch_reference(&batch, NULL);
}
void
More information about the mesa-commit
mailing list