From ef0c7382c748cc4a8e40baf3285cf39e7a07ffcb Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Mon, 3 Mar 2025 11:13:35 +0000 Subject: [PATCH] pan/bi: Disallow FAU special page 3 and WARP_ID on message instructions This is a constraint that apply on Valhall and later, instructions should not use FAU special page 3 or WARP_ID if running on the message unit. Signed-off-by: Mary Guillemard Fixes: fd1906afea59 ("pan/va: Add FAU validation") Reviewed-by: Erik Faye-Lund Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/compiler/valhall/va_validate.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/panfrost/compiler/valhall/va_validate.c b/src/panfrost/compiler/valhall/va_validate.c index ffaecd2c069..3465ac086e5 100644 --- a/src/panfrost/compiler/valhall/va_validate.c +++ b/src/panfrost/compiler/valhall/va_validate.c @@ -72,6 +72,13 @@ can_use_two_fau_indices(enum bi_opcode op) op != BI_OPCODE_BLEND; } +static bool +can_run_on_message_unit(enum bi_opcode op) +{ + return bi_opcode_props[op].message != BIFROST_MESSAGE_NONE || + op == BI_OPCODE_ATEST || op == BI_OPCODE_BLEND; +} + static bool fau_is_special(enum bir_fau fau) { @@ -114,6 +121,12 @@ fau_state_special(struct fau_state *fau, bi_index idx, enum bi_opcode op) return false; } + /* Instructions executed by the messaging unit should not encode WARP_ID or + * anything from special page 3. */ + if (can_run_on_message_unit(op) && + (va_fau_page(idx.value) == 3 || idx.value == BIR_FAU_WARP_ID)) + return false; + return fau->uniform_slot == -1 || can_use_two_fau_indices(op); }