Skip to content

Commit 8071ef6

Browse files
PixelyIonFireBurn
authored andcommitted
tu: Fix CP_BLIT sync on A7XX
A7XX needs the CCU caches to be flushed before a CP_BLIT to flush any GMEM contents that may have been written out prior to the blit. Without this, corruption can be seen with GMEM passes using CP_BLIT especially when forced using `TU_DEBUG=gmem,unaligned_store`. Signed-off-by: Mark Collins <[email protected]>
1 parent 8341b1f commit 8071ef6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/freedreno/vulkan/tu_clear_blit.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3703,9 +3703,14 @@ store_cp_blit(struct tu_cmd_buffer *cmd,
37033703
SP_PS_2D_SRC_PITCH(CHIP, .pitch = cmd->state.tiling->tile0.width * cpp));
37043704

37053705
/* sync GMEM writes with CACHE. */
3706-
tu_emit_event_write<CHIP>(cmd, cs, FD_CACHE_INVALIDATE);
3706+
if (CHIP >= A7XX) {
3707+
tu_emit_event_write<CHIP>(cmd, cs, FD_CCU_FLUSH_COLOR);
3708+
tu_emit_event_write<CHIP>(cmd, cs, FD_CCU_FLUSH_DEPTH);
3709+
} else {
3710+
tu_emit_event_write<CHIP>(cmd, cs, FD_CACHE_INVALIDATE);
3711+
}
37073712

3708-
/* Wait for CACHE_INVALIDATE to land */
3713+
/* Wait for cache event to land */
37093714
tu_cs_emit_wfi(cs);
37103715

37113716
r2d_run(cmd, cs);

0 commit comments

Comments
 (0)