From dbd72a8f94ca8aad954990b527d7c510983c96f5 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 13 May 2020 12:23:53 -0400 Subject: [PATCH] panfrost: Determine classes for stores Fewer special cases here, thankfully. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/util/pan_lower_framebuffer.c | 12 ++++++++++++ src/panfrost/util/pan_lower_framebuffer.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/panfrost/util/pan_lower_framebuffer.c b/src/panfrost/util/pan_lower_framebuffer.c index 33c1d5af75d..6ceb2e47a8a 100644 --- a/src/panfrost/util/pan_lower_framebuffer.c +++ b/src/panfrost/util/pan_lower_framebuffer.c @@ -113,3 +113,15 @@ pan_format_class_load(const struct util_format_description *desc, unsigned quirk /* Otherwise, we can do native */ return PAN_FORMAT_NATIVE; } + +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; +} diff --git a/src/panfrost/util/pan_lower_framebuffer.h b/src/panfrost/util/pan_lower_framebuffer.h index 7bca12f561a..3804ff4beb9 100644 --- a/src/panfrost/util/pan_lower_framebuffer.h +++ b/src/panfrost/util/pan_lower_framebuffer.h @@ -41,5 +41,6 @@ enum pan_format_class { nir_alu_type pan_unpacked_type_for_format(const struct util_format_description *desc); enum pan_format_class pan_format_class_load(const struct util_format_description *desc, unsigned quirks); +enum pan_format_class pan_format_class_store(const struct util_format_description *desc, unsigned quirks); #endif -- 2.30.2