sna: Avoid stalling for changing cache levels on an active scanout

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-02-11 10:47:13 +00:00
parent 696347a626
commit c2eb2db832
1 changed files with 5 additions and 0 deletions

View File

@ -1596,6 +1596,8 @@ inline static void kgem_bo_remove_from_active(struct kgem *kgem,
static void kgem_bo_clear_scanout(struct kgem *kgem, struct kgem_bo *bo)
{
assert(bo->scanout);
assert(!bo->refcnt);
assert(bo->exec == NULL);
assert(bo->proxy == NULL);
DBG(("%s: handle=%d, fb=%d (reusable=%d)\n",
@ -2781,6 +2783,9 @@ bool kgem_expire_cache(struct kgem *kgem)
while (!list_is_empty(&kgem->scanout)) {
bo = list_first_entry(&kgem->scanout, struct kgem_bo, list);
if (__kgem_busy(kgem, bo->handle))
break;
list_del(&bo->list);
kgem_bo_clear_scanout(kgem, bo);
__kgem_bo_destroy(kgem, bo);