xf86-video-intel: src/sna/gen2_render.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Apr 10 22:42:06 PDT 2014


 src/sna/gen2_render.c |   41 ++++++++++++++++++++++++++---------------
 1 file changed, 26 insertions(+), 15 deletions(-)

New commits:
commit a79eb2e29a158910785580409c51a585f25876a7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Apr 10 20:41:57 2014 +0100

    sna/gen2: Fix CA/a8 blend factors
    
    This is a revert of
    
    commit 142f8461944b294dbc3fb0a7bf607bccf0bccc1f [2.99.911]
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Mon Mar 10 15:20:16 2014 +0000
    
        sna/gen2: Tidy blend factor selection for the source
    
    as that broke glyph rendering in firefox for instance.
    
    Reported-by: Carl Eitsger <4607vrfcr84spd21f08 at weg-werf-email.de>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77201
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index a478817..a6c24f7 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -350,28 +350,39 @@ gen2_get_blend_factors(const struct sna_composite_op *op,
 	cblend = TB0C_LAST_STAGE | TB0C_RESULT_SCALE_1X | TB0C_OUTPUT_WRITE_CURRENT;
 	ablend = TB0A_RESULT_SCALE_1X | TB0A_OUTPUT_WRITE_CURRENT;
 
-
 	/* Get the source picture's channels into TBx_ARG1 */
-	if (op->src.is_solid)
-		cblend |= TB0C_ARG1_SEL_DIFFUSE;
-	else if (PICT_FORMAT_RGB(op->src.pict_format) != 0)
-		cblend |= TB0C_ARG1_SEL_TEXEL0;
-	else
-		cblend |= TB0C_ARG1_SEL_ONE | TB0C_ARG1_INVERT;	/* 0.0 */
-	if (op->src.is_solid)
-		ablend |= TB0A_ARG1_SEL_DIFFUSE;
-	else if (op->src.is_opaque)
-		ablend |= TB0A_ARG1_SEL_ONE;
-	else
-		ablend |= TB0A_ARG1_SEL_TEXEL0;
 	if ((op->has_component_alpha && gen2_blend_op[blend].src_alpha) ||
-	    op->dst.format == PICT_a8)
+	    op->dst.format == PICT_a8) {
 		/* Producing source alpha value, so the first set of channels
 		 * is src.A instead of src.X.  We also do this if the destination
 		 * is a8, in which case src.G is what's written, and the other
 		 * channels are ignored.
 		 */
-		cblend |= TB0C_ARG1_REPLICATE_ALPHA;
+		if (op->src.is_opaque) {
+			ablend |= TB0C_ARG1_SEL_ONE;
+			cblend |= TB0C_ARG1_SEL_ONE;
+		} else if (op->src.is_solid) {
+			ablend |= TB0C_ARG1_SEL_DIFFUSE;
+			cblend |= TB0C_ARG1_SEL_DIFFUSE | TB0C_ARG1_REPLICATE_ALPHA;
+		} else {
+			ablend |= TB0C_ARG1_SEL_TEXEL0;
+			cblend |= TB0C_ARG1_SEL_TEXEL0 | TB0C_ARG1_REPLICATE_ALPHA;
+		}
+	} else {
+		if (op->src.is_solid)
+			cblend |= TB0C_ARG1_SEL_DIFFUSE;
+		else if (PICT_FORMAT_RGB(op->src.pict_format) != 0)
+			cblend |= TB0C_ARG1_SEL_TEXEL0;
+		else
+			cblend |= TB0C_ARG1_SEL_ONE | TB0C_ARG1_INVERT;	/* 0.0 */
+
+		if (op->src.is_opaque)
+			ablend |= TB0A_ARG1_SEL_ONE;
+		else if (op->src.is_solid)
+			ablend |= TB0A_ARG1_SEL_DIFFUSE;
+		else
+			ablend |= TB0A_ARG1_SEL_TEXEL0;
+	}
 
 	if (op->mask.bo) {
 		if (op->src.is_solid) {


More information about the xorg-commit mailing list