diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c index 8a7fa6309d9..4a15b560abf 100644 --- a/src/panfrost/bifrost/bi_ra.c +++ b/src/panfrost/bifrost/bi_ra.c @@ -314,6 +314,10 @@ bi_allocate_registers(bi_context *ctx, bool *success, bool full_regs) full_regs ? BITFIELD64_MASK(64) : (BITFIELD64_MASK(16) | (BITFIELD64_MASK(16) << 48)); + /* To test spilling, mimic a small register file */ + if (bifrost_debug & BIFROST_DBG_SPILL && !ctx->inputs->is_blend) + default_affinity &= BITFIELD64_MASK(48) << 8; + bi_foreach_instr_global(ctx, ins) { bi_foreach_dest(ins, d) { unsigned dest = bi_get_node(ins->dest[d]); diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h index 6dce0c53b38..d80844e012f 100644 --- a/src/panfrost/bifrost/bifrost.h +++ b/src/panfrost/bifrost/bifrost.h @@ -47,6 +47,7 @@ extern "C" { #define BIFROST_DBG_NOIDVS 0x0200 #define BIFROST_DBG_NOSB 0x0400 #define BIFROST_DBG_NOPRELOAD 0x0800 +#define BIFROST_DBG_SPILL 0x1000 extern int bifrost_debug; diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 5464e581024..12c09a68282 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -52,6 +52,7 @@ static const struct debug_named_value bifrost_debug_options[] = { {"noidvs", BIFROST_DBG_NOIDVS, "Disable IDVS"}, {"nosb", BIFROST_DBG_NOSB, "Disable scoreboarding"}, {"nopreload", BIFROST_DBG_NOPRELOAD, "Disable message preloading"}, + {"spill", BIFROST_DBG_SPILL, "Test register spilling"}, DEBUG_NAMED_VALUE_END };