summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-15 17:30:00 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-15 17:30:00 +0000
commit475fa67ed320f94df37ec86fe6c5dda886923751 (patch)
tree53c33c565e55cb30f60a021cf6c46132c08f51c7
parent37ced44a53008debaf869ec9ef4ba2e5d6982e76 (diff)
sna: Fast path move-area-to-cpu when the pixmap is already on the cpu
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b9e8caf1..537c4d15 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1020,6 +1020,9 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
return true;
}
+ if (DAMAGE_IS_ALL(priv->cpu_damage))
+ goto out;
+
if (priv->stride == 0 && priv->gpu_bo == NULL && flags & MOVE_WRITE)
return _sna_pixmap_move_to_cpu(pixmap, flags);
@@ -1035,9 +1038,6 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
return _sna_pixmap_move_to_cpu(pixmap, flags);
}
- if (DAMAGE_IS_ALL(priv->cpu_damage))
- goto done;
-
if ((flags & MOVE_READ) == 0) {
assert(flags == MOVE_WRITE);
@@ -1292,11 +1292,6 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
}
done:
- if (priv->cpu_bo) {
- DBG(("%s: syncing cpu bo\n", __FUNCTION__));
- kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo);
- }
-
if (flags & MOVE_WRITE && !DAMAGE_IS_ALL(priv->cpu_damage)) {
DBG(("%s: applying cpu damage\n", __FUNCTION__));
assert_pixmap_contains_box(pixmap, RegionExtents(region));
@@ -1315,6 +1310,11 @@ done:
if (dx | dy)
RegionTranslate(region, -dx, -dy);
+out:
+ if (priv->cpu_bo) {
+ DBG(("%s: syncing cpu bo\n", __FUNCTION__));
+ kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo);
+ }
return true;
}