diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-17 09:26:46 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-17 09:26:46 +0100 |
commit | 4f21dba6ee505217d63edd84611622e05aeb4593 (patch) | |
tree | ce03388ded95fbf4a1e03b6fb715dcb79012cb76 /src/sna/sna_accel.c | |
parent | fbfbbee8288aba1e4754fd2dbc02e71f5e118cda (diff) |
sna: Only drop the clear flag when writing to the GPU pixmap
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 | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index c4a43a19..c4b6abae 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2103,7 +2103,6 @@ sna_pixmap_mark_active(struct sna *sna, struct sna_pixmap *priv) if (!priv->pinned && priv->gpu_bo->proxy == NULL && (priv->create & KGEM_CAN_CREATE_LARGE) == 0) list_move(&priv->inactive, &sna->active_pixmaps); - priv->clear = false; priv->cpu = false; return priv; } @@ -2282,15 +2281,16 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl } done: - if (priv->cpu_damage == NULL && - flags & MOVE_WRITE && - box_inplace(pixmap, box)) { - DBG(("%s: large operation on undamaged, promoting to full GPU\n", - __FUNCTION__)); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); - priv->undamaged = false; + if (flags & MOVE_WRITE) { + priv->clear = false; + if (priv->cpu_damage == NULL && box_inplace(pixmap, box)) { + DBG(("%s: large operation on undamaged, promoting to full GPU\n", + __FUNCTION__)); + sna_damage_all(&priv->gpu_damage, + pixmap->drawable.width, + pixmap->drawable.height); + priv->undamaged = false; + } } assert(!priv->gpu_bo->proxy || (flags & MOVE_WRITE) == 0); @@ -2766,6 +2766,8 @@ done: sna_pixmap_free_cpu(sna, priv); } } + if (flags & MOVE_WRITE) + priv->clear = false; active: assert(!priv->gpu_bo->proxy || (flags & MOVE_WRITE) == 0); return sna_pixmap_mark_active(sna, priv); |