diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-12 08:15:13 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-12 08:18:04 +0000 |
commit | d111c464bfbae57bb7141872810c88b88f30c087 (patch) | |
tree | f3fb5b2dacaf7ba6e444ae88910e3bcf3c112eac /src/sna/gen6_render.c | |
parent | ec77a07b41f1062b941774f3782b51d21e7824dd (diff) |
sna: After a size check, double check the batch before flushing
As we may fail the size check with an empty batch and a pair of large
bo, we need to check before submitting that batch in order to not run
afoul of our internal sanity checks.
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.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index a4b5746f..8b1ae3c6 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -3236,8 +3236,11 @@ gen6_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo, assert(GEN6_VERTEX(tmp.u.gen6.flags) == FILL_VERTEX); if (!kgem_check_bo(&sna->kgem, bo, NULL)) { - _kgem_submit(&sna->kgem); - assert(kgem_check_bo(&sna->kgem, bo, NULL)); + kgem_submit(&sna->kgem); + if (!kgem_check_bo(&sna->kgem, bo, NULL)) { + kgem_bo_destroy(&sna->kgem, tmp.src.bo); + return false; + } } gen6_emit_fill_state(sna, &tmp); @@ -3319,8 +3322,11 @@ gen6_render_clear(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo) assert(GEN6_VERTEX(tmp.u.gen6.flags) == FILL_VERTEX); if (!kgem_check_bo(&sna->kgem, bo, NULL)) { - _kgem_submit(&sna->kgem); - assert(kgem_check_bo(&sna->kgem, bo, NULL)); + kgem_submit(&sna->kgem); + if (!kgem_check_bo(&sna->kgem, bo, NULL)) { + kgem_bo_destroy(&sna->kgem, tmp.src.bo); + return false; + } } gen6_emit_fill_state(sna, &tmp); |