From b459ab9eeba4c865f15f0b3e28af318948b4adbd Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 23 Jun 2013 23:00:55 +0100 Subject: [PATCH] sna: Move the reset bo to the right list Signed-off-by: Chris Wilson --- src/sna/kgem.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index b32ceee8..76f393d9 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -2519,9 +2519,18 @@ void kgem_reset(struct kgem *kgem) } else __kgem_bo_clear_busy(bo); - if (!bo->refcnt && !bo->reusable) { - assert(!bo->snoop); - DBG(("%s: discarding handle=%d\n", + if (bo->refcnt || bo->rq) + continue; + + if (bo->snoop) { + kgem_bo_move_to_snoop(kgem, bo); + } else if (bo->scanout) { + kgem_bo_move_to_scanout(kgem, bo); + } else if ((bo = kgem_bo_replace_io(bo))->reusable && + kgem_bo_set_purgeable(kgem, bo)) { + kgem_bo_move_to_inactive(kgem, bo); + } else { + DBG(("%s: closing %d\n", __FUNCTION__, bo->handle)); kgem_bo_free(kgem, bo); }