summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-09-26 15:14:29 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-09-27 10:47:17 +0100
commitbbfbe229542cc3278fea3c1865f28d65d3c154e8 (patch)
treee75dc5ff56e082e2a8cdd4717194ec75b618eb5c
parent4d2840919fd00e4ae0bf1957f66009f55a01eb7b (diff)
sna/gen4+: Handle very large copies more gracefully
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen4_render.c10
-rw-r--r--src/sna/gen5_render.c7
-rw-r--r--src/sna/gen6_render.c9
-rw-r--r--src/sna/gen7_render.c14
4 files changed, 24 insertions, 16 deletions
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index b0feb9f7..416452b4 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -2413,8 +2413,12 @@ fallback_blt:
if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
kgem_submit(&sna->kgem);
- if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL))
- goto fallback_tiled_src;
+ if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
+ kgem_bo_destroy(&sna->kgem, tmp.src.bo);
+ if (tmp.redirect.real_bo)
+ kgem_bo_destroy(&sna->kgem, tmp.dst.bo);
+ goto fallback_blt;
+ }
}
dst_dx += tmp.dst.x;
@@ -2440,8 +2444,6 @@ fallback_blt:
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
return true;
-fallback_tiled_src:
- kgem_bo_destroy(&sna->kgem, tmp.src.bo);
fallback_tiled_dst:
if (tmp.redirect.real_bo)
kgem_bo_destroy(&sna->kgem, tmp.dst.bo);
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index c625639b..f6eec6a1 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -2370,7 +2370,10 @@ fallback_blt:
kgem_submit(&sna->kgem);
if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
DBG(("%s: aperture check failed\n", __FUNCTION__));
- goto fallback_tiled_src;
+ kgem_bo_destroy(&sna->kgem, tmp.src.bo);
+ if (tmp.redirect.real_bo)
+ kgem_bo_destroy(&sna->kgem, tmp.dst.bo);
+ goto fallback_blt;
}
}
@@ -2417,8 +2420,6 @@ fallback_blt:
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
return true;
-fallback_tiled_src:
- kgem_bo_destroy(&sna->kgem, tmp.src.bo);
fallback_tiled_dst:
if (tmp.redirect.real_bo)
kgem_bo_destroy(&sna->kgem, tmp.dst.bo);
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index b014e9ec..123bb15c 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2907,7 +2907,11 @@ fallback_blt:
if (!kgem_check_bo(&sna->kgem, tmp.dst.bo, tmp.src.bo, NULL)) {
DBG(("%s: too large for a single operation\n",
__FUNCTION__));
- goto fallback_tiled_src;
+ if (tmp.src.bo != src_bo)
+ kgem_bo_destroy(&sna->kgem, tmp.src.bo);
+ if (tmp.redirect.real_bo)
+ kgem_bo_destroy(&sna->kgem, tmp.dst.bo);
+ goto fallback_blt;
}
_kgem_set_mode(&sna->kgem, KGEM_RENDER);
}
@@ -2950,9 +2954,6 @@ fallback_blt:
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
return true;
-fallback_tiled_src:
- if (tmp.src.bo != src_bo)
- kgem_bo_destroy(&sna->kgem, tmp.src.bo);
fallback_tiled_dst:
if (tmp.redirect.real_bo)
kgem_bo_destroy(&sna->kgem, tmp.dst.bo);
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 1b5e607d..d0cdc795 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -3004,6 +3004,7 @@ gen7_render_copy_boxes(struct sna *sna, uint8_t alu,
if (!(alu == GXcopy || alu == GXclear)) {
fallback_blt:
+ DBG(("%s: fallback blt\n", __FUNCTION__));
if (!sna_blt_compare_depth(&src->drawable, &dst->drawable))
return false;
@@ -3126,8 +3127,13 @@ fallback_blt:
kgem_set_mode(&sna->kgem, KGEM_RENDER, tmp.dst.bo);
if (!kgem_check_bo(&sna->kgem, tmp.dst.bo, tmp.src.bo, NULL)) {
kgem_submit(&sna->kgem);
- if (!kgem_check_bo(&sna->kgem, tmp.dst.bo, tmp.src.bo, NULL))
- goto fallback_tiled_src;
+ if (!kgem_check_bo(&sna->kgem, tmp.dst.bo, tmp.src.bo, NULL)) {
+ if (tmp.src.bo != src_bo)
+ kgem_bo_destroy(&sna->kgem, tmp.src.bo);
+ if (tmp.redirect.real_bo)
+ kgem_bo_destroy(&sna->kgem, tmp.dst.bo);
+ goto fallback_blt;
+ }
_kgem_set_mode(&sna->kgem, KGEM_RENDER);
}
@@ -3169,13 +3175,11 @@ fallback_blt:
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
return true;
-fallback_tiled_src:
- if (tmp.src.bo != src_bo)
- kgem_bo_destroy(&sna->kgem, tmp.src.bo);
fallback_tiled_dst:
if (tmp.redirect.real_bo)
kgem_bo_destroy(&sna->kgem, tmp.dst.bo);
fallback_tiled:
+ DBG(("%s: fallback tiled\n", __FUNCTION__));
if (sna_blt_compare_depth(&src->drawable, &dst->drawable) &&
sna_blt_copy_boxes(sna, alu,
src_bo, src_dx, src_dy,