summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-16 14:16:06 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-16 14:16:06 +0100
commitb707f18d17564653a2b45adf46a4e8eafcc6ab2c (patch)
tree1cf7da5f9ef791a348e498c6dad328364a7a75ea
parent855ced5a4eb67e287001ae22cb6489639c548cfa (diff)
sna: Purge the bo cache only if we detect aperture thrashing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index fd220ab1..4297937a 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -510,7 +510,7 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
if (!bo->deleted && !bo->exec) {
if (!gem_madvise(kgem->fd, bo->handle, I915_MADV_DONTNEED)) {
- kgem->need_purge = 1;
+ kgem->need_purge |= bo->gpu;
goto destroy;
}
@@ -1037,7 +1037,7 @@ search_linear_cache(struct kgem *kgem, int size, bool active)
if (bo->deleted) {
if (!gem_madvise(kgem->fd, bo->handle,
I915_MADV_WILLNEED)) {
- kgem->need_purge = 1;
+ kgem->need_purge |= bo->gpu;
goto next_bo;
}
@@ -1282,7 +1282,7 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
if (bo->deleted) {
if (!gem_madvise(kgem->fd, bo->handle,
I915_MADV_WILLNEED)) {
- kgem->need_purge = 1;
+ kgem->need_purge |= bo->gpu;
gem_close(kgem->fd, bo->handle);
list_del(&bo->request);
free(bo);
@@ -1331,7 +1331,7 @@ skip_active_search:
if (bo->deleted) {
if (!gem_madvise(kgem->fd, bo->handle,
I915_MADV_WILLNEED)) {
- kgem->need_purge = 1;
+ kgem->need_purge |= bo->gpu;
goto next_bo;
}