diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-15 00:15:23 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-15 00:18:42 +0000 |
commit | 6abd442279fd32d1ce9b33a72eabbeb922316151 (patch) | |
tree | 78fcc20af3e4d0048dd90e95f64ccca15b6ded3c | |
parent | f235c74cd661970c76e152777e9a2c314a368a56 (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.c | 5 |
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; |