summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2021-01-10 00:23:28 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2021-01-10 00:23:28 +0000
commitab906aa04548092bdb9dd906e1de5dd2be8eabc3 (patch)
tree8aeebc8bfba1be7531a18a0265f6de227d25ed00 /src
parenta511f22cdec56504913b457a2e60dafee8e2b570 (diff)
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/gen7_render.c39
1 files 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