summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-12 11:49:32 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-12 11:54:52 +0000
commit0269ec5533ecf7bec0f01c682e085861a3d2ab00 (patch)
treec1129fa6a5c330d6753b948ac3ddbdc4494efb6c
parented68f1b00ae7c0fb3be1f0e758b3683f3c26675b (diff)
sna: Handle incremental uploads from PutImage
PutImage rarely uploads the entire image inside a single request, instead breaking up into scanline segments to fit within the protocol limits. A few optimisations are based on detecting when we can discard the GPU bo for an all-dirty CPU pixmap, which are useful in this case so check for an entirely dirty pixmap following an incremental PutImage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 2dc86ca2..df237071 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1381,9 +1381,16 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
assert_pixmap_contains_box(pixmap, RegionExtents(region));
sna_damage_subtract(&priv->gpu_damage, region);
sna_damage_add(&priv->cpu_damage, region);
- if (priv->flush)
- list_move(&priv->list, &sna->dirty_pixmaps);
+ if (sna_damage_is_all(&priv->cpu_damage,
+ pixmap->drawable.width,
+ pixmap->drawable.height)) {
+ sna_damage_destroy(&priv->gpu_damage);
+ if (priv->gpu_bo && !priv->pinned)
+ sna_pixmap_destroy_gpu_bo(sna, priv);
+ }
}
+ if (priv->flush)
+ list_move(&priv->list, &sna->dirty_pixmaps);
get_drawable_deltas(drawable, pixmap, &dx, &dy);
x += dx + drawable->x;