freedreno/a6xx: Fix occlusion queries

WFI is not a strong enough barrier, which shows up in piglit qbo tests
which do a single draw.

Fixes: 13fc03f4c0 ("freedreno/a6xx: Avoid stalling for occlusion queries")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19400>
(cherry picked from commit 5c5e4238ff)
This commit is contained in:
Rob Clark
2022-10-31 11:35:57 -07:00
committed by Dylan Baker
parent e0d84e84f7
commit 0284e61c58
2 changed files with 9 additions and 2 deletions

View File

@@ -58,7 +58,7 @@
"description": "freedreno/a6xx: Fix occlusion queries", "description": "freedreno/a6xx: Fix occlusion queries",
"nominated": true, "nominated": true,
"nomination_type": 1, "nomination_type": 1,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": "13fc03f4c0e709f6d1a8d811f9bc8a0c8c42943c" "because_sha": "13fc03f4c0e709f6d1a8d811f9bc8a0c8c42943c"
}, },

View File

@@ -97,7 +97,14 @@ occlusion_pause(struct fd_acc_query *aq, struct fd_batch *batch) assert_dt
* counter delta in the epilogue ring. * counter delta in the epilogue ring.
*/ */
struct fd_ringbuffer *epilogue = fd_batch_get_epilogue(batch); struct fd_ringbuffer *epilogue = fd_batch_get_epilogue(batch);
fd_wfi(batch, epilogue);
OUT_PKT7(epilogue, CP_WAIT_REG_MEM, 6);
OUT_RING(epilogue, CP_WAIT_REG_MEM_0_FUNCTION(WRITE_NE) |
CP_WAIT_REG_MEM_0_POLL_MEMORY);
OUT_RELOC(epilogue, query_sample(aq, stop));
OUT_RING(epilogue, CP_WAIT_REG_MEM_3_REF(0xffffffff));
OUT_RING(epilogue, CP_WAIT_REG_MEM_4_MASK(0xffffffff));
OUT_RING(epilogue, CP_WAIT_REG_MEM_5_DELAY_LOOP_CYCLES(16));
/* result += stop - start: */ /* result += stop - start: */
OUT_PKT7(epilogue, CP_MEM_TO_MEM, 9); OUT_PKT7(epilogue, CP_MEM_TO_MEM, 9);