From d458384883eafe101e05ccac12e1ff4bc8fe20bb Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 22 Jun 2022 11:35:32 -0400 Subject: [PATCH] pan/va: Handle BIFROST_MESA_DEBUG=nosb For debugging flakes that might be caused due to wrong scoreboarding. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/valhall/va_insert_flow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/valhall/va_insert_flow.c b/src/panfrost/bifrost/valhall/va_insert_flow.c index 2881ac34193..9d666821e1b 100644 --- a/src/panfrost/bifrost/valhall/va_insert_flow.c +++ b/src/panfrost/bifrost/valhall/va_insert_flow.c @@ -214,10 +214,13 @@ bi_set_dependencies(bi_block *block, bi_instr *I, struct bi_scoreboard_state *st * * Luckily, this situation is pretty rare. The wait introduced here can * usually be merged into the preceding instruction. + * + * We also use the same workaround to serialize all async instructions when + * debugging this pass with the BIFROST_MESA_DEBUG=nosb option. */ - if (I->op == BI_OPCODE_BARRIER) { + if (I->op == BI_OPCODE_BARRIER || (bifrost_debug & BIFROST_DBG_NOSB)) { for (unsigned i = 0; i < VA_NUM_GENERAL_SLOTS; ++i) { - if (st->write[i] || (st->memory & BITFIELD_BIT(i))) + if (st->write[i] || ((st->varying | st->memory) & BITFIELD_BIT(i))) I->flow |= bi_pop_slot(st, i); } }