From 085a5d96e5ccbfbdd76cdf4a0dbc012fe5c94f8e Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Mon, 21 Feb 2022 16:54:50 +1300 Subject: [PATCH] pan/bi: Don't assign slots for the blend second source Another instruction might write to the second source, and then an INSTR_INVALID_ENC fault will be raised because the tuple will write to and read from the register at the same time. Fixes: 795638767d1 ("pan/bi: Use fused dual source blending") Part-of: (cherry picked from commit ba18799ca12628f2346a3bb0f28dc5124c66072a) --- .pick_status.json | 2 +- src/panfrost/bifrost/bi_pack.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 317e0fa8ef2..ae46ae32899 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -562,7 +562,7 @@ "description": "pan/bi: Don't assign slots for the blend second source", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "795638767d142a58b76c91a0719e42536435320f" }, diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index c5dbdebd2ee..455aa8b68f8 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -114,6 +114,12 @@ bi_assign_slots(bi_tuple *now, bi_tuple *prev) if (now->add) { bi_foreach_src(now->add, src) { + /* This is not a real source, we shouldn't assign a + * slot for it. + */ + if (now->add->op == BI_OPCODE_BLEND && src == 4) + continue; + if (!(src == 0 && read_dreg)) bi_assign_slot_read(&now->regs, (now->add)->src[src]); }