From ab906aa04548092bdb9dd906e1de5dd2be8eabc3 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 10 Jan 2021 00:23:28 +0000 Subject: 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 --- src/sna/gen7_render.c | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index e572b785..0c19f489 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -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) || - untiled_tlb_miss(dst_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->render_state.gt < 3 && src_bo == dst_bo)) && - can_switch_to_blt(sna, dst_bo, flags)) - return true; - - if (kgem_bo_is_render(dst_bo) || - kgem_bo_is_render(src_bo)) - return false; - - if (flags & COPY_LAST && - sna->render_state.gt < 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 -- cgit v1.2.3