summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-29 07:00:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-29 07:13:48 +0100
commitb961d7323369284ea2c3db47d30c27ffe01a9040 (patch)
tree9dab46e96222f93202e28a06eb8aae5f564a8657
parent53ef9e762a6e7802b3d5f8fba9ac17ff95545c10 (diff)
sna: Sync CPU bo before writes
Fixes regression from commit 961139f5878572ebea268a0bbf47caf05af9093f [2.99.912] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri May 30 09:45:15 2014 +0100 sna: Use manual detiling for downloads Reported-by: Harald Judt <h.judt@gmx.at> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80560 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 7a9610c9..efcde3ee 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1679,14 +1679,22 @@ static inline bool gpu_bo_download(struct sna *sna,
if (!kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, FORCE_FULL_SYNC))
return false;
- if (idle && __kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))
- return false;
+ if (idle) {
+ if (__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))
+ return false;
+
+ if (priv->cpu_bo && __kgem_bo_is_busy(&sna->kgem, priv->cpu_bo))
+ return false;
+ }
src = kgem_bo_map__cpu(&sna->kgem, priv->gpu_bo);
if (src == NULL)
return false;
kgem_bo_sync__cpu_full(&sna->kgem, priv->gpu_bo, FORCE_FULL_SYNC);
+
+ if (priv->cpu_bo)
+ kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo);
assert(has_coherent_ptr(sna, priv, MOVE_WRITE));
if (sigtrap_get())