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>
This commit is contained in:
Chris Wilson 2011-12-18 10:40:35 +00:00
parent 90a432431c
commit 954cf5129d
2 changed files with 27 additions and 1 deletions

View File

@ -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;

View File

@ -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;