panfrost: Support SHADERLESS mode everywhere

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>
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 1a170f6..8409ec2 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -697,21 +697,29 @@
                         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));
diff --git a/src/panfrost/include/panfrost-quirks.h b/src/panfrost/include/panfrost-quirks.h
index 4b88e83..22a79c9 100644
--- a/src/panfrost/include/panfrost-quirks.h
+++ b/src/panfrost/include/panfrost-quirks.h
@@ -50,10 +50,7 @@
 /* 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 @@
         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;