From d935912d9c13ec8cf4f641c55846714d4e9ba929 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 9 Jul 2013 20:38:32 +0100 Subject: sna: Free the source reference after performing a BLT composite Fixes regression from commit 8751c0f5ad202850bdd56dbb4eedb211c023cf23 Author: Chris Wilson Date: Fri Jul 5 17:55:10 2013 +0100 sna: Flush blt copies if no operations pending Reported-by: Andreas Reis Reported-by: Mike Lothian Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66742 Signed-off-by: Chris Wilson --- src/sna/sna_blt.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/sna/sna_blt.c') diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index 54cf4f82..796aa63e 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -2301,12 +2301,18 @@ static void convert_done(struct sna *sna, const struct sna_composite_op *op) struct kgem *kgem = &sna->kgem; assert(kgem->nbatch <= KGEM_BATCH_SIZE(kgem)); - if (kgem->nreloc && __kgem_ring_empty(kgem)) { + if (kgem->nreloc && __kgem_ring_empty(kgem)) _kgem_submit(kgem); - return; - } - if (kgem->gen >= 060 && op->src.bo == op->dst.bo && kgem_check_batch(kgem, 3)) { + kgem_bo_destroy(kgem, op->src.bo); + sna_render_composite_redirect_done(sna, op); +} + +static void gen6_convert_done(struct sna *sna, const struct sna_composite_op *op) +{ + struct kgem *kgem = &sna->kgem; + + if (kgem_check_batch(kgem, 3)) { uint32_t *b = kgem->batch + kgem->nbatch; b[0] = XY_SETUP_CLIP; b[1] = b[2] = 0; @@ -2314,8 +2320,7 @@ static void convert_done(struct sna *sna, const struct sna_composite_op *op) assert(kgem->nbatch < kgem->surface); } - kgem_bo_destroy(kgem, op->src.bo); - sna_render_composite_redirect_done(sna, op); + convert_done(sna, op); } bool @@ -2446,6 +2451,9 @@ sna_blt_composite__convert(struct sna *sna, } tmp->done = convert_done; + if (sna->kgem.gen >= 060 && tmp->src.bo == tmp->dst.bo) + tmp->done = gen6_convert_done; + return true; } -- cgit v1.2.3