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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-11-05 22:41:06 +00:00
parent 7f901495cd
commit f2f9019bae
1 changed files with 5 additions and 0 deletions

View 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;