diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-14 14:03:00 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-14 14:20:15 +0000 |
commit | 20832494be06da9ebc4801647521f95e092188fc (patch) | |
tree | e0423333f1a4e5e076e2d1f2d93b077241d25750 | |
parent | 92023f39a9c8897e5a978f44b7970773b118f628 (diff) |
sna: Use userptr downloads for incomplete GPU damaged pixmaps
If the pixmap is not wholly damaged, but still contains the region to be
read, then use userptr (if available).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index ea7dc7a7..dfb160b4 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -13506,8 +13506,16 @@ sna_get_image_blt(DrawablePtr drawable, if (!sna->kgem.has_userptr) return false; - if (!DAMAGE_IS_ALL(priv->gpu_damage) || - !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)) + if (priv->gpu_damage == NULL) + return false; + + assert(priv->gpu_bo); + if (!__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)) + return false; + + if (!DAMAGE_IS_ALL(priv->gpu_damage) && + !sna_damage_contains_box__no_reduce(priv->gpu_damage, + ®ion->extents)) return false; DBG(("%s: download through a temporary map\n", __FUNCTION__)); |