From 2e8676737098082787f2225687f9af5686aff16f Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 18 Feb 2022 16:41:24 -0500 Subject: [PATCH] pan/bi: Add BIFROST_MESA_DEBUG=nosb option To disable the new scoreboarding optimizations when debugging. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_scoreboard.c | 4 ++++ src/panfrost/bifrost/bifrost.h | 1 + src/panfrost/bifrost/bifrost_compile.c | 1 + 3 files changed, 6 insertions(+) diff --git a/src/panfrost/bifrost/bi_scoreboard.c b/src/panfrost/bifrost/bi_scoreboard.c index dd5054d776d..27895a8b8a1 100644 --- a/src/panfrost/bifrost/bi_scoreboard.c +++ b/src/panfrost/bifrost/bi_scoreboard.c @@ -65,6 +65,10 @@ static bool bi_should_serialize(bi_instr *I) { + /* For debug, serialize everything to disable scoreboard opts */ + if (bifrost_debug & BIFROST_DBG_NOSB) + return true; + /* Although nominally on the attribute unit, image loads have the same * coherency requirements as general memory loads. Serialize them for * now until we can do something more clever. diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h index 8af51ed8be7..c04b8a61ad4 100644 --- a/src/panfrost/bifrost/bifrost.h +++ b/src/panfrost/bifrost/bifrost.h @@ -45,6 +45,7 @@ extern "C" { #define BIFROST_DBG_NOVALIDATE 0x0080 #define BIFROST_DBG_NOOPT 0x0100 #define BIFROST_DBG_NOIDVS 0x0200 +#define BIFROST_DBG_NOSB 0x0400 extern int bifrost_debug; diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 32b8fd83898..42cb08248a5 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -47,6 +47,7 @@ static const struct debug_named_value bifrost_debug_options[] = { {"novalidate",BIFROST_DBG_NOVALIDATE, "Skip IR validation"}, {"noopt", BIFROST_DBG_NOOPT, "Skip optimization passes"}, {"noidvs", BIFROST_DBG_NOIDVS, "Disable IDVS"}, + {"nosb", BIFROST_DBG_NOSB, "Disable scoreboarding"}, DEBUG_NAMED_VALUE_END };