From 75a274de061485c0f0e74de5325cf98e7cea5e1d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 24 Aug 2020 12:06:04 -0400 Subject: [PATCH] panfrost: Add opaque midgard_blend XML Just to ensure write ordering is sane. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 23 +++++++++++--------- src/panfrost/lib/midgard.xml | 7 ++++++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 254543b21c2..5cadab71d13 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -435,7 +435,6 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts, unsigned rt_count = batch->key.nr_cbufs; struct bifrost_blend_rt *brts = rts; - struct midgard_blend_rt *mrts = rts; /* Disable blending for depth-only on Bifrost */ @@ -443,7 +442,7 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts, brts[0].unk2 = 0x3; for (unsigned i = 0; i < rt_count; ++i) { - unsigned flags = 0; + struct mali_blend_flags_packed flags = {}; pan_pack(&flags, BLEND_FLAGS, cfg) { if (blend[i].no_colour) { @@ -462,7 +461,7 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts, } if (dev->quirks & IS_BIFROST) { - brts[i].flags = flags; + brts[i].flags = flags.opaque[0]; if (blend[i].is_shader) { /* The blend shader's address needs to be at @@ -494,14 +493,18 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts, brts[i].shader_type = fs->blend_types[i]; } } else { - memcpy(&mrts[i].flags, &flags, sizeof(flags)); - - if (blend[i].is_shader) { - mrts[i].blend.shader = blend[i].shader.gpu | blend[i].shader.first_tag; - } else { - mrts[i].blend.equation = blend[i].equation.equation; - mrts[i].blend.constant = blend[i].equation.constant; + pan_pack(rts, MIDGARD_BLEND_OPAQUE, cfg) { + cfg.flags = flags; + + if (blend[i].is_shader) { + cfg.shader = blend[i].shader.gpu | blend[i].shader.first_tag; + } else { + cfg.equation = blend[i].equation.equation.opaque[0]; + cfg.constant = blend[i].equation.constant; + } } + + rts += MALI_MIDGARD_BLEND_LENGTH; } } } diff --git a/src/panfrost/lib/midgard.xml b/src/panfrost/lib/midgard.xml index e145e7433c7..1d9a2b72918 100644 --- a/src/panfrost/lib/midgard.xml +++ b/src/panfrost/lib/midgard.xml @@ -276,6 +276,13 @@ + + + + + + + -- 2.30.2