summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_bufmgr.c
diff options
context:
space:
mode:
authorChris Wilson <[email protected]>2018-08-19 10:32:43 +0100
committerKenneth Graunke <[email protected]>2019-02-21 10:26:08 -0800
commit367f6bbd0197f35c5aef44ee4b36db8075722c7e (patch)
tree0a085ffe8884dc9dd50dcc7e15db8667a16f67ea /src/gallium/drivers/iris/iris_bufmgr.c
parentabe7dbfa4a813dcd26c8e7c90ac97539a83242ad (diff)
iris: Record reusability of bo on construction
We know that if the bufmgr->reuse is set to false or if the bo is too large for a bucket, the same will be true when we come to free the bo.
Diffstat (limited to 'src/gallium/drivers/iris/iris_bufmgr.c')
-rw-r--r--src/gallium/drivers/iris/iris_bufmgr.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c
index ab81f2dbb92..e16226910b3 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -614,7 +614,7 @@ retry:
bo->name = name;
p_atomic_set(&bo->refcount, 1);
- bo->reusable = true;
+ bo->reusable = bucket && bufmgr->bo_reuse;
bo->cache_coherent = bufmgr->has_llc;
bo->index = -1;
bo->kflags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS | EXEC_OBJECT_PINNED;
@@ -870,10 +870,11 @@ bo_unreference_final(struct iris_bo *bo, time_t time)
DBG("bo_unreference final: %d (%s)\n", bo->gem_handle, bo->name);
- bucket = bucket_for_size(bufmgr, bo->size);
+ bucket = NULL;
+ if (bo->reusable)
+ bucket = bucket_for_size(bufmgr, bo->size);
/* Put the buffer into our internal cache for reuse if we can. */
- if (bufmgr->bo_reuse && bo->reusable && bucket != NULL &&
- iris_bo_madvise(bo, I915_MADV_DONTNEED)) {
+ if (bucket && iris_bo_madvise(bo, I915_MADV_DONTNEED)) {
bo->free_time = time;
bo->name = NULL;