From 8d707cd91833f50a1111bf4481378ee99069befe Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 12 Oct 2020 14:16:53 +0200 Subject: [PATCH] panfrost: Add a "Bifrost Internal Blend" descriptor This descriptor can be passed directly as a constant to the bifrost BLEND instruction and we'll need to pass this information to blend shaders. Let's extract the "Bifrost Internal Blend" descriptor from the "Bifrost Blend Overlay" definition. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 19 ++++++++++--------- src/panfrost/lib/decode.c | 4 ++-- src/panfrost/lib/midgard.xml | 10 +++++++--- 3 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 e95e414..e481bbb 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -271,7 +271,7 @@ panfrost_emit_bifrost_blend(struct panfrost_batch *batch, /* Disable blending for depth-only */ pan_pack(rts, BLEND, cfg) { cfg.enable = false; - cfg.bifrost.mode = MALI_BIFROST_BLEND_MODE_OFF; + cfg.bifrost.internal.mode = MALI_BIFROST_BLEND_MODE_OFF; } return; } @@ -296,8 +296,8 @@ panfrost_emit_bifrost_blend(struct panfrost_batch *batch, */ assert((blend[i].shader.gpu & (0xffffffffull << 32)) == (fs->bo->gpu & (0xffffffffull << 32))); - cfg.bifrost.shader.pc = (u32)blend[i].shader.gpu; - cfg.bifrost.mode = MALI_BIFROST_BLEND_MODE_SHADER; + cfg.bifrost.internal.shader.pc = (u32)blend[i].shader.gpu; + cfg.bifrost.internal.mode = MALI_BIFROST_BLEND_MODE_SHADER; } else { enum pipe_format format = batch->key.cbufs[i]->format; const struct util_format_description *format_desc; @@ -316,18 +316,19 @@ panfrost_emit_bifrost_blend(struct panfrost_batch *batch, cfg.bifrost.constant = constant; if (blend[i].opaque) - cfg.bifrost.mode = MALI_BIFROST_BLEND_MODE_OPAQUE; + cfg.bifrost.internal.mode = MALI_BIFROST_BLEND_MODE_OPAQUE; else - cfg.bifrost.mode = MALI_BIFROST_BLEND_MODE_FIXED_FUNCTION; + cfg.bifrost.internal.mode = MALI_BIFROST_BLEND_MODE_FIXED_FUNCTION; - cfg.bifrost.fixed_function.num_comps = format_desc->nr_channels; - cfg.bifrost.fixed_function.conversion.memory_format.format = + cfg.bifrost.internal.fixed_function.num_comps = format_desc->nr_channels; + cfg.bifrost.internal.fixed_function.conversion.memory_format.format = panfrost_format_to_bifrost_blend(format_desc); if (dev->quirks & HAS_SWIZZLES) { - cfg.bifrost.fixed_function.conversion.memory_format.swizzle = + cfg.bifrost.internal.fixed_function.conversion.memory_format.swizzle = panfrost_get_default_swizzle(4); } - cfg.bifrost.fixed_function.conversion.register_format = fs->blend_types[i]; + cfg.bifrost.internal.fixed_function.conversion.register_format = + fs->blend_types[i]; } } } diff --git a/src/panfrost/lib/decode.c b/src/panfrost/lib/decode.c index 05afc87..3121ff5 100644 --- a/src/panfrost/lib/decode.c +++ b/src/panfrost/lib/decode.c @@ -497,10 +497,10 @@ pandecode_bifrost_blend(void *descs, int job_no, int rt_no, mali_ptr frag_shader { pan_unpack(descs + (rt_no * MALI_BLEND_LENGTH), BLEND, b); DUMP_UNPACKED(BLEND, b, "Blend RT %d:\n", rt_no); - if (b.bifrost.mode != MALI_BIFROST_BLEND_MODE_SHADER) + if (b.bifrost.internal.mode != MALI_BIFROST_BLEND_MODE_SHADER) return 0; - return (frag_shader & 0xFFFFFFFF00000000ULL) | b.bifrost.shader.pc; + return (frag_shader & 0xFFFFFFFF00000000ULL) | b.bifrost.internal.shader.pc; } static mali_ptr diff --git a/src/panfrost/lib/midgard.xml b/src/panfrost/lib/midgard.xml index 01eea63..8387b46 100644 --- a/src/panfrost/lib/midgard.xml +++ b/src/panfrost/lib/midgard.xml @@ -451,12 +451,16 @@ + + + + + + - - - + -- 2.7.4