diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-11 10:47:13 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-11 10:47:13 +0000 |
commit | c2eb2db83280ae45b8df8a3b6e488b6a1404391a (patch) | |
tree | 3b843d5a32a5ea6e98aead8e2659c40d37bcf4ca /src/sna | |
parent | 696347a6260f3741ad3e6238db0fd285384bb753 (diff) |
sna: Avoid stalling for changing cache levels on an active scanout
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/kgem.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 86a2dfcd..622794c2 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -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); |