summaryrefslogtreecommitdiff
path: root/src/sna/gen3_render.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sna/gen3_render.c')
-rw-r--r--src/sna/gen3_render.c40
1 files changed, 33 insertions, 7 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index da90d823..784d3998 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -2836,8 +2836,13 @@ gen3_render_composite(struct sna *sna,
if (!kgem_check_bo(&sna->kgem,
tmp->dst.bo, tmp->src.bo, tmp->mask.bo,
- NULL))
+ NULL)) {
kgem_submit(&sna->kgem);
+ if (!kgem_check_bo(&sna->kgem,
+ tmp->dst.bo, tmp->src.bo, tmp->mask.bo,
+ NULL))
+ goto cleanup_mask;
+ }
gen3_emit_composite_state(sna, tmp);
gen3_align_vertex(sna, tmp);
@@ -3267,13 +3272,21 @@ gen3_render_composite_spans(struct sna *sna,
if (!kgem_check_bo(&sna->kgem,
tmp->base.dst.bo, tmp->base.src.bo,
- NULL))
+ NULL)) {
kgem_submit(&sna->kgem);
+ if (!kgem_check_bo(&sna->kgem,
+ tmp->base.dst.bo, tmp->base.src.bo,
+ NULL))
+ goto cleanup_src;
+ }
gen3_emit_composite_state(sna, &tmp->base);
gen3_align_vertex(sna, &tmp->base);
return TRUE;
+cleanup_src:
+ if (tmp->base.src.bo)
+ kgem_bo_destroy(&sna->kgem, tmp->base.src.bo);
cleanup_dst:
if (tmp->base.redirect.real_bo)
kgem_bo_destroy(&sna->kgem, tmp->base.dst.bo);
@@ -3830,14 +3843,19 @@ gen3_render_copy_boxes(struct sna *sna, uint8_t alu,
src_bo->pitch > MAX_3D_PITCH ||
too_large(src->drawable.width, src->drawable.height) ||
dst_bo->pitch > MAX_3D_PITCH ||
- too_large(dst->drawable.width, dst->drawable.height))
+ too_large(dst->drawable.width, dst->drawable.height)) {
+fallback:
return sna_blt_copy_boxes_fallback(sna, alu,
src, src_bo, src_dx, src_dy,
dst, dst_bo, dst_dx, dst_dy,
box, n);
+ }
- if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL))
+ if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
kgem_submit(&sna->kgem);
+ if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL))
+ goto fallback;
+ }
memset(&tmp, 0, sizeof(tmp));
tmp.op = alu == GXcopy ? PictOpSrc : PictOpClear;
@@ -3961,6 +3979,7 @@ gen3_render_copy(struct sna *sna, uint8_t alu,
too_large(src->drawable.width, src->drawable.height) ||
too_large(dst->drawable.width, dst->drawable.height) ||
src_bo->pitch > MAX_3D_PITCH || dst_bo->pitch > MAX_3D_PITCH) {
+fallback:
if (!sna_blt_compare_depth(&src->drawable, &dst->drawable))
return FALSE;
@@ -3984,8 +4003,11 @@ gen3_render_copy(struct sna *sna, uint8_t alu,
tmp->base.mask.bo = NULL;
tmp->base.mask.u.gen3.type = SHADER_NONE;
- if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL))
+ if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
kgem_submit(&sna->kgem);
+ if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL))
+ goto fallback;
+ }
tmp->blt = gen3_render_copy_blt;
tmp->done = gen3_render_copy_done;
@@ -4139,8 +4161,10 @@ gen3_render_fill_boxes(struct sna *sna,
tmp.mask.u.gen3.type = SHADER_NONE;
tmp.u.gen3.num_constants = 0;
- if (!kgem_check_bo(&sna->kgem, dst_bo, NULL))
+ if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
kgem_submit(&sna->kgem);
+ assert(kgem_check_bo(&sna->kgem, dst_bo, NULL));
+ }
gen3_emit_composite_state(sna, &tmp);
gen3_align_vertex(sna, &tmp);
@@ -4293,8 +4317,10 @@ gen3_render_fill(struct sna *sna, uint8_t alu,
tmp->base.mask.u.gen3.type = SHADER_NONE;
tmp->base.u.gen3.num_constants = 0;
- if (!kgem_check_bo(&sna->kgem, dst_bo, NULL))
+ if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
kgem_submit(&sna->kgem);
+ assert(kgem_check_bo(&sna->kgem, dst_bo, NULL));
+ }
tmp->blt = gen3_render_fill_op_blt;
tmp->box = gen3_render_fill_op_box;