summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-19 09:47:02 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-19 09:47:02 +0100
commitb1aab55d594f03e51c3abf1743d00c56ef6d7797 (patch)
tree7a6c70a6e6592c4fe83dfb8c8b031754c6cd8dfc /src/sna/sna_accel.c
parentf4b930318c68e0e07d677ebc7b4caa27912561db (diff)
sna: Always readback shadow damage after replacing the buffer
Instead track what we explicitly want to discard for the next operation, so that we don't have to copy back the whole buffer if we have to replace the shadow and intend to overwrite it all. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r--src/sna/sna_accel.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index f53bddee..77d15df0 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3726,17 +3726,16 @@ use_gpu_bo:
if (flags & IGNORE_CPU) {
region.extents = *box;
region.data = NULL;
+ if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) {
+ region.extents.x1 += dx;
+ region.extents.x2 += dx;
+ region.extents.y1 += dy;
+ region.extents.y2 += dy;
+ }
+ sna_pixmap_discard_shadow_damage(priv, &region);
if (region_subsumes_pixmap(&region, pixmap)) {
DBG(("%s: discarding move-to-gpu READ for subsumed pixmap\n", __FUNCTION__));
hint = MOVE_WRITE;
- } else {
- if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) {
- region.extents.x1 += dx;
- region.extents.x2 += dx;
- region.extents.y1 += dy;
- region.extents.y2 += dy;
- }
- sna_pixmap_discard_shadow_damage(priv, &region);
}
}