sna: Reduce assertion when using asynchronous CPU access
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 30 Jun 2014 10:05:33 +0000 (11:05 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 30 Jun 2014 10:05:33 +0000 (11:05 +0100)
If we are not actually accessing the memory through the pointer, we do
not care if it not currently coherent.

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

index fab0637..2f723eb 100644 (file)
@@ -1524,6 +1524,11 @@ static inline bool has_coherent_ptr(struct sna *sna, struct sna_pixmap *priv, un
        if (priv == NULL)
                return true;
 
+       if (flags & MOVE_ASYNC_HINT) {
+               /* Not referencing the pointer itself, so do not care */
+               return true;
+       }
+
        if (!priv->mapped) {
                if (!priv->cpu_bo)
                        return true;
@@ -3065,7 +3070,7 @@ skip:
        assert(pixmap->devPrivate.ptr == PTR(priv->ptr));
        assert(pixmap->devKind);
        assert_pixmap_damage(pixmap);
-       assert(has_coherent_ptr(sna, sna_pixmap(pixmap), flags));
+       assert(has_coherent_ptr(sna, priv, flags));
        return true;
 }