sna: Stage retirement through the flushing list

If the kernel replies that a bo is still busy, stage its retirement
through the flushing list to be certain that we never stall on a
subsequent write.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-01-31 01:38:01 +00:00
parent 5f5711e62c
commit 033f75e5bd
1 changed files with 14 additions and 8 deletions

View File

@ -396,17 +396,23 @@ static void kgem_bo_retire(struct kgem *kgem, struct kgem_bo *bo)
__FUNCTION__, bo->handle, bo->needs_flush, bo->rq != NULL,
kgem_busy(kgem, bo->handle)));
assert(bo->exec == NULL);
ASSERT_IDLE(kgem, bo->handle);
assert(list_is_empty(&bo->vma));
if (bo->rq) {
kgem_retire(kgem);
bo->rq = NULL;
if (bo->needs_flush)
bo->needs_flush = kgem_busy(kgem, bo->handle);
if (bo->needs_flush) {
list_move(&bo->request, &kgem->flushing);
bo->rq = (void *)kgem;
} else {
bo->rq = NULL;
list_del(&bo->request);
kgem_retire(kgem);
}
} else {
assert(!bo->needs_flush);
ASSERT_IDLE(kgem, bo->handle);
}
assert(list_is_empty(&bo->vma));
list_del(&bo->request);
bo->needs_flush = false;
}
bool kgem_bo_write(struct kgem *kgem, struct kgem_bo *bo,