From af3863c6585f2fdec8564451482a168fbfce462b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 8 Nov 2021 09:50:43 -0500 Subject: [PATCH] pan/bi: Allow an extra staging source Useful for dual source blending. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_schedule.c | 8 ++++---- src/panfrost/bifrost/compiler.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c index 1b286657630..7d73b2f9674 100644 --- a/src/panfrost/bifrost/bi_schedule.c +++ b/src/panfrost/bifrost/bi_schedule.c @@ -1199,21 +1199,21 @@ bi_take_instr(bi_context *ctx, struct bi_worklist st, } /* Variant of bi_rewrite_index_src_single that uses word-equivalence, rewriting - * to a passthrough register. If except_zero is true, the zeroth (first) source - * is skipped, so staging register reads are not accidentally encoded as + * to a passthrough register. If except_sr is true, the staging sources are + * skipped, so staging register reads are not accidentally encoded as * passthrough (which is impossible) */ static void bi_use_passthrough(bi_instr *ins, bi_index old, enum bifrost_packed_src new, - bool except_zero) + bool except_sr) { /* Optional for convenience */ if (!ins || bi_is_null(old)) return; bi_foreach_src(ins, i) { - if (i == 0 && except_zero) + if ((i == 0 || i == 4) && except_sr) continue; if (bi_is_word_equiv(ins->src[i], old)) { diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 8c0883f547b..19a3959e5eb 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -356,7 +356,7 @@ bi_is_word_equiv(bi_index left, bi_index right) } #define BI_MAX_DESTS 2 -#define BI_MAX_SRCS 4 +#define BI_MAX_SRCS 5 typedef struct { /* Must be first */ @@ -500,7 +500,7 @@ typedef struct { static inline bool bi_is_staging_src(bi_instr *I, unsigned s) { - return (s == 0) && bi_opcode_props[I->op].sr_read; + return (s == 0 || s == 4) && bi_opcode_props[I->op].sr_read; } /* Represents the assignment of slots for a given bi_tuple */