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>
This commit is contained in:
Alyssa Rosenzweig
2020-08-21 09:22:34 -04:00
committed by Tomeu Vizoso
parent c9858fb941
commit a0857e9d9e
2 changed files with 19 additions and 14 deletions
+16 -8
View 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));
+3 -6
View File
@@ -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 @@ 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;