diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-19 09:47:02 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-19 09:47:02 +0100 |
commit | b1aab55d594f03e51c3abf1743d00c56ef6d7797 (patch) | |
tree | 7a6c70a6e6592c4fe83dfb8c8b031754c6cd8dfc /src/sna/sna_accel.c | |
parent | f4b930318c68e0e07d677ebc7b4caa27912561db (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.c | 15 |
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, ®ion); if (region_subsumes_pixmap(®ion, 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, ®ion); } } |