summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-04-23 11:09:37 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-04-23 11:09:37 +0100
commit8c58c840b1ba579a5601804fc710c58e1e00213f (patch)
tree550636c050bf2e082834bc800a44354e05bd9426
parentcaf9144271a10f90ea580c246b2df3f69a10b7a0 (diff)
sna/dri: Always clear the scanout when destroying dri2 buffers
As we may end up holding onto and releasing the Screen pixmap last, we may also be responsible for flushing the last reference to the scanout. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_dri.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index f4d55e0b..1a7b6bdb 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -333,6 +333,7 @@ static void _sna_dri_destroy_buffer(struct sna *sna, DRI2Buffer2Ptr buffer)
}
private->bo->flush = 0;
+ kgem_bo_clear_scanout(&sna->kgem, private->bo); /* paranoia */
kgem_bo_destroy(&sna->kgem, private->bo);
free(buffer);
@@ -388,6 +389,7 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
sna_damage_destroy(&priv->cpu_damage);
priv->undamaged = false;
+ kgem_bo_clear_scanout(&sna->kgem, priv->gpu_bo); /* paranoia */
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
priv->gpu_bo = ref(bo);
}