summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-11 14:22:26 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-11 14:22:26 +0100
commitb41a51e0f54c983ef72bc31125419382d666d48c (patch)
tree2ec2d911758a489a337bc18b5d4e4ec2d4e5ee5e
parentb879de6246d3f2e66e9c7e326db93e5ff390159f (diff)
sna: Tweak self-copy boxes to hit the GPU more often
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index ed53fcc8..65a07e36 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -5443,8 +5443,10 @@ sna_self_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
if (dst != src)
get_drawable_deltas(dst, pixmap, &tx, &ty);
- if (priv == NULL || DAMAGE_IS_ALL(priv->cpu_damage) || priv->shm)
+ if (priv == NULL || DAMAGE_IS_ALL(priv->cpu_damage)) {
+ DBG(("%s: unattached, or all damaged on CPU\n", __FUNCTION__));
goto fallback;
+ }
if (priv->gpu_damage || (priv->cpu_damage == NULL && priv->gpu_bo)) {
assert(priv->gpu_bo);
@@ -5458,6 +5460,7 @@ sna_self_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
__FUNCTION__));
goto fallback;
}
+ assert(priv->cpu_damage == NULL);
if (!sna->render.copy_boxes(sna, alu,
pixmap, priv->gpu_bo, dx, dy,
@@ -5470,7 +5473,7 @@ sna_self_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
if (!DAMAGE_IS_ALL(priv->gpu_damage)) {
assert(!priv->clear);
- if (priv->cpu_bo == NULL) {
+ if (sna_pixmap_free_cpu(sna, priv, false)) {
sna_damage_all(&priv->gpu_damage, pixmap);
} else {
RegionTranslate(region, tx, ty);
@@ -5480,7 +5483,7 @@ sna_self_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
assert_pixmap_damage(pixmap);
} else {
fallback:
- DBG(("%s: fallback", __FUNCTION__));
+ DBG(("%s: fallback\n", __FUNCTION__));
if (!sna_pixmap_move_to_cpu(pixmap, MOVE_READ | MOVE_WRITE))
goto free_boxes;