sna: Report the move_to_gpu failed if the allocation failed

Do not try and workaround the failure by forcing the wait-for-flip as we
may be inside a vblank handler already. Just report the move failed and
expect the caller to skip the draw, fairly standard practice for
allocation failure handling (stale output rather than crash).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2018-04-03 19:03:01 +01:00
parent af36a4ab78
commit 0a8a852940
1 changed files with 10 additions and 15 deletions

View File

@ -1792,23 +1792,18 @@ static bool wait_for_shadow(struct sna *sna,
pixmap->drawable.bitsPerPixel,
priv->gpu_bo->tiling,
CREATE_EXACT | CREATE_SCANOUT);
if (bo != NULL) {
DBG(("%s: replacing still-attached GPU bo handle=%d, flips=%d\n",
__FUNCTION__, priv->gpu_bo->tiling, sna->mode.flip_active));
if (bo == NULL)
return false;
RegionUninit(&sna->mode.shadow_region);
sna->mode.shadow_region.extents.x1 = 0;
sna->mode.shadow_region.extents.y1 = 0;
sna->mode.shadow_region.extents.x2 = pixmap->drawable.width;
sna->mode.shadow_region.extents.y2 = pixmap->drawable.height;
sna->mode.shadow_region.data = NULL;
} else {
while (sna->mode.flip_active &&
sna_mode_wait_for_event(sna))
sna_mode_wakeup(sna);
DBG(("%s: replacing still-attached GPU bo handle=%d, flips=%d\n",
__FUNCTION__, priv->gpu_bo->tiling, sna->mode.flip_active));
bo = sna->mode.shadow;
}
RegionUninit(&sna->mode.shadow_region);
sna->mode.shadow_region.extents.x1 = 0;
sna->mode.shadow_region.extents.y1 = 0;
sna->mode.shadow_region.extents.x2 = pixmap->drawable.width;
sna->mode.shadow_region.extents.y2 = pixmap->drawable.height;
sna->mode.shadow_region.data = NULL;
}
assert(sna->mode.shadow_wait);
sna->mode.shadow_wait = false;