freedreno/a6xx: Stop using fd_wfi()

This was originally intended for earlier gens where certain draw-time
state needed a WFI (because it wasn't banked, etc).  This isn't the case
on a6xx.  So just directly emit WFIs where they are needed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23301>
This commit is contained in:
Rob Clark 2023-05-27 09:27:58 -07:00 committed by Marge Bot
parent d17610898d
commit ed7a1a5e5a
6 changed files with 11 additions and 21 deletions

View file

@ -1084,7 +1084,7 @@ fd6_resolve_tile(struct fd_batch *batch, struct fd_ringbuffer *ring,
fd6_cache_inv(batch, ring);
/* Wait for CACHE_INVALIDATE to land */
fd_wfi(batch, ring);
OUT_WFI5(ring);
OUT_PKT7(ring, CP_BLIT, 1);
OUT_RING(ring, CP_BLIT_0_OP(BLIT_OP_SCALE));

View file

@ -527,7 +527,6 @@ draw_vbos(struct fd_context *ctx, const struct pipe_draw_info *info,
}
emit_marker6(ring, 7);
fd_reset_wfi(ctx->batch);
flush_streamout(ctx, &emit);

View file

@ -441,7 +441,7 @@ fd6_emit_streamout(struct fd_ringbuffer *ring, struct fd6_emit *emit) assert_dt
* themselves.
*/
if (ctx->dirty & FD_DIRTY_STREAMOUT)
fd_wfi(ctx->batch, ring);
OUT_WFI5(ring);
ctx->last.streamout_mask = streamout_mask;
emit->streamout_mask = streamout_mask;

View file

@ -221,8 +221,6 @@ fd6_event_write(struct fd_batch *batch, struct fd_ringbuffer *ring,
{
unsigned seqno = 0;
fd_reset_wfi(batch);
OUT_PKT7(ring, CP_EVENT_WRITE, timestamp ? 4 : 1);
OUT_RING(ring, CP_EVENT_WRITE_0_EVENT(evt));
if (timestamp) {

View file

@ -325,8 +325,6 @@ emit_lrz_clears(struct fd_batch *batch)
fd6_emit_flushes(batch->ctx, ring,
FD6_FLUSH_CCU_COLOR |
FD6_INVALIDATE_CACHE);
fd_wfi(batch, ring);
}
}
@ -882,8 +880,6 @@ emit_binning_pass(struct fd_batch *batch) assert_dt
}
trace_end_binning_ib(&batch->trace, ring);
fd_reset_wfi(batch);
OUT_PKT7(ring, CP_SET_DRAW_STATE, 3);
OUT_RING(ring, CP_SET_DRAW_STATE__0_COUNT(0) |
CP_SET_DRAW_STATE__0_DISABLE_ALL_GROUPS |
@ -987,7 +983,7 @@ fd6_emit_tile_init(struct fd_batch *batch) assert_dt
OUT_PKT7(ring, CP_SKIP_IB2_ENABLE_LOCAL, 1);
OUT_RING(ring, 0x1);
fd_wfi(batch, ring);
OUT_WFI5(ring);
fd6_emit_ccu_cntl(ring, screen, true);
emit_zs<CHIP>(ring, pfb->zsbuf, batch->gmem_state);
@ -1838,7 +1834,7 @@ fd6_emit_sysmem(struct fd_batch *batch)
emit_sysmem_clears<CHIP>(batch, subpass);
}
fd_wfi(batch, ring);
OUT_WFI5(ring);
fd6_emit_ccu_cntl(ring, screen, false);
struct pipe_framebuffer_state *pfb = &batch->framebuffer;

View file

@ -220,8 +220,6 @@ timestamp_resume(struct fd_acc_query *aq, struct fd_batch *batch)
CP_EVENT_WRITE_0_EVENT(RB_DONE_TS) | CP_EVENT_WRITE_0_TIMESTAMP);
OUT_RELOC(ring, query_sample(aq, start));
OUT_RING(ring, 0x00000000);
fd_reset_wfi(batch);
}
static void
@ -235,8 +233,7 @@ time_elapsed_pause(struct fd_acc_query *aq, struct fd_batch *batch) assert_dt
OUT_RELOC(ring, query_sample(aq, stop));
OUT_RING(ring, 0x00000000);
fd_reset_wfi(batch);
fd_wfi(batch, ring);
OUT_WFI5(ring);
/* result += stop - start: */
OUT_PKT7(ring, CP_MEM_TO_MEM, 9);
@ -426,7 +423,7 @@ primitives_generated_resume(struct fd_acc_query *aq,
{
struct fd_ringbuffer *ring = batch->draw;
fd_wfi(batch, ring);
OUT_WFI5(ring);
OUT_PKT7(ring, CP_REG_TO_MEM, 3);
OUT_RING(ring, CP_REG_TO_MEM_0_64B | CP_REG_TO_MEM_0_CNT(counter_count * 2) |
@ -442,7 +439,7 @@ primitives_generated_pause(struct fd_acc_query *aq,
{
struct fd_ringbuffer *ring = batch->draw;
fd_wfi(batch, ring);
OUT_WFI5(ring);
/* snapshot the end values: */
OUT_PKT7(ring, CP_REG_TO_MEM, 3);
@ -501,7 +498,7 @@ primitives_emitted_resume(struct fd_acc_query *aq,
{
struct fd_ringbuffer *ring = batch->draw;
fd_wfi(batch, ring);
OUT_WFI5(ring);
ASSERT_ALIGNED(struct fd6_primitives_sample, start[0], 32);
@ -517,7 +514,7 @@ primitives_emitted_pause(struct fd_acc_query *aq,
{
struct fd_ringbuffer *ring = batch->draw;
fd_wfi(batch, ring);
OUT_WFI5(ring);
ASSERT_ALIGNED(struct fd6_primitives_sample, stop[0], 32);
@ -599,7 +596,7 @@ perfcntr_resume(struct fd_acc_query *aq, struct fd_batch *batch) assert_dt
unsigned counters_per_group[screen->num_perfcntr_groups];
memset(counters_per_group, 0, sizeof(counters_per_group));
fd_wfi(batch, ring);
OUT_WFI5(ring);
/* configure performance counters for the requested queries: */
for (unsigned i = 0; i < data->num_query_entries; i++) {
@ -639,7 +636,7 @@ perfcntr_pause(struct fd_acc_query *aq, struct fd_batch *batch) assert_dt
unsigned counters_per_group[screen->num_perfcntr_groups];
memset(counters_per_group, 0, sizeof(counters_per_group));
fd_wfi(batch, ring);
OUT_WFI5(ring);
/* TODO do we need to bother to turn anything off? */