sna: Avoid corrupting the CPU bo when compositing fallback data through BLT

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-09-13 20:08:37 +01:00
parent 5781de2e5a
commit 2575cd0d23
1 changed files with 11 additions and 2 deletions

View File

@ -1866,10 +1866,11 @@ clear:
__FUNCTION__));
} else {
ret = prepare_blt_copy(sna, tmp, bo, alpha_fixup);
if (fallback)
ret = prepare_blt_put(sna, tmp, alpha_fixup);
if (fallback && !ret)
goto put;
}
} else {
put:
if (!tmp->dst.bo) {
RegionRec region;
@ -1879,6 +1880,14 @@ clear:
if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region,
MOVE_INPLACE_HINT | MOVE_WRITE))
return false;
} else {
if (tmp->dst.bo == sna_pixmap(tmp->dst.pixmap)->cpu_bo) {
assert(kgem_bo_is_busy(tmp->dst.bo));
tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable,
FORCE_GPU | PREFER_GPU,
&dst_box,
&tmp->damage);
}
}
ret = prepare_blt_put(sna, tmp, alpha_fixup);
}