summaryrefslogtreecommitdiff
path: root/src/sna/gen7_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-25 15:24:29 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-25 15:53:29 +0000
commite06789871b5cdf0c5535d46622b8ec3f85eb4386 (patch)
tree6995eb0f14818e6d563b62b395eb2ebb5470593d /src/sna/gen7_render.c
parentd0cce0da71fae275a0f1be33b2bebad9d41212c9 (diff)
sna/gen5+: Prefer using the BLT when either src or dst is untiled
The cost of the TLB miss on every sample far outweighs the impact of the context (and ring) switch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen7_render.c')
-rw-r--r--src/sna/gen7_render.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index efe8bb53..1e614b85 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2701,6 +2701,15 @@ gen7_emit_copy_state(struct sna *sna,
gen7_emit_state(sna, op, offset);
}
+static inline bool prefer_blt_copy(struct sna *sna,
+ struct kgem_bo *src_bo,
+ struct kgem_bo *dst_bo)
+{
+ return (src_bo->tiling == I915_TILING_NONE ||
+ dst_bo->tiling == I915_TILING_NONE ||
+ sna->kgem.ring == KGEM_BLT);
+}
+
static Bool
gen7_render_copy_boxes(struct sna *sna, uint8_t alu,
PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy,
@@ -2724,7 +2733,7 @@ gen7_render_copy_boxes(struct sna *sna, uint8_t alu,
__FUNCTION__, src_dx, src_dy, dst_dx, dst_dy, n, alu,
src_bo == dst_bo));
- if (sna->kgem.ring == KGEM_BLT &&
+ if (prefer_blt_copy(sna, src_bo, dst_bo) &&
sna_blt_compare_depth(&src->drawable, &dst->drawable) &&
sna_blt_copy_boxes(sna, alu,
src_bo, src_dx, src_dy,
@@ -2880,7 +2889,7 @@ gen7_render_copy(struct sna *sna, uint8_t alu,
src->drawable.width, src->drawable.height,
dst->drawable.width, dst->drawable.height));
- if (sna->kgem.ring == KGEM_BLT &&
+ if (prefer_blt_copy(sna, src_bo, dst_bo) &&
sna_blt_compare_depth(&src->drawable, &dst->drawable) &&
sna_blt_copy(sna, alu,
src_bo, dst_bo,