From 0ab3f687c012c7e29fbb9da348bec1854ee85fd7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 1 Apr 2020 18:22:01 -0400 Subject: [PATCH] pan/bi: Handle BIFROST_FIRST_WRITE_FMA_P2_READ_P3 It's a special case for unclear reasons, and if you mess it up you get INSTR_INVALID_ENC. Isn't hardware fun? Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_pack.c | 2 ++ src/panfrost/bifrost/bifrost.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 8cd4dd3b916..f1eb3be52b0 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -315,6 +315,8 @@ bi_pack_register_ctrl(struct bi_registers r) if (r.first_instruction) { if (ctrl == BIFROST_REG_NONE) ctrl = BIFROST_FIRST_NONE; + else if (ctrl == BIFROST_WRITE_FMA_P2_READ_P3) + ctrl = BIFROST_FIRST_WRITE_FMA_P2_READ_P3; else ctrl |= BIFROST_FIRST_NONE; } diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h index 74718eaa316..4dc3c741b38 100644 --- a/src/panfrost/bifrost/bifrost.h +++ b/src/panfrost/bifrost/bifrost.h @@ -520,7 +520,7 @@ struct bifrost_fmt_constant { enum bifrost_reg_control { BIFROST_WRITE_FMA_P2 = 1, BIFROST_WRITE_FMA_P2_READ_P3 = 2, - BIFROST_WRITE_FMA_P2_READ_P3_ALT = 3, + BIFROST_FIRST_WRITE_FMA_P2_READ_P3 = 3, BIFROST_READ_P3 = 4, BIFROST_WRITE_ADD_P2 = 5, BIFROST_WRITE_ADD_P2_READ_P3 = 6, @@ -528,6 +528,7 @@ enum bifrost_reg_control { BIFROST_FIRST_NONE = 8, BIFROST_FIRST_WRITE_FMA_P2 = 9, + /* INSTR_INVALID_ENC */ BIFROST_REG_NONE = 11, BIFROST_FIRST_READ_P3 = 12, BIFROST_FIRST_WRITE_ADD_P2 = 13, -- 2.30.2