summaryrefslogtreecommitdiff
path: root/src/sna/gen2_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-16 13:06:58 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-16 13:37:45 +0000
commita11b22d172898ebfc657339a9ca56102ae92592f (patch)
treec5478914f1d95aca2841e8711dcbac81cd4d56a1 /src/sna/gen2_render.c
parent2f09363a6e2c77fb23bf0e4c12c4507521fa631b (diff)
sna/gen[23]: Remark the destination bo as dirty after flushing
One of the side-effects of emitting the composite state is that it tags the destination surface as dirty as a result of the *forthcoming* operation. So emitting the flush after emitting the composite state clears that tag, so we need to restore it for future coherency. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen2_render.c')
-rw-r--r--src/sna/gen2_render.c13
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;