sna: Prevent accessing an uninitialised region in move_area_to_gpu()

If we skip the migration, we need to avoid using the unitialiased
region. There is no bad consequence as both branches of the if are
no-ops, but it does silence the static checkers and should make the
predicate cheaper.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-04-24 15:48:14 +01:00
parent b4871f1dac
commit 8eaafdb439
1 changed files with 2 additions and 1 deletions

View File

@ -2651,7 +2651,8 @@ done:
if (flags & MOVE_WRITE) {
priv->clear = false;
priv->cpu = false;
if (priv->cpu_damage == NULL &&
if (!DAMAGE_IS_ALL(priv->gpu_damage) &&
priv->cpu_damage == NULL &&
box_inplace(pixmap, &r.extents)) {
DBG(("%s: large operation on undamaged, promoting to full GPU\n",
__FUNCTION__));