panfrost: Add quirks for blend shader types
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 13 May 2020 16:15:28 +0000 (12:15 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 1 Jun 2020 15:46:23 +0000 (15:46 +0000)
Every hardware has its own set of what it can and can't do... let's
document it all as quirks so the lowering code is GPU-agnostic.

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

src/panfrost/include/panfrost-quirks.h

index 1d2ca775e45a300b240acf00cfd79bae144fe6fe..10ea38f7cc2cfe0ae40d5184f6e67b6fccf3c3ad 100644 (file)
 
 #define MIDGARD_SHADERLESS (1 << 5)
 
+/* Whether this GPU lacks support for any typed stores in blend shader,
+ * requiring packing instead */
+#define MIDGARD_NO_TYPED_BLEND_STORES (1 << 6)
+
+/* Whether this GPU lacks support for any typed loads, requiring packing */
+#define MIDGARD_NO_TYPED_BLEND_LOADS (1 << 7)
+
+/* Lack support for colour pack/unpack opcodes */
+#define NO_BLEND_PACKS (1 << 8)
+
+/* Has some missing formats for typed loads */
+#define MIDGARD_MISSING_LOADS (1 << 9)
+
 /* Quirk collections common to particular uarchs */
 
-#define MIDGARD_QUIRKS (MIDGARD_BROKEN_FP16 | HAS_SWIZZLES)
+#define MIDGARD_QUIRKS (MIDGARD_BROKEN_FP16 | HAS_SWIZZLES \
+                | MIDGARD_NO_TYPED_BLEND_STORES \
+                | MIDGARD_MISSING_LOADS)
 
-#define BIFROST_QUIRKS (IS_BIFROST)
+#define BIFROST_QUIRKS (IS_BIFROST | NO_BLEND_PACKS)
 
 static inline unsigned
 panfrost_get_quirks(unsigned gpu_id)
@@ -67,7 +82,9 @@ panfrost_get_quirks(unsigned gpu_id)
         switch (gpu_id) {
         case 0x600:
         case 0x620:
-                return MIDGARD_QUIRKS | MIDGARD_SFBD;
+                return MIDGARD_QUIRKS | MIDGARD_SFBD
+                        | MIDGARD_NO_TYPED_BLEND_LOADS
+                        | NO_BLEND_PACKS;
 
         case 0x720:
                 return MIDGARD_QUIRKS | MIDGARD_SFBD | MIDGARD_NO_HIER_TILING;
@@ -77,6 +94,10 @@ panfrost_get_quirks(unsigned gpu_id)
                 return MIDGARD_QUIRKS | MIDGARD_NO_HIER_TILING;
 
         case 0x750:
+                /* Someone should investigate the broken loads? */
+                return MIDGARD_QUIRKS | MIDGARD_NO_TYPED_BLEND_LOADS
+                        | NO_BLEND_PACKS;
+
         case 0x860:
         case 0x880:
                 return MIDGARD_QUIRKS | MIDGARD_SHADERLESS;