diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-01-31 20:02:44 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-01-31 20:42:51 +0000 |
commit | 1f9a6156e9240a1efa8785ab5bca0a3b1757d08e (patch) | |
tree | 45c6f39613e401aac8d4171b17d38fa3b54f41a1 | |
parent | 539b749416b275d84e05e2a5b62d946903aa3d29 (diff) |
sna: remove short-circuit for move-to-CPU when damage covers region
The short-circuit path missed translating the damage from drawable space
into the pixmap (for Composite setups) which may have resulted in
corruption. The path was also failing to consider the impact of reusing
an active CPU bo when it could be discarding the unwanted damage and
reallocating.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index c9033858..613b9c73 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2424,17 +2424,11 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable, if (flags & MOVE_WRITE) sna_pixmap_free_gpu(sna, priv); - goto contains_damage; - } - - if (priv->cpu && - priv->cpu_damage && - sna_damage_contains_box__no_reduce(priv->cpu_damage, - ®ion->extents)) { - DBG(("%s: pixmap=%ld CPU damage contains region\n", - __FUNCTION__, pixmap->drawable.serialNumber)); + if ((flags & MOVE_READ) == 0 && + priv->cpu_bo && !priv->cpu_bo->flush && + __kgem_bo_is_busy(&sna->kgem, priv->cpu_bo)) + sna_pixmap_free_cpu(sna, priv, false); -contains_damage: sna_pixmap_unmap(pixmap, priv); assert(priv->mapped == MAPPED_NONE); if (pixmap->devPrivate.ptr == NULL && |