diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-18 14:33:44 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-18 14:45:39 +0100 |
commit | ed40a7c3de3bbb178278c05907e59239712b98b6 (patch) | |
tree | ad52b3bfc1e624debfa2cfe9972ce47a0ad19874 /src/sna/gen6_render.c | |
parent | 4486ae2d829781e32652bce84c08e63ee1960bf0 (diff) |
sna/gen6+: Tweak semaphore avoidance for composite operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen6_render.c')
-rw-r--r-- | src/sna/gen6_render.c | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 200406f5..4829f034 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -1841,9 +1841,9 @@ gen6_composite_set_target(struct sna *sna, } else sna_render_picture_extents(dst, &box); - op->dst.bo = sna_drawable_use_bo (dst->pDrawable, - PREFER_GPU | FORCE_GPU | RENDER_GPU, - &box, &op->damage); + op->dst.bo = sna_drawable_use_bo(dst->pDrawable, + PREFER_GPU | FORCE_GPU | RENDER_GPU, + &box, &op->damage); if (op->dst.bo == NULL) return false; @@ -1896,8 +1896,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; } @@ -1914,6 +1914,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; @@ -2141,17 +2150,18 @@ reuse_source(struct sna *sna, static bool prefer_blt_composite(struct sna *sna, struct sna_composite_op *tmp) { - if (sna->kgem.ring == 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 @@ -2609,11 +2619,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) @@ -3021,10 +3034,16 @@ static inline bool prefer_blt_fill(struct sna *sna, if (PREFER_RENDER) return PREFER_RENDER < 0; + 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 |