From 8c58c840b1ba579a5601804fc710c58e1e00213f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 23 Apr 2012 11:09:37 +0100 Subject: 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 --- src/sna/sna_dri.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index f4d55e0b5..1a7b6bdb0 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); } -- cgit v1.2.3