Commit ab906aa0 authored by Chris Wilson's avatar Chris Wilson 🤔

sna/gen7: Avoid clear-residuals overhead on all gen7

Since not just Haswell will enjoy clear-residuals, be very careful
before using a potential context switch from DRI clients.
Signed-off-by: Chris Wilson's avatarChris Wilson <>
parent a511f22c
......@@ -2957,45 +2957,10 @@ prefer_blt_copy(struct sna *sna,
struct kgem_bo *dst_bo,
unsigned flags)
if (sna->kgem.mode == KGEM_BLT)
return true;
if (sna->info->gen == 075) /* avoid clear-residuals context overhead */
return true;
assert((flags & COPY_SYNC) == 0);
if (untiled_tlb_miss(src_bo) ||
return true;
if (flags & COPY_DRI && !sna->kgem.has_semaphores)
return false;
if (force_blt_ring(sna, dst_bo, src_bo))
return true;
if ((flags & COPY_SMALL ||
(sna-> < 3 && src_bo == dst_bo)) &&
can_switch_to_blt(sna, dst_bo, flags))
return true;
if (kgem_bo_is_render(dst_bo) ||
return false;
if (flags & COPY_LAST &&
sna-> < 3 &&
can_switch_to_blt(sna, dst_bo, flags))
return true;
if (prefer_render_ring(sna, dst_bo))
return false;
if (!prefer_blt_ring(sna, dst_bo, flags))
if (sna->kgem.ring != KGEM_BLT)
return false;
return prefer_blt_bo(sna, src_bo, dst_bo);
return true; /* avoid clear-residuals context overhead */
static bool
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment