sna: Fix sync'ing to the most recent request on forced cache cleanup

We picked the oldest, not most recent and so were not recovering as much
memory as desired.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2015-08-07 12:59:57 +01:00
parent 862c0d3cc9
commit d78685787a
1 changed files with 4 additions and 3 deletions

View File

@ -4369,13 +4369,14 @@ bool kgem_cleanup_cache(struct kgem *kgem)
if (!list_is_empty(&kgem->requests[n])) {
struct kgem_request *rq;
rq = list_first_entry(&kgem->requests[n],
struct kgem_request,
list);
rq = list_last_entry(&kgem->requests[n],
struct kgem_request,
list);
DBG(("%s: sync on cleanup\n", __FUNCTION__));
kgem_bo_wait(kgem, rq->bo);
}
assert(list_is_empty(&kgem->requests[n]));
}
kgem_retire(kgem);