diff options
Diffstat (limited to 'src/sna/gen7_render.c')
-rw-r--r-- | src/sna/gen7_render.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index 5888a048..cd851f00 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -2130,8 +2130,8 @@ static inline bool untiled_tlb_miss(struct kgem_bo *bo) static int prefer_blt_bo(struct sna *sna, struct kgem_bo *bo) { - if (bo->rq) - return RQ_IS_BLT(bo->rq) ? 1 : -1; + if (RQ_IS_BLT(bo->rq)) + return true; return bo->tiling == I915_TILING_NONE || (bo->scanout && !sna->kgem.has_wt); } @@ -2148,6 +2148,15 @@ try_blt(struct sna *sna, PicturePtr dst, PicturePtr src, int width, int height) { + struct kgem_bo *bo; + + bo = __sna_drawable_peek_bo(dst->pDrawable); + if (bo == NULL) + return true; + + if (bo->rq) + return RQ_IS_BLT(bo->rq); + if (sna->kgem.ring == KGEM_BLT) { DBG(("%s: already performing BLT\n", __FUNCTION__)); return true; @@ -2375,17 +2384,18 @@ reuse_source(struct sna *sna, static bool prefer_blt_composite(struct sna *sna, struct sna_composite_op *tmp) { - if (sna->kgem.mode == KGEM_BLT) - return true; - if (untiled_tlb_miss(tmp->dst.bo) || untiled_tlb_miss(tmp->src.bo)) return true; + if (kgem_bo_is_render(tmp->dst.bo) || + kgem_bo_is_render(tmp->src.bo)) + return false; + if (!prefer_blt_ring(sna, tmp->dst.bo, 0)) return false; - return (prefer_blt_bo(sna, tmp->dst.bo) | prefer_blt_bo(sna, tmp->src.bo)) > 0; + return prefer_blt_bo(sna, tmp->dst.bo) || prefer_blt_bo(sna, tmp->src.bo); } static bool @@ -2819,11 +2829,14 @@ static inline bool prefer_blt_copy(struct sna *sna, untiled_tlb_miss(dst_bo)) return true; + if (kgem_bo_is_render(dst_bo) || + kgem_bo_is_render(src_bo)) + return false; + if (!prefer_blt_ring(sna, dst_bo, flags)) return false; - return (prefer_blt_bo(sna, src_bo) >= 0 && - prefer_blt_bo(sna, dst_bo) > 0); + return prefer_blt_bo(sna, src_bo) || prefer_blt_bo(sna, dst_bo); } inline static void boxes_extents(const BoxRec *box, int n, BoxRec *extents) @@ -3219,10 +3232,16 @@ gen7_emit_fill_state(struct sna *sna, const struct sna_composite_op *op) static inline bool prefer_blt_fill(struct sna *sna, struct kgem_bo *bo) { + if (kgem_bo_is_render(bo)) + return false; + if (untiled_tlb_miss(bo)) return true; - return prefer_blt_ring(sna, bo, 0) || prefer_blt_bo(sna, bo) >= 0; + if (!prefer_blt_ring(sna, bo, 0)) + return false; + + return prefer_blt_bo(sna, bo); } static bool |