summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-26 17:57:57 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-27 09:04:10 +0000
commit507f99eba2c72bc109c9267c698f3d5f9fb6f539 (patch)
treebe7c30982a13bf83a662732234b10a59a465dbf9
parentf11e9f189111f53ace20381a0bd4f559ccd3605f (diff)
sna/gen6+: Only use BLT if the untiled bo will cause per-pixel TLB misses
i.e. only force the BLT if using the sampler is going to be incredibly slow. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen6_render.c11
-rw-r--r--src/sna/gen7_render.c11
2 files changed, 16 insertions, 6 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 6fbf6365..a739f5cc 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2581,13 +2581,18 @@ gen6_emit_copy_state(struct sna *sna,
gen6_emit_state(sna, op, offset);
}
+static inline bool untiled_tlb_miss(struct kgem_bo *bo)
+{
+ return bo->tiling == I915_TILING_NONE && bo->pitch >= 4096;
+}
+
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);
+ return (sna->kgem.ring == KGEM_BLT ||
+ untiled_tlb_miss(src_bo) ||
+ untiled_tlb_miss(dst_bo));
}
static Bool
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 1e614b85..ce14a5d3 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2701,13 +2701,18 @@ gen7_emit_copy_state(struct sna *sna,
gen7_emit_state(sna, op, offset);
}
+static inline bool untiled_tlb_miss(struct kgem_bo *bo)
+{
+ return bo->tiling == I915_TILING_NONE && bo->pitch >= 4096;
+}
+
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);
+ return (sna->kgem.ring == KGEM_BLT ||
+ untiled_tlb_miss(src_bo) ||
+ untiled_tlb_miss(dst_bo));
}
static Bool