From a0857e9d9ebf01334a0aca731bb622cb445e670e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 21 Aug 2020 09:22:34 -0400 Subject: [PATCH] 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 Reviewed-by: Tomeu Vizoso Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 24 +++++++++++++------- src/panfrost/include/panfrost-quirks.h | 9 +++----- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 1a170f6ee3b..8409ec25343 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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)); diff --git a/src/panfrost/include/panfrost-quirks.h b/src/panfrost/include/panfrost-quirks.h index 4b88e83aabe..22a79c91f01 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 @@ 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; -- 2.30.2