pan/midgard: Use upper ALU tags for MFBD writeout
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 2 Jan 2020 17:33:25 +0000 (12:33 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 2 Jan 2020 22:27:23 +0000 (17:27 -0500)
It's not clear yet what the distinction is.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_emit.c
src/panfrost/midgard/midgard_quirks.h
src/panfrost/midgard/midgard_schedule.c

index d5aba7f8612010405e7d1273f7980f012ad77728..1dae8e390990e01f08375d3e3abf6f776627f8f8 100644 (file)
@@ -405,6 +405,10 @@ emit_binary_bundle(compiler_context *ctx,
         case TAG_ALU_8:
         case TAG_ALU_12:
         case TAG_ALU_16:
+        case TAG_ALU_4 + 4:
+        case TAG_ALU_8 + 4:
+        case TAG_ALU_12 + 4:
+        case TAG_ALU_16 + 4:
                 emit_alu_bundle(ctx, bundle, emission, lookahead);
                 break;
 
index 359d45dbdde2ba6e27d6f91f71f0604b14f49d31..7f213cc3d697b10750cd3472844cde81263a8113 100644 (file)
 
 #define MIDGARD_BROKEN_LOD (1 << 3)
 
+/* Don't use upper ALU tags for writeout (if you do, you'll get a
+ * INSTR_INVALID_ENC). It's not clear to me what these tags are for. */
+
+#define MIDGARD_NO_UPPER_ALU (1 << 4)
+
 static inline unsigned
 midgard_get_quirks(unsigned gpu_id)
 {
@@ -64,18 +69,23 @@ midgard_get_quirks(unsigned gpu_id)
         case 0x600:
         case 0x620:
                 return MIDGARD_OLD_BLEND |
-                        MIDGARD_BROKEN_LOD;
+                        MIDGARD_BROKEN_LOD |
+                        MIDGARD_NO_UPPER_ALU;
 
         case 0x720:
                 return MIDGARD_INTERPIPE_REG_ALIASING | 
                         MIDGARD_OLD_BLEND |
-                        MIDGARD_BROKEN_LOD;
+                        MIDGARD_BROKEN_LOD |
+                        MIDGARD_NO_UPPER_ALU;
 
         case 0x820:
         case 0x830:
                 return MIDGARD_INTERPIPE_REG_ALIASING;
 
         case 0x750:
+                return MIDGARD_EXPLICIT_LOD |
+                        MIDGARD_NO_UPPER_ALU;
+
         case 0x860:
         case 0x880:
                 return MIDGARD_EXPLICIT_LOD;
index 46e1f7a4a3525428080dd6a6f0d7d619ab28d1e2..05a0c74cbf84c390e04d14abe94b6023d12f8eed 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "compiler.h"
 #include "midgard_ops.h"
+#include "midgard_quirks.h"
 #include "util/u_memory.h"
 
 /* Scheduling for Midgard is complicated, to say the least. ALU instructions
@@ -1051,6 +1052,11 @@ mir_schedule_alu(
 
         /* Size ALU instruction for tag */
         bundle.tag = (TAG_ALU_4) + (bytes_emitted / 16) - 1;
+
+        /* MRT capable GPUs use a special writeout procedure */
+        if (writeout && !(ctx->quirks & MIDGARD_NO_UPPER_ALU))
+                bundle.tag += 4;
+
         bundle.padding = padding;
         bundle.control |= bundle.tag;