summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-09 12:27:52 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-09 12:27:52 +0000
commit2699c01a396b644a35a9acb969ab556454be3517 (patch)
treef3ae83165f76380b63af71b31baeaa525798c3d1
parentfcc89d26600a57317007035fa720915e8a2ade81 (diff)
sna: Handle non-reusable bo more correctly during retire
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 22149cef..f303094f 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -681,17 +681,19 @@ bool kgem_retire(struct kgem *kgem)
bo->gpu = bo->needs_flush;
if (bo->refcnt == 0) {
- assert(bo->deleted);
- if (bo->needs_flush) {
- DBG(("%s: moving %d to flushing\n",
- __FUNCTION__, bo->handle));
- list_add(&bo->request, &kgem->flushing);
- } else if (bo->reusable) {
- DBG(("%s: moving %d to inactive\n",
- __FUNCTION__, bo->handle));
- list_move(&bo->list,
- inactive(kgem, bo->size));
- retired = true;
+ if (bo->reusable) {
+ assert(bo->deleted);
+ if (bo->needs_flush) {
+ DBG(("%s: moving %d to flushing\n",
+ __FUNCTION__, bo->handle));
+ list_add(&bo->request, &kgem->flushing);
+ } else {
+ DBG(("%s: moving %d to inactive\n",
+ __FUNCTION__, bo->handle));
+ list_move(&bo->list,
+ inactive(kgem, bo->size));
+ retired = true;
+ }
} else {
DBG(("%s: closing %d\n",
__FUNCTION__, bo->handle));