Mesa (main): etnaviv: fix alpha blend with dither on older GPUs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Dec 11 03:16:53 UTC 2021


Module: Mesa
Branch: main
Commit: fc17f79f2ccd75ba19f17055ae1f5e441208e599
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc17f79f2ccd75ba19f17055ae1f5e441208e599

Author: Lucas Stach <l.stach at pengutronix.de>
Date:   Wed Oct  6 16:26:57 2021 +0200

etnaviv: fix alpha blend with dither on older GPUs

While setting up DITHER_MODE allows alpha blending to work properly
together with dithering on new GPUs (those with PE_DITHER_FIX), older
cores still change the render target. As dithering is optional and
implementation defined we can simply disable it on the affected GPUs,
when alpha blending is enabled to work around this bug.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13396>

---

 src/gallium/drivers/etnaviv/etnaviv_blend.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_blend.c b/src/gallium/drivers/etnaviv/etnaviv_blend.c
index 36624265654..9927664bb13 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_blend.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_blend.c
@@ -108,7 +108,9 @@ etna_blend_state_create(struct pipe_context *pctx,
     * dither pattern,
     * for now, set the same values as the blob.
     */
-   if (so->dither) {
+   if (so->dither &&
+       (!alpha_enable ||
+        VIV_FEATURE(ctx->screen, chipMinorFeatures3, PE_DITHER_FIX))) {
       co->PE_DITHER[0] = 0x6e4ca280;
       co->PE_DITHER[1] = 0x5d7f91b3;
    } else {



More information about the mesa-commit mailing list