pan/bi: Pack BI_BLEND
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 19 Mar 2020 03:12:38 +0000 (23:12 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 19 Mar 2020 03:23:07 +0000 (03:23 +0000)
MRT not yet supported to keep things easy.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4242>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4242>

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

index 705a43e3531993ae6bd02c97e3df9d8619595478..2494cb55cdd808637e328b5c013443588386f95c 100644 (file)
@@ -455,6 +455,20 @@ bi_pack_add_atest(bi_clause *clause, bi_instruction *ins, struct bi_registers *r
         RETURN_PACKED(pack);
 }
 
+static unsigned
+bi_pack_add_blend(bi_instruction *ins, struct bi_registers *regs)
+{
+        struct bifrost_add_inst pack = {
+                .src0 = bi_get_src(ins, regs, 0, false),
+                .op = BIFROST_ADD_OP_BLEND
+        };
+
+        /* TODO: Pack location in uniform_const */
+        assert(ins->blend_location == 0);
+
+        RETURN_PACKED(pack);
+}
+
 static unsigned
 bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
 {
@@ -468,7 +482,9 @@ bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
                 return bi_pack_add_atest(clause, bundle.add, regs);
         case BI_BRANCH:
         case BI_CMP:
+                return BIFROST_ADD_NOP;
         case BI_BLEND:
+                return bi_pack_add_blend(bundle.add, regs);
         case BI_BITWISE:
         case BI_CONVERT:
         case BI_DISCARD:
index 9fb063c32af8490f5978fe81bdd73cc5cd2ad4a2..dac4ad190dd556b2887ca9414bc690970627fa10 100644 (file)
@@ -100,6 +100,8 @@ struct bifrost_fma_inst {
         unsigned op   : 20;
 } __attribute__((packed));
 
+#define BIFROST_ADD_OP_BLEND (0x1952c)
+
 struct bifrost_add_inst {
         unsigned src0 : 3;
         unsigned op   : 17;