sna: Check active_scanout flag across TearFree exchange

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2017-06-07 09:28:26 +01:00
parent 8eed38e03a
commit 1fc7841c79
1 changed files with 3 additions and 0 deletions

View File

@ -1885,6 +1885,7 @@ static bool wait_for_shadow(struct sna *sna,
sna_pixmap_unmap(pixmap, priv);
DBG(("%s: setting front pixmap to handle=%d\n", __FUNCTION__, bo->handle));
assert(sna->mode.shadow->active_scanout);
sna->mode.shadow->active_scanout--;
tmp = priv->gpu_bo;
priv->gpu_bo = bo;
@ -1892,6 +1893,7 @@ static bool wait_for_shadow(struct sna *sna,
kgem_bo_destroy(&sna->kgem, sna->mode.shadow);
sna->mode.shadow = tmp;
sna->mode.shadow->active_scanout++;
assert(sna->mode.shadow->active_scanout);
sna_dri2_pixmap_update_bo(sna, pixmap, bo);
@ -1906,6 +1908,7 @@ done:
assert(!sna->mode.shadow_wait);
flush_events(sna);
assert(sna->mode.shadow->active_scanout);
return ret;
}