From f2f9019bae5f6f03b5e23da759d3871fc18dd9f4 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 5 Nov 2013 22:41:06 +0000 Subject: [PATCH] sna: Only operate inplace if no existing CPU damage for a read 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 --- src/sna/sna_accel.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 02b319d7..3176a777 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -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;