summaryrefslogtreecommitdiff
path: root/src/sna/gen6_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-11-22 12:07:06 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-11-22 12:13:30 +0000
commitf0021ab2a66fb7c84758ad482f47f023b862360b (patch)
tree6b8189512694c8927edf7abc16669ab343939b9c /src/sna/gen6_render.c
parent38ef572d68380db407039fe12d62426939030010 (diff)
sna: Tidy up fallback from render composite to blt composite
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen6_render.c')
-rw-r--r--src/sna/gen6_render.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index f03b893e..103b9599 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2143,13 +2143,7 @@ gen6_render_composite(struct sna *sna,
return true;
if (gen6_composite_fallback(sna, src, mask, dst))
- return (mask == NULL &&
- sna_blt_composite(sna, op,
- src, dst,
- src_x, src_y,
- dst_x, dst_y,
- width, height,
- tmp, true));
+ goto fallback;
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
@@ -2165,7 +2159,7 @@ gen6_render_composite(struct sna *sna,
if (!gen6_composite_set_target(sna, tmp, dst,
dst_x, dst_y, width, height,
op > PictOpSrc || dst->pCompositeClip->data))
- return false;
+ goto fallback;
switch (gen6_composite_picture(sna, src, &tmp->src,
src_x, src_y,
@@ -2280,15 +2274,28 @@ gen6_render_composite(struct sna *sna,
return true;
cleanup_mask:
- if (tmp->mask.bo)
+ if (tmp->mask.bo) {
kgem_bo_destroy(&sna->kgem, tmp->mask.bo);
+ tmp->mask.bo = NULL;
+ }
cleanup_src:
- if (tmp->src.bo)
+ if (tmp->src.bo) {
kgem_bo_destroy(&sna->kgem, tmp->src.bo);
+ tmp->src.bo = NULL;
+ }
cleanup_dst:
- if (tmp->redirect.real_bo)
+ if (tmp->redirect.real_bo) {
kgem_bo_destroy(&sna->kgem, tmp->dst.bo);
- return false;
+ tmp->redirect.real_bo = NULL;
+ }
+fallback:
+ return (mask == NULL &&
+ sna_blt_composite(sna, op,
+ src, dst,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height,
+ tmp, true));
}
#if !NO_COMPOSITE_SPANS