summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-06 12:10:27 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-06 12:10:27 +0000
commit2fefee6015ed2df52c8513ae180ca83c01ff83c0 (patch)
treea01d34624bec370aef87a5a3c1d005b3524a4847
parent800ca0b4d1194544fe2461f91cbdc632c4d3dd7a (diff)
sna/gen6: Reuse current no-blending setup for PictOpClear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen6_render.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index bb0aab1f..d35942c3 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -585,6 +585,17 @@ gen6_emit_cc(struct sna *sna,
if (render->blend == blend)
return false;
+ if (op == PictOpClear) {
+ uint32_t src;
+
+ /* We can emulate a clear using src, which is beneficial if
+ * the blend unit is already disabled.
+ */
+ src = BLEND_OFFSET(GEN6_BLENDFACTOR_ONE, GEN6_BLENDFACTOR_ZERO);
+ if (render->blend == src)
+ return false;
+ }
+
OUT_BATCH(GEN6_3DSTATE_CC_STATE_POINTERS | (4 - 2));
OUT_BATCH((render->cc_blend + blend) | 1);
if (render->blend == (unsigned)-1) {