diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-17 22:23:02 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-17 22:40:37 +0100 |
commit | d49f53cc00258e3b1e1a898c02e219b336716002 (patch) | |
tree | c5259d1fc665f7b1c0f3d06b494ac06721a3e1e2 | |
parent | 475562d713a00e2f60f7ca067d753fd965d71717 (diff) |
sna: Fix computing source bo for BLT operations
If we migrate the pixmap to the GPU, use the GPU bo. This may fix an issue
where we might end up using the CPU bo in a rare circumstance.
References: https://bugs.freedesktop.org/show_bug.cgi?id=80033
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 51b17feb..61f167a6 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -11828,12 +11828,18 @@ sna_pixmap_get_source_bo(PixmapPtr pixmap) return upload; } - if (priv->gpu_damage && - !sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) - return NULL; - - if (priv->cpu_damage && priv->cpu_bo) - return kgem_bo_reference(priv->cpu_bo); + if (priv->gpu_damage) { + if (sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) + return kgem_bo_reference(priv->gpu_bo); + } else if (priv->cpu_damage) { + if (priv->cpu_bo) + return kgem_bo_reference(priv->cpu_bo); + } else { + if (priv->gpu_bo) + return kgem_bo_reference(priv->gpu_bo); + if (priv->cpu_bo) + return kgem_bo_reference(priv->cpu_bo); + } if (!sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) { struct kgem_bo *upload; |