Module: Mesa Branch: main Commit: 93f6c6586c53b5280410bbf10711399dd57e8344 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=93f6c6586c53b5280410bbf10711399dd57e8344
Author: Alyssa Rosenzweig <[email protected]> Date: Tue Jan 25 17:56:33 2022 -0500 panfrost: Remove MIDGARD_{NO_TYPED_BLEND_STORES,MISSING_LOADS} These "quirks" are common for Midgard, yet are only consumed by pan_lower_framebuffer -- a Midgard-only pass. So the quirks should be removed and inlined into their users. Thid removes MIDGARD_QUIRKS altogether. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14724> --- src/panfrost/include/panfrost-quirks.h | 25 +++++-------------------- src/panfrost/util/pan_lower_framebuffer.c | 26 ++++++++------------------ 2 files changed, 13 insertions(+), 38 deletions(-) diff --git a/src/panfrost/include/panfrost-quirks.h b/src/panfrost/include/panfrost-quirks.h index d1dc3ceb56c..6eb6c02e971 100644 --- a/src/panfrost/include/panfrost-quirks.h +++ b/src/panfrost/include/panfrost-quirks.h @@ -34,11 +34,7 @@ #define MIDGARD_NO_HIER_TILING (1 << 0) -/* bit 1-5 unused */ - -/* Whether this GPU lacks support for any typed stores in blend shader, - * requiring packing instead */ -#define MIDGARD_NO_TYPED_BLEND_STORES (1 << 6) +/* bit 1-6 unused */ /* Whether this GPU lacks support for any typed loads, requiring packing */ #define MIDGARD_NO_TYPED_BLEND_LOADS (1 << 7) @@ -46,18 +42,13 @@ /* 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) - -/* bit 10 unused */ +/* bits 9-10 unused */ /* Does this GPU support anisotropic filtering? */ #define HAS_ANISOTROPIC (1 << 11) /* Quirk collections common to particular uarchs */ -#define MIDGARD_QUIRKS (MIDGARD_NO_TYPED_BLEND_STORES | MIDGARD_MISSING_LOADS) - #define BIFROST_QUIRKS NO_BLEND_PACKS static inline unsigned @@ -66,23 +57,17 @@ panfrost_get_quirks(unsigned gpu_id, unsigned gpu_revision) switch (gpu_id) { case 0x600: case 0x620: - return MIDGARD_QUIRKS - | MIDGARD_NO_TYPED_BLEND_LOADS - | NO_BLEND_PACKS; + return MIDGARD_NO_TYPED_BLEND_LOADS | NO_BLEND_PACKS; case 0x720: - return MIDGARD_QUIRKS | MIDGARD_NO_HIER_TILING; - case 0x820: case 0x830: - return MIDGARD_QUIRKS | MIDGARD_NO_HIER_TILING; + return MIDGARD_NO_HIER_TILING; case 0x750: - return MIDGARD_QUIRKS; - case 0x860: case 0x880: - return MIDGARD_QUIRKS; + return 0; case 0x6000: /* G71 */ return BIFROST_QUIRKS; diff --git a/src/panfrost/util/pan_lower_framebuffer.c b/src/panfrost/util/pan_lower_framebuffer.c index 0d6107932fb..72f2cb580c0 100644 --- a/src/panfrost/util/pan_lower_framebuffer.c +++ b/src/panfrost/util/pan_lower_framebuffer.c @@ -105,30 +105,20 @@ pan_format_class_load(const struct util_format_description *desc, unsigned quirk ? PAN_FORMAT_SOFTWARE : PAN_FORMAT_PACK; } - /* Some formats are missing as typed on some GPUs but have unpacks */ - if (quirks & MIDGARD_MISSING_LOADS) { - switch (desc->format) { - case PIPE_FORMAT_R11G11B10_FLOAT: - return PAN_FORMAT_PACK; - default: - return PAN_FORMAT_NATIVE; - } + /* Some formats are missing as typed but have unpacks */ + switch (desc->format) { + case PIPE_FORMAT_R11G11B10_FLOAT: + return PAN_FORMAT_PACK; + default: + return PAN_FORMAT_NATIVE; } - - /* Otherwise, we can do native */ - return PAN_FORMAT_NATIVE; } static enum pan_format_class pan_format_class_store(const struct util_format_description *desc, unsigned quirks) { - /* Check if we can do anything better than software architecturally */ - if (quirks & MIDGARD_NO_TYPED_BLEND_STORES) { - return (quirks & NO_BLEND_PACKS) - ? PAN_FORMAT_SOFTWARE : PAN_FORMAT_PACK; - } - - return PAN_FORMAT_NATIVE; + return (quirks & NO_BLEND_PACKS) ? PAN_FORMAT_SOFTWARE : + PAN_FORMAT_PACK; } /* Convenience method */
