panfrost: Support SHADERLESS mode everywhere
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 21 Aug 2020 13:22:34 +0000 (09:22 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 25 Aug 2020 15:05:36 +0000 (17:05 +0200)
Now that the missing bits on SFBD are identified, and we have a
reasonable way to pack the properties for Bifrost, we can probably do
this everywhere to generalize the optimization and drop the quirk.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>

src/gallium/drivers/panfrost/pan_cmdstream.c
src/panfrost/include/panfrost-quirks.h

index 1a170f6ee3b0d939437f89345ddf1f4de729f094..8409ec253437d81b0650703b25d1f2140c55ead4 100644 (file)
@@ -697,21 +697,29 @@ panfrost_emit_frag_shader(struct panfrost_context *ctx,
                         ctx->blend->base.alpha_to_coverage);
 
         /* Disable shader execution if we can */
-        if (dev->quirks & MIDGARD_SHADERLESS
-                        && !panfrost_fs_required(fs, blend, rt_count)) {
-                fragmeta->shader = 0x1;
+        if (!panfrost_fs_required(fs, blend, rt_count)) {
                 fragmeta->attribute_count = 0;
                 fragmeta->varying_count = 0;
                 fragmeta->texture_count = 0;
                 fragmeta->sampler_count = 0;
 
-                /* This feature is not known to work on Bifrost */
                 struct mali_midgard_properties_packed prop;
 
-                pan_pack(&prop, MIDGARD_PROPERTIES, cfg) {
-                        cfg.work_register_count = 1;
-                        cfg.depth_source = MALI_DEPTH_SOURCE_FIXED_FUNCTION;
-                        cfg.early_z_enable = true;
+                if (dev->quirks & IS_BIFROST) {
+                        fragmeta->shader = 0x0;
+
+                        pan_pack(&prop, BIFROST_PROPERTIES, cfg) {
+                                cfg.unknown = 0x950020; /* XXX */
+                                cfg.early_z_enable = true;
+                        }
+                } else {
+                        fragmeta->shader = 0x1;
+
+                        pan_pack(&prop, MIDGARD_PROPERTIES, cfg) {
+                                cfg.work_register_count = 1;
+                                cfg.depth_source = MALI_DEPTH_SOURCE_FIXED_FUNCTION;
+                                cfg.early_z_enable = true;
+                        }
                 }
 
                 memcpy(&fragmeta->midgard_props, &prop, sizeof(prop));
index 4b88e83aabe8b42ad9f8ee788c953e738a92a213..22a79c91f011e18234470638e8cd8874a3dbae51 100644 (file)
 /* What it says on the tin */
 #define HAS_SWIZZLES (1 << 4)
 
-/* Support for setting shader to NULL for masking out colour (while allowing
- * Z/S updates to proceed) */
-
-#define MIDGARD_SHADERLESS (1 << 5)
+/* bit 5 unused */
 
 /* Whether this GPU lacks support for any typed stores in blend shader,
  * requiring packing instead */
@@ -101,11 +98,11 @@ panfrost_get_quirks(unsigned gpu_id)
         case 0x750:
                 /* Someone should investigate the broken loads? */
                 return MIDGARD_QUIRKS | MIDGARD_NO_TYPED_BLEND_LOADS
-                        | NO_BLEND_PACKS | MIDGARD_SHADERLESS;
+                        | NO_BLEND_PACKS;
 
         case 0x860:
         case 0x880:
-                return MIDGARD_QUIRKS | MIDGARD_SHADERLESS;
+                return MIDGARD_QUIRKS;
 
         case 0x6000: /* G71 */
                 return BIFROST_QUIRKS | HAS_SWIZZLES;