From: Alyssa Rosenzweig Date: Tue, 31 Mar 2020 17:37:12 +0000 (-0400) Subject: pan/bi: Fix unused port swapping X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=357b8b59065c50dd4d8eecf437bb721be38092bd;p=mesa.git pan/bi: Fix unused port swapping Fixes INSTR_INVALID_ENC Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 94a62edb471..293a109eb5a 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -362,6 +362,15 @@ bi_pack_registers(struct bi_registers regs) } } + /* When port 3 isn't used, we have to set it to port 2, and vice versa, + * or we an INSTR_INVALID_ENC is raised. The reason is unknown. */ + + if (!regs.port[3]) + regs.port[3] = regs.port[2]; + + if (!regs.port[2]) + regs.port[2] = regs.port[3]; + s.reg3 = regs.port[3]; s.reg2 = regs.port[2]; s.uniform_const = regs.uniform_constant;