pan/bi: Handle BIFROST_FIRST_WRITE_FMA_P2_READ_P3
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 1 Apr 2020 22:22:01 +0000 (18:22 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sun, 5 Apr 2020 23:26:04 +0000 (23:26 +0000)
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 <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4458>

src/panfrost/bifrost/bi_pack.c
src/panfrost/bifrost/bifrost.h

index 8cd4dd3..f1eb3be 100644 (file)
@@ -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;
         }
index 74718ea..4dc3c74 100644 (file)
@@ -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,