From 6abd442279fd32d1ce9b33a72eabbeb922316151 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 15 Jan 2013 00:15:23 +0000 Subject: 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 --- src/sna/sna_accel.c | 5 +++-- 1 file 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; -- cgit v1.2.3