sna: Only operate inplace if no existing CPU damage for a read
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 5 Nov 2013 22:41:06 +0000 (22:41 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 6 Nov 2013 09:01:17 +0000 (09:01 +0000)
With a large object, we try harder to operate inplace (to avoid creating
a second large CPU bo). This introduced an issue where we tried to read
from the GPU bo when there was already existing damage in the CPU -
triggering an assertion.

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

index 02b319d..3176a77 100644 (file)
@@ -1848,6 +1848,11 @@ static inline bool operate_inplace(struct sna_pixmap *priv, unsigned flags)
                return false;
        }
 
+       if (priv->cpu_damage && flags & MOVE_READ) {
+               DBG(("%s: no, has CPU damage and requires readback\n", __FUNCTION__));
+               return false;
+       }
+
        if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)) {
                DBG(("%s: yes, CPU is busy\n", __FUNCTION__));
                return true;