From 67f15b36faf8c4aa902d953067df0faf43387208 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 20 Aug 2020 09:18:19 +0100 Subject: sna/gen7: Prefer blitter for plain copies on Haswell Since the clear-residuals security fix on gen7, context switches are very slow. If X is being used with DRI clients, those clients will typically be using the 3D engine for themselves and every frame presented will then be copied by X, causing at least a couple of context switches per frame. That greatly diminishes throughput, but if we prefer to use the blitter engine for X, we can mostly keep off the render engine avoiding the context thrash. Reported-by: Rafael Ristovski Signed-off-by: Chris Wilson --- src/sna/gen7_render.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index f58f39d4..e572b785 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -2960,6 +2960,9 @@ prefer_blt_copy(struct sna *sna, 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) || -- cgit v1.2.3