From 19d1e4ee19a93905d8d2496f856a18eb07bc23d6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 11 Jun 2015 13:43:10 +0100 Subject: [PATCH] sna/dri2: Be wary of interactions with DRI3 and sna_pixmap->flush Since both DRI2 and DRI3 manipulate the sna_pixmap->flush flag, we have to relaxation assertions that it is wholly owned by DRI2. Signed-off-by: Chris Wilson --- src/sna/sna_dri2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 65c781c9..e540066a 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -462,7 +462,7 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna, return NULL; } - assert(priv->flush == false); + assert(priv->flush == false || priv->pinned & PIN_DRI3); assert(priv->cpu_damage == NULL); assert(priv->gpu_bo); assert(priv->gpu_bo->proxy == NULL); @@ -699,7 +699,7 @@ sna_dri2_create_buffer(DrawablePtr draw, pixmap->refcnt++; priv = sna_pixmap(pixmap); - assert(priv->flush == false); + assert(priv->flush == false || priv->pinned & PIN_DRI3); assert((priv->pinned & PIN_DRI2) == 0); /* Don't allow this named buffer to be replaced */ @@ -780,7 +780,8 @@ static void _sna_dri2_destroy_buffer(struct sna *sna, DRI2Buffer2Ptr buffer) priv->gpu_bo->flush = false; priv->pinned &= ~PIN_DRI2; - priv->flush = false; + if ((priv->pinned & PIN_DRI3) == 0) + priv->flush = false; sna_accel_watch_flush(sna, -1); sna_pixmap_set_buffer(pixmap, NULL);