diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index f8994e5f921..30202ef3093 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -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); } } diff --git a/src/asahi/compiler/agx_opcodes.py b/src/asahi/compiler/agx_opcodes.py index 496c13013d4..4e39ca406d6 100644 --- a/src/asahi/compiler/agx_opcodes.py +++ b/src/asahi/compiler/agx_opcodes.py @@ -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])