summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-18 10:40:35 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-18 11:17:35 +0000
commit954cf5129d462f7f4ff5d4ff44b256e0f091667c (patch)
treea9995a61dd38c8c7f7b40925fedeec4512921745
parent90a432431c8fc293db611289c3369669c2975706 (diff)
sna/gen[67]: check for context switch after preparing source
If we used the BLT to prepare the source, see if we can continue the operation on the BLT. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen6_render.c15
-rw-r--r--src/sna/gen7_render.c13
2 files changed, 27 insertions, 1 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 77671a4c..5a83fd09 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2078,7 +2078,7 @@ gen6_composite_set_target(struct sna *sna,
static Bool
try_blt(struct sna *sna,
- PicturePtr dst, PicturePtr src,
+ PicturePtr dst, PicturePtr src,
int width, int height)
{
if (sna->kgem.ring == KGEM_BLT) {
@@ -2295,6 +2295,19 @@ gen6_render_composite(struct sna *sna,
break;
}
+ /* Did we just switch rings to prepare the source? */
+ if (sna->kgem.ring == KGEM_BLT && mask == NULL &&
+ sna_blt_composite(sna, op,
+ src, dst,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height, tmp)) {
+ if (tmp->redirect.real_bo)
+ kgem_bo_destroy(&sna->kgem, tmp->redirect.real_bo);
+ kgem_bo_destroy(&sna->kgem, tmp->src.bo);
+ return TRUE;
+ }
+
tmp->is_affine = tmp->src.is_affine;
tmp->has_component_alpha = FALSE;
tmp->need_magic_ca_pass = FALSE;
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 20945bcc..aeef0ae4 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2408,6 +2408,19 @@ gen7_render_composite(struct sna *sna,
break;
}
+ /* Did we just switch rings to prepare the source? */
+ if (sna->kgem.ring == KGEM_BLT && mask == NULL &&
+ sna_blt_composite(sna, op,
+ src, dst,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height, tmp)) {
+ if (tmp->redirect.real_bo)
+ kgem_bo_destroy(&sna->kgem, tmp->redirect.real_bo);
+ kgem_bo_destroy(&sna->kgem, tmp->src.bo);
+ return TRUE;
+ }
+
tmp->is_affine = tmp->src.is_affine;
tmp->has_component_alpha = FALSE;
tmp->need_magic_ca_pass = FALSE;