summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-20 02:20:48 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-20 08:44:14 +0000
commitac52a1fcd11a3ab10e1843ed2d19f9cf818de4c1 (patch)
tree4f0173fc5b3ae4c9bf583f1fa0a52d244494f716
parent4071dca0ef8b2b1605f16bed5c42991885a35efd (diff)
sna: Don't immediately check for region intersection after subtract
In the READ==0 case we know that the region does not intersect damage because we have just subtracted, and checking the intersection causes us to immediately apply the subtraction operation defeating the optimisation and forcing the expensive operation each time. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 833ffd1a..183541d0 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -837,8 +837,6 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
sna_pixmap_free_cpu(sna, priv);
}
}
-
- sna_damage_subtract(&priv->gpu_damage, region);
}
if (priv->mapped) {
@@ -853,6 +851,12 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
if (priv->gpu_bo == NULL)
goto done;
+ if ((flags & MOVE_READ) == 0) {
+ assert(flags == MOVE_WRITE);
+ sna_damage_subtract(&priv->gpu_damage, region);
+ goto done;
+ }
+
if (sna_damage_contains_box(priv->gpu_damage,
REGION_EXTENTS(NULL, region)) != PIXMAN_REGION_OUT) {
DBG(("%s: region (%dx%d) intersects gpu damage\n",
@@ -860,10 +864,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
region->extents.x2 - region->extents.x1,
region->extents.y2 - region->extents.y1));
- if ((flags & MOVE_READ) == 0) {
- assert(flags == MOVE_WRITE);
- sna_damage_subtract(&priv->gpu_damage, region);
- } else if ((flags & MOVE_WRITE) == 0 &&
+ if ((flags & MOVE_WRITE) == 0 &&
region->extents.x2 - region->extents.x1 == 1 &&
region->extents.y2 - region->extents.y1 == 1) {
/* Often associated with synchronisation, KISS */