summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-09 20:38:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-09 20:38:32 +0100
commitd935912d9c13ec8cf4f641c55846714d4e9ba929 (patch)
tree6e5ee1ea84bcccff2c0b9837df586aeaaec6a08d /src/sna
parentb202008f8f6470f256d3b9000a9f78b6ca8d932b (diff)
sna: Free the source reference after performing a BLT composite
Fixes regression from commit 8751c0f5ad202850bdd56dbb4eedb211c023cf23 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Jul 5 17:55:10 2013 +0100 sna: Flush blt copies if no operations pending Reported-by: Andreas Reis <andreas.reis@gmail.com> Reported-by: Mike Lothian <mike@fireburn.co.uk> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66742 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_blt.c20
1 files changed, 14 insertions, 6 deletions
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;
}