summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-06 23:21:09 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-06 23:21:09 +0100
commit367298c5109b47fa4961a60fa3cb454c800f02c3 (patch)
treee5ab448019e988ed8a547cbd654959417f15595f
parent62e4266b4dc9b5c3d165aca980738fa777a0f259 (diff)
sna: Subtract the Solid RenderFillRectangles from CPU damage
... and so avoid having to move it the GPU, as seen in the wild. It looks like I will actually need to handle mixed Render/Core operations on the frontbuffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_composite.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index 27b1ff3c..1640309e 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -639,6 +639,16 @@ sna_composite_rectangles(CARD8 op,
goto fallback;
}
+ /* If we going to be overwriting any CPU damage with a subsequent
+ * operation, then we may as well delete it without moving it
+ * first to the GPU.
+ */
+ if (op == PictOpSrc || op == PictOpClear) {
+ priv = sna_pixmap_attach(pixmap);
+ if (priv && !priv->gpu_only)
+ sna_damage_subtract(&priv->cpu_damage, &region);
+ }
+
priv = sna_pixmap_move_to_gpu(pixmap);
if (priv == NULL) {
DBG(("%s: fallback due to no GPU bo\n", __FUNCTION__));