From: Alyssa Rosenzweig Date: Wed, 13 May 2020 16:15:28 +0000 (-0400) Subject: panfrost: Add quirks for blend shader types X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e53d27de61b408049c07e64911b20b117e243910;p=mesa.git panfrost: Add quirks for blend shader types 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 Part-of: --- diff --git a/src/panfrost/include/panfrost-quirks.h b/src/panfrost/include/panfrost-quirks.h index 1d2ca775e45..10ea38f7cc2 100644 --- a/src/panfrost/include/panfrost-quirks.h +++ b/src/panfrost/include/panfrost-quirks.h @@ -55,11 +55,26 @@ #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;