From 2fefee6015ed2df52c8513ae180ca83c01ff83c0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 6 Jan 2012 12:10:27 +0000 Subject: [PATCH] sna/gen6: Reuse current no-blending setup for PictOpClear Signed-off-by: Chris Wilson --- src/sna/gen6_render.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) {