sna: Don't discard damage for SHM pixmaps
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 28 Jun 2014 13:22:17 +0000 (14:22 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sun, 29 Jun 2014 05:57:05 +0000 (06:57 +0100)
We don't really want to rendering into SHM pixmaps except for copying
back due to the strict serialisation requirements.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_accel.c

index 2a4c567..3e5b036 100644 (file)
@@ -6126,7 +6126,11 @@ upload_inplace:
 
 static void discard_cpu_damage(struct sna *sna, struct sna_pixmap *priv)
 {
+       if (priv->cpu_damage == NULL && !priv->shm)
+               return;
+
        DBG(("%s: discarding existing CPU damage\n", __FUNCTION__));
+
        if (kgem_bo_discard_cache(priv->gpu_bo, true)) {
                DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
                assert(DAMAGE_IS_ALL(priv->cpu_damage));
@@ -6137,6 +6141,7 @@ static void discard_cpu_damage(struct sna *sna, struct sna_pixmap *priv)
                kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
                priv->gpu_bo = NULL;
        }
+
        sna_damage_destroy(&priv->cpu_damage);
        list_del(&priv->flush_list);