summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-15 00:15:23 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-15 00:18:42 +0000
commit6abd442279fd32d1ce9b33a72eabbeb922316151 (patch)
tree78fcc20af3e4d0048dd90e95f64ccca15b6ded3c
parentf235c74cd661970c76e152777e9a2c314a368a56 (diff)
sna: Avoid allocating an active CPU bo unnecessarily
If we will not write back the GPU damage to the bo as we intend to overwrite it for the next operation, we can forgo allocating the active CPU bo and skip the synchronisation overhead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 9125f9cd..05626412 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1645,7 +1645,8 @@ skip_inplace_map:
}
if (pixmap->devPrivate.ptr == NULL &&
- !sna_pixmap_alloc_cpu(sna, pixmap, priv, priv->gpu_damage != NULL && !priv->clear))
+ !sna_pixmap_alloc_cpu(sna, pixmap, priv,
+ flags & MOVE_READ ? priv->gpu_damage && !priv->clear : 0))
return false;
if (priv->clear) {
@@ -1985,7 +1986,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
if (pixmap->devPrivate.ptr == NULL &&
!sna_pixmap_alloc_cpu(sna, pixmap, priv,
- priv->gpu_damage && !priv->clear)) {
+ flags & MOVE_READ ? priv->gpu_damage && !priv->clear : 0)) {
if (dx | dy)
RegionTranslate(region, -dx, -dy);
return false;