xf86-video-intel: 2 commits - src/sna/gen2_render.c src/sna/kgem.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Dec 13 07:58:29 PST 2012


 src/sna/gen2_render.c |   17 ++++++++++++++++-
 src/sna/kgem.c        |    8 ++++----
 2 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit d428dbf7ad7c246acb1c301b73b9df4a1309de03
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Dec 13 14:53:50 2012 +0000

    sna/gen2: Program solid mask using the DIFFUSE component
    
    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 825f78c..d0272bf 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -396,6 +396,15 @@ gen2_get_blend_factors(const struct sna_composite_op *op,
 
 		cblend |= TB0C_OP_MODULATE;
 		ablend |= TB0A_OP_MODULATE;
+	} else if (op->mask.is_solid) {
+		cblend |= TB0C_ARG2_SEL_DIFFUSE;
+		ablend |= TB0A_ARG2_SEL_DIFFUSE;
+
+		if (op->dst.format == PICT_a8 || !op->has_component_alpha)
+			cblend |= TB0C_ARG2_REPLICATE_ALPHA;
+
+		cblend |= TB0C_OP_MODULATE;
+		ablend |= TB0A_OP_MODULATE;
 	} else {
 		cblend |= TB0C_OP_ARG1;
 		ablend |= TB0A_OP_ARG1;
@@ -727,6 +736,12 @@ static void gen2_emit_composite_state(struct sna *sna,
 		else
 			texcoordfmt |= TEXCOORDFMT_3D << (2*tex);
 		gen2_emit_texture(sna, &op->mask, tex++);
+	} else if (op->mask.is_solid) {
+		if (op->mask.u.gen2.pixel != sna->render_state.gen2.diffuse) {
+			BATCH(_3DSTATE_DFLT_DIFFUSE_CMD);
+			BATCH(op->mask.u.gen2.pixel);
+			sna->render_state.gen2.diffuse = op->mask.u.gen2.pixel;
+		}
 	}
 
 	v = _3DSTATE_VERTEX_FORMAT_2_CMD | texcoordfmt;
@@ -1879,7 +1894,7 @@ gen2_render_composite(struct sna *sna,
 		}
 
 		/* convert solid to a texture (pure convenience) */
-		if (tmp->mask.is_solid)
+		if (tmp->mask.is_solid && tmp->src.is_solid)
 			tmp->mask.bo = sna_render_get_solid(sna, tmp->mask.u.gen2.pixel);
 	}
 
commit 9e7311516da81ab45484b291ec668503c5ded0bb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Dec 13 14:40:25 2012 +0000

    sna/gen2: Align surface sizes to an even tile
    
    Makes this 855gm much happier.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index d501115..f8b3cff 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1223,10 +1223,10 @@ static uint32_t kgem_surface_size(struct kgem *kgem,
 		if (tiling) {
 			if (kgem->gen < 030) {
 				tile_width = 128;
-				tile_height = 16;
+				tile_height = 32;
 			} else {
 				tile_width = 512;
-				tile_height =  8;
+				tile_height = 16;
 			}
 		} else {
 			tile_width = 2 * bpp >> 3;
@@ -1292,12 +1292,12 @@ static uint32_t kgem_aligned_height(struct kgem *kgem,
 	uint32_t tile_height;
 
 	if (kgem->gen <= 030) {
-		tile_height = tiling ? kgem->gen < 030 ? 16 : 8 : 1;
+		tile_height = tiling ? kgem->gen < 030 ? 32 : 16 : 1;
 	} else switch (tiling) {
 		/* XXX align to an even tile row */
 	default:
 	case I915_TILING_NONE:
-		tile_height = 2;
+		tile_height = 1;
 		break;
 	case I915_TILING_X:
 		tile_height = 16;


More information about the xorg-commit mailing list