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: 02298ed1fc ("freedreno: Add submit lock")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11658>
This commit is contained in:
Rob Clark 2021-06-30 09:49:40 -07:00 committed by Marge Bot
parent f85d3113b2
commit 525be27326
1 changed files with 6 additions and 1 deletions

View File

@ -1366,10 +1366,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);
@ -1391,6 +1393,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