agx: pull out the big hammers for device-barriers

g13d.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31532>
This commit is contained in:
Alyssa Rosenzweig 2024-09-06 15:33:35 -04:00 committed by Marge Bot
parent f67db39aef
commit d4e34bc829
2 changed files with 14 additions and 5 deletions

View file

@ -1406,14 +1406,19 @@ agx_emit_intrinsic(agx_builder *b, nir_intrinsic_instr *instr)
agx_memory_barrier(b);
/* Pull out all the big hammers to make cross-workgroup memory
* barriers work. Found experimentally, seems to work on G13G at
* least.
*
* TODO: check on other models, we may need more barriers for G13D.
* barriers work.
*/
if (nir_intrinsic_memory_scope(instr) >= SCOPE_QUEUE_FAMILY) {
agx_memory_barrier_2(b);
agx_unknown_barrier_1(b);
agx_memory_barrier_2(b);
/* These are observed on G13D. At some point we should figure out
* what the individual opcodes do.
*/
agx_device_barrier_2(b);
agx_unknown_barrier_2(b);
agx_memory_barrier_3(b);
agx_device_barrier_1(b);
}
}

View file

@ -464,6 +464,10 @@ memory_barrier("memory_barrier_3", 2, 1, 9)
memory_barrier("unknown_barrier_1", 0, 3, 3)
memory_barrier("unknown_barrier_2", 0, 3, 0)
# Seen with device-scope memory barriers. Again not clear what's what.
memory_barrier("device_barrier_1", 3, 1, 9)
memory_barrier("device_barrier_2", 3, 2, 9)
op("doorbell", (0x60020 | 0x28 << 32, (1 << 48) - 1, 6, _), dests = 0,
can_eliminate = False, can_reorder = False, imms = [IMM])