diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-18 10:11:49 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-18 10:11:49 +0100 |
commit | 4486ae2d829781e32652bce84c08e63ee1960bf0 (patch) | |
tree | 5d9108989d9a49bbdbe3c897e2fa7fb9cc0ee4f9 | |
parent | f1cbf13bb1ad7432d681ef7cbbc17bcf2d23c554 (diff) |
sna: Do not force use of the CPU bo if replacing a busy GPU bo
To minimise waiting for the SHM pixmap afterwards.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 8409d5ee..1f5a18ea 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4962,7 +4962,7 @@ source_prefer_gpu(struct sna *sna, struct sna_pixmap *priv, static bool use_shm_bo(struct sna *sna, struct kgem_bo *bo, struct sna_pixmap *priv, - int alu) + int alu, bool replaces) { if (priv == NULL || priv->cpu_bo == NULL) { DBG(("%s: no, not attached\n", __FUNCTION__)); @@ -4979,7 +4979,7 @@ static bool use_shm_bo(struct sna *sna, return true; } - if (__kgem_bo_is_busy(&sna->kgem, bo)) { + if (!replaces && __kgem_bo_is_busy(&sna->kgem, bo)) { DBG(("%s: yes, dst is busy\n", __FUNCTION__)); return true; } @@ -5227,7 +5227,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, if (bo != dst_priv->gpu_bo) goto fallback; - if (use_shm_bo(sna, bo, src_priv, alu)) { + if (use_shm_bo(sna, bo, src_priv, alu, replaces)) { bool ret; DBG(("%s: region overlaps CPU damage, copy from CPU bo (shm? %d)\n", |