summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-06-05 10:18:40 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-06-05 10:36:36 +0100
commit47d7da5a986a9f133cd3dc8314ff243001586a36 (patch)
tree6356f9fe964d33b1585d9ac4d454f354ff5b1117
parent81f09347f2ab59cf0a3eaca7be83ded555655e93 (diff)
sna: Maintain the operation on the CPU if not completely replacing all-damaged
We may as well continue the operation on the CPU if already bound to try to reduce needless migrations (where the cost of the upload will outweigh further use). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_composite.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index 973a6572..85282179 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -790,6 +790,13 @@ sna_composite_rectangles(CARD8 op,
goto fallback;
}
+ if (DAMAGE_IS_ALL(priv->cpu_damage) &&
+ (region.extents.x2 - region.extents.x1 < pixmap->drawable.width ||
+ region.extents.y2 - region.extents.y1 < pixmap->drawable.height)) {
+ DBG(("%s: fallback due to completely damaged CPU\n", __FUNCTION__));
+ 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.