From 7bb2c5c4d55560f7901fd8036cab164460f81edc Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 19 Sep 2011 19:12:46 +0100 Subject: [PATCH] sna: Move an assertion to the point of import All the guesswork is so that when we require an inactive bo, we do actually get a buffer that is not currently on a GPU active list. For some unresolved reason, this assertion was firing when putting the buffer onto the inactive list - so just workaround the worrisome issue by delaying the check until use. Signed-off-by: Chris Wilson --- src/sna/kgem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 7df019a4..1e7065da 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -613,7 +613,6 @@ void kgem_retire(struct kgem *kgem) if (bo->needs_flush) { list_add(&bo->request, &kgem->flushing); } else if (bo->reusable) { - assert(!kgem_busy(kgem, bo->handle)); list_move(&bo->list, inactive(kgem, bo->size)); } else { @@ -1507,6 +1506,8 @@ skip_active_search: bo->pitch, bo->tiling, bo->handle, bo->unique_id)); assert(bo->refcnt == 0); assert(bo->reusable); + assert((flags & CREATE_INACTIVE) == 0 || + !kgem_busy(kgem, bo->handle)); return kgem_bo_reference(bo); next_bo: