diff options
Diffstat (limited to 'src/sna/gen2_render.c')
-rw-r--r-- | src/sna/gen2_render.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index e5e5884a..0775b76c 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -1657,6 +1657,8 @@ gen2_render_composite(struct sna *sna, int16_t width, int16_t height, struct sna_composite_op *tmp) { + bool need_flush; + DBG(("%s()\n", __FUNCTION__)); if (op >= ARRAY_SIZE(gen2_blend_op)) { @@ -1808,8 +1810,10 @@ gen2_render_composite(struct sna *sna, NULL)) kgem_submit(&sna->kgem); + need_flush = + kgem_bo_is_dirty(tmp->src.bo) || kgem_bo_is_dirty(tmp->mask.bo); gen2_emit_composite_state(sna, tmp); - if (kgem_bo_is_dirty(tmp->src.bo) || kgem_bo_is_dirty(tmp->mask.bo)) { + if (need_flush) { if (tmp->src.bo == tmp->dst.bo || tmp->mask.bo == tmp->dst.bo) { kgem_emit_flush(&sna->kgem); } else { @@ -1819,6 +1823,7 @@ gen2_render_composite(struct sna *sna, kgem_clear_dirty(&sna->kgem); } assert(sna->kgem.mode == KGEM_RENDER); + kgem_bo_mark_dirty(tmp->dst.bo); } return TRUE; @@ -2154,6 +2159,8 @@ gen2_render_composite_spans(struct sna *sna, unsigned flags, struct sna_composite_spans_op *tmp) { + bool need_flush; + DBG(("%s(src=(%d, %d), dst=(%d, %d), size=(%d, %d))\n", __FUNCTION__, src_x, src_y, dst_x, dst_y, width, height)); @@ -2229,8 +2236,9 @@ gen2_render_composite_spans(struct sna *sna, NULL)) kgem_submit(&sna->kgem); + need_flush = tmp->base.src.bo; gen2_emit_composite_spans_state(sna, tmp); - if (kgem_bo_is_dirty(tmp->base.src.bo)) { + if (need_flush) { if (tmp->base.src.bo == tmp->base.dst.bo) { kgem_emit_flush(&sna->kgem); } else { @@ -2240,6 +2248,7 @@ gen2_render_composite_spans(struct sna *sna, kgem_clear_dirty(&sna->kgem); } assert(sna->kgem.mode == KGEM_RENDER); + kgem_bo_mark_dirty(tmp->base.dst.bo); } return TRUE; |