From 11e8b299e11ff846e1c8090f7cbd34b2af850d85 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 22 Oct 2013 17:36:58 +0100 Subject: [PATCH] sna: Flush the pending move-to-gpu upon Pixmap free Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 3 +++ src/sna/sna_display.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index f58092e2..497e0d19 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1389,6 +1389,9 @@ static Bool sna_destroy_pixmap(PixmapPtr pixmap) priv->cow = NULL; } + if (priv->move_to_gpu) + (void)priv->move_to_gpu(sna, priv, 0); + /* Always release the gpu bo back to the lower levels of caching */ if (priv->gpu_bo) { sna_pixmap_unmap(pixmap, priv); diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 098eeda2..74231366 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -4285,12 +4285,12 @@ static bool wait_for_shadow(struct sna *sna, struct sna_pixmap *priv, unsigned f assert(wait->bo != priv->gpu_bo); + if (flags == 0 || pixmap != sna->front || !sna->mode.shadow_damage) + goto done; + if ((flags & MOVE_WRITE) == 0) return true; - if (pixmap != sna->front || !sna->mode.shadow_damage) - goto done; - assert(sna->mode.shadow_active); assert(priv->gpu_bo->refcnt >= 1);