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>
This commit is contained in:
Chris Wilson 2011-11-26 17:57:57 +00:00
parent f11e9f1891
commit 507f99eba2
2 changed files with 16 additions and 6 deletions

View File

@ -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

View File

@ -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