broadcom/vc5: Implement workaround for GFXH-1431.
authorEric Anholt <eric@anholt.net>
Mon, 26 Mar 2018 17:38:28 +0000 (10:38 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 27 Mar 2018 00:46:19 +0000 (17:46 -0700)
This should fix some blending errors, but doesn't impact any testcases in
the CTS.

src/gallium/drivers/vc5/vc5_emit.c

index 71f508c9ee8400ea9449ac0f3ba131dad698a71e..deb46228dad47ddec1f21bd22f2b7278877d6ba6 100644 (file)
@@ -490,7 +490,11 @@ v3dX(emit_state)(struct pipe_context *pctx)
                 }
         }
 
-        if (vc5->dirty & VC5_DIRTY_BLEND_COLOR) {
+        /* GFXH-1431: On V3D 3.x, writing BLEND_CONFIG resets the constant
+         * color.
+         */
+        if (vc5->dirty & VC5_DIRTY_BLEND_COLOR ||
+            (V3D_VERSION < 41 && (vc5->dirty & VC5_DIRTY_BLEND))) {
                 cl_emit(&job->bcl, BLEND_CONSTANT_COLOUR, colour) {
                         colour.red_f16 = (vc5->swap_color_rb ?
                                           vc5->blend_color.hf[2] :