From 2bf36d54ebdfa2a59bf7ef71134b953628ae5d50 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 2 Jul 2014 11:31:54 +0100 Subject: [PATCH] sna/gen6+: Tweak consideration of compositing on BLT Signed-off-by: Chris Wilson --- src/sna/gen6_render.c | 11 +++++++---- src/sna/gen7_render.c | 11 +++++++---- src/sna/gen8_render.c | 9 ++++++--- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index ece8cdb..ab6e296 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -1943,18 +1943,21 @@ try_blt(struct sna *sna, } bo = __sna_drawable_peek_bo(dst->pDrawable); - if (bo && bo->rq) + if (bo == NULL) + return true; + if (bo->rq) return RQ_IS_BLT(bo->rq); - if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, NULL, 0)) + if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, bo, 0)) return true; if (src->pDrawable) { bo = __sna_drawable_peek_bo(src->pDrawable); if (bo == NULL) return true; - else if (bo->rq) - return RQ_IS_BLT(bo->rq); + + if (prefer_blt_bo(sna, bo)) + return true; } if (sna->kgem.ring == KGEM_BLT) { diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index 0a35d95..b1faac4 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -2195,18 +2195,21 @@ try_blt(struct sna *sna, } bo = __sna_drawable_peek_bo(dst->pDrawable); - if (bo && bo->rq) + if (bo == NULL) + return true; + if (bo->rq) return RQ_IS_BLT(bo->rq); - if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, NULL, 0)) + if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, bo, 0)) return true; if (src->pDrawable) { bo = __sna_drawable_peek_bo(src->pDrawable); if (bo == NULL) return true; - else if (bo->rq) - return RQ_IS_BLT(bo->rq); + + if (prefer_blt_bo(sna, bo)) + return true; } if (sna->kgem.ring == KGEM_BLT) { diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c index 392a107..3cdbfd5 100644 --- a/src/sna/gen8_render.c +++ b/src/sna/gen8_render.c @@ -2012,17 +2012,20 @@ try_blt(struct sna *sna, } bo = __sna_drawable_peek_bo(dst->pDrawable); - if (bo && bo->rq) + if (bo == NULL) + return true; + if (bo->rq) return RQ_IS_BLT(bo->rq); - if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, NULL, 0)) + if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, bo, 0)) return true; if (src->pDrawable) { bo = __sna_drawable_peek_bo(src->pDrawable); if (bo == NULL) return true; - else if (bo->rq) + + if (prefer_blt_bo(sna, bo)) return RQ_IS_BLT(bo->rq); } -- 2.7.4