summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-13 14:53:50 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-13 15:26:39 +0000
commitd428dbf7ad7c246acb1c301b73b9df4a1309de03 (patch)
treea85da4d17acddd41d12530fe1b6bc7661c8235f4
parent9e7311516da81ab45484b291ec668503c5ded0bb (diff)
downloadxf86-video-intel-d428dbf7ad7c246acb1c301b73b9df4a1309de03.tar.gz
xf86-video-intel-d428dbf7ad7c246acb1c301b73b9df4a1309de03.tar.bz2
xf86-video-intel-d428dbf7ad7c246acb1c301b73b9df4a1309de03.zip
sna/gen2: Program solid mask using the DIFFUSE component
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen2_render.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 825f78c73..d0272bf21 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);
}