summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/sna.h3
-rw-r--r--src/sna/sna_accel.c15
2 files changed, 13 insertions, 5 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 9d365439..8564cfc5 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -438,7 +438,8 @@ struct kgem_bo *sna_pixmap_change_tiling(PixmapPtr pixmap, uint32_t tiling);
#define MOVE_INPLACE_HINT 0x4
#define MOVE_ASYNC_HINT 0x8
#define MOVE_SOURCE_HINT 0x10
-#define __MOVE_FORCE 0x20
+#define MOVE_WHOLE_HINT 0x20
+#define __MOVE_FORCE 0x40
bool must_check _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned flags);
static inline bool must_check sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned flags)
{
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 1eae9045..537b2871 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1187,7 +1187,6 @@ skip_inplace_map:
if (priv->cpu_bo && !priv->cpu_bo->sync && kgem_bo_is_busy(priv->cpu_bo))
sna_pixmap_free_cpu(sna, priv);
sna_damage_destroy(&priv->gpu_damage);
- priv->undamaged = true;
}
if (pixmap->devPrivate.ptr == NULL &&
@@ -1466,6 +1465,9 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
goto out;
}
+ if (flags & MOVE_WHOLE_HINT)
+ return _sna_pixmap_move_to_cpu(pixmap, flags);
+
if (priv->gpu_bo == NULL &&
(priv->create & KGEM_CAN_CREATE_GPU) == 0 &&
flags & MOVE_WRITE)
@@ -1872,9 +1874,12 @@ done:
sna_damage_reduce_all(&priv->cpu_damage,
pixmap->drawable.width,
pixmap->drawable.height);
- if (priv->gpu_bo && DAMAGE_IS_ALL(priv->cpu_damage)) {
- DBG(("%s: replaced entire pixmap\n", __FUNCTION__));
- sna_pixmap_free_gpu(sna, priv);
+ if (DAMAGE_IS_ALL(priv->cpu_damage)) {
+ if (priv->gpu_bo) {
+ DBG(("%s: replaced entire pixmap\n",
+ __FUNCTION__));
+ sna_pixmap_free_gpu(sna, priv);
+ }
priv->undamaged = false;
}
if (priv->flush)
@@ -12091,6 +12096,8 @@ sna_get_image(DrawablePtr drawable,
flags = MOVE_READ;
if ((w | h) == 1)
flags |= MOVE_INPLACE_HINT;
+ if (w == drawable->width)
+ flags |= MOVE_WHOLE_HINT;
if (!sna_drawable_move_region_to_cpu(drawable, &region, flags))
return;