xf86-video-intel: src/sna/gen4_source.c src/sna/gen4_vertex.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Jan 6 07:18:26 PST 2013


 src/sna/gen4_source.c |    2 +-
 src/sna/gen4_vertex.c |   30 +++++++++++++++++++++++++++---
 2 files changed, 28 insertions(+), 4 deletions(-)

New commits:
commit 9051f43fa3c8d011921ac6ff75b763280f26d98f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jan 6 15:20:14 2013 +0000

    sna/gen4+: Handle solids passed to the general texcoord emitter
    
    The general texcoord emitter does handle solids (for the case of a
    transformed mask) and so we need to be careful to setup the
    VERTEX_ELEMENTS accordingly.
    
    Fixes regression from
    commit 2559cfcc4cbc1d0d84b048565cad3bfee61df8da
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Wed Jan 2 10:22:14 2013 +0000
    
        sna/gen4+: Specialise linear vertex emissio
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen4_source.c b/src/sna/gen4_source.c
index 8ea1617..749de8d 100644
--- a/src/sna/gen4_source.c
+++ b/src/sna/gen4_source.c
@@ -44,6 +44,7 @@ gen4_channel_init_solid(struct sna *sna,
 	channel->repeat = RepeatNormal;
 	channel->is_affine = true;
 	channel->is_solid  = true;
+	channel->is_opaque = (color >> 24) == 0xff;
 	channel->transform = NULL;
 	channel->width  = 1;
 	channel->height = 1;
@@ -57,7 +58,6 @@ gen4_channel_init_solid(struct sna *sna,
 	return channel->bo != NULL;
 }
 
-
 bool
 gen4_channel_init_linear(struct sna *sna,
 			 PicturePtr picture,
diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c
index f8becce..9891453 100644
--- a/src/sna/gen4_vertex.c
+++ b/src/sna/gen4_vertex.c
@@ -780,6 +780,7 @@ unsigned gen4_choose_composite_emitter(struct sna_composite_op *tmp)
 				tmp->floats_per_vertex = 5;
 				vb = 2 << 2 | 2;
 			} else {
+				DBG(("%s: projective source, identity mask\n", __FUNCTION__));
 				tmp->prim_emit = emit_primitive_mask;
 				tmp->floats_per_vertex = 6;
 				vb = 2 << 2 | 3;
@@ -787,9 +788,29 @@ unsigned gen4_choose_composite_emitter(struct sna_composite_op *tmp)
 		} else {
 			tmp->prim_emit = emit_primitive_mask;
 			tmp->floats_per_vertex = 1;
-			tmp->floats_per_vertex += 2 + !tmp->mask.is_affine;
-			tmp->floats_per_vertex += 2 + !tmp->src.is_affine;
-			vb = (2 + !tmp->src.is_affine) | (2 + !tmp->mask.is_affine) << 2;
+			vb = 0;
+			if (tmp->mask.is_solid) {
+				tmp->floats_per_vertex += 1;
+				vb |= 1 << 2;
+			} else if (tmp->mask.is_affine) {
+				tmp->floats_per_vertex += 2;
+				vb |= 2 << 2;
+			}else {
+				tmp->floats_per_vertex += 3;
+				vb |= 3 << 2;
+			}
+			if (tmp->src.is_solid) {
+				tmp->floats_per_vertex += 1;
+				vb |= 1;
+			} else if (tmp->src.is_affine) {
+				tmp->floats_per_vertex += 2;
+				vb |= 2 ;
+			}else {
+				tmp->floats_per_vertex += 3;
+				vb |= 3;
+			}
+			DBG(("%s: general mask: floats-per-vertex=%d, vb=%x\n",
+			     __FUNCTION__,tmp->floats_per_vertex, vb));
 		}
 	} else {
 		if (tmp->src.is_solid) {
@@ -800,6 +821,7 @@ unsigned gen4_choose_composite_emitter(struct sna_composite_op *tmp)
 			tmp->floats_per_vertex = 2;
 			vb = 1;
 		} else if (tmp->src.is_linear) {
+			DBG(("%s: linear, no mask\n", __FUNCTION__));
 			tmp->prim_emit = emit_primitive_linear;
 			tmp->floats_per_vertex = 2;
 			vb = 1;
@@ -821,6 +843,8 @@ unsigned gen4_choose_composite_emitter(struct sna_composite_op *tmp)
 			tmp->floats_per_vertex = 3;
 			vb = 2;
 		} else {
+			DBG(("%s: projective src, no mask\n", __FUNCTION__));
+			assert(!tmp->src.is_solid);
 			tmp->prim_emit = emit_primitive;
 			tmp->floats_per_vertex = 4;
 			vb = 3;


More information about the xorg-commit mailing list