summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-22 10:36:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-22 12:59:02 +0100
commitcc967507bbf357e1d5ec3cd0f3c0c5ecfa8b867a (patch)
tree92fe9aed60db3c96b0c0779e9d21baaba756e185
parent5aa59ce7c012eb309c4f5a362ccf531c065bd7ff (diff)
sna: Convert to using IGNORE_CPU flag rather than complicating the CPU damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 9731a0a3..5521c833 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4113,6 +4113,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
struct sna *sna = to_sna_from_pixmap(src_pixmap);
struct sna_damage **damage;
struct kgem_bo *bo;
+ unsigned hint;
int16_t src_dx, src_dy;
int16_t dst_dx, dst_dy;
BoxPtr box = RegionRects(region);
@@ -4171,20 +4172,20 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
if (dst_priv == NULL)
goto fallback;
+ hint = source_prefer_gpu(src_priv) ?:
+ region_inplace(sna, dst_pixmap, region,
+ dst_priv, alu_overwrites(alu));
if (dst_priv->cpu_damage && alu_overwrites(alu)) {
DBG(("%s: overwritting CPU damage\n", __FUNCTION__));
- sna_damage_subtract(&dst_priv->cpu_damage, region);
- if (dst_priv->cpu_damage == NULL) {
+ if (region_subsumes_damage(region, dst_priv->cpu_damage)) {
+ DBG(("%s: discarding existing CPU damage\n", __FUNCTION__));
+ sna_damage_destroy(&dst_priv->cpu_damage);
list_del(&dst_priv->list);
- dst_priv->undamaged = false;
- dst_priv->cpu = false;
}
+ hint |= IGNORE_CPU;
}
- bo = sna_drawable_use_bo(&dst_pixmap->drawable,
- source_prefer_gpu(src_priv) ?:
- region_inplace(sna, dst_pixmap, region,
- dst_priv, alu_overwrites(alu)),
+ bo = sna_drawable_use_bo(&dst_pixmap->drawable, hint,
&region->extents, &damage);
if (bo) {
if (src_priv && src_priv->clear) {