summaryrefslogtreecommitdiff
path: root/src/sna/gen8_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-03-31 11:58:26 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-03-31 22:32:25 +0100
commit5a872056de61ca8724d5d476783c4dcc8c1a6af7 (patch)
tree23e56de1cdc17236c8f10d32ae5e7c3cdb3e6507 /src/sna/gen8_render.c
parent1be5b715827ef2bbc75ef795c301a1a7ba6e5f09 (diff)
sna/gen6+: Prefer the BLT for small self-copies
Even on GT3, it is preferrential to use the blitter if the copy is small (due to the latency in execution). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen8_render.c')
-rw-r--r--src/sna/gen8_render.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
index b5a4895b..043e268d 100644
--- a/src/sna/gen8_render.c
+++ b/src/sna/gen8_render.c
@@ -2031,6 +2031,11 @@ try_blt(struct sna *sna,
if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, bo, 0))
return true;
+ if (src->pDrawable == dst->pDrawable &&
+ (sna->render_state.gt < 3 || width*height < 1024) &&
+ can_switch_to_blt(sna, bo, 0))
+ return true;
+
if (src->pDrawable) {
struct kgem_bo *s = __sna_drawable_peek_bo(src->pDrawable);
if (s == NULL)
@@ -2711,9 +2716,9 @@ prefer_blt_copy(struct sna *sna,
if (force_blt_ring(sna))
return true;
- if (sna->render_state.gt < 3 &&
- src_bo == dst_bo &&
- can_switch_to_blt(sna, dst_bo, flags))
+ 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) ||