summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Lin <linjoey@google.com>2022-11-30 01:35:42 +0000
committerJoey Lin <linjoey@google.com>2022-11-30 01:35:42 +0000
commitbcfe1d24d7da57a05789b40ac00a260c088e65cf (patch)
tree71daca09438ff6c3f444fe962fd4b4a8722d25fe
parent014047d6f3353765c422bf6a5c096908a76ffc32 (diff)
parent313087763af1c8f0eebbffb52c80ab41e2f7ae48 (diff)
downloadgpu-bcfe1d24d7da57a05789b40ac00a260c088e65cf.tar.gz
Merge "Merge android13-gs-pixel-5.10-tm-qpr1 into android13-gs-pixel-5.10-tm-qpr2" into android13-gs-pixel-5.10-tm-qpr2
-rw-r--r--mali_kbase/mali_kbase_mem_linux.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mali_kbase/mali_kbase_mem_linux.c b/mali_kbase/mali_kbase_mem_linux.c
index c0ee10c..a596f7a 100644
--- a/mali_kbase/mali_kbase_mem_linux.c
+++ b/mali_kbase/mali_kbase_mem_linux.c
@@ -964,6 +964,15 @@ int kbase_mem_flags_change(struct kbase_context *kctx, u64 gpu_addr, unsigned in
if (kbase_is_region_invalid_or_free(reg))
goto out_unlock;
+ /* There is no use case to support MEM_FLAGS_CHANGE ioctl for allocations
+ * that have NO_USER_FREE flag set, to mark them as evictable/reclaimable.
+ * This would usually include JIT allocations, Tiler heap related allocations
+ * & GPU queue ringbuffer and none of them needs to be explicitly marked
+ * as evictable by Userspace.
+ */
+ if (reg->flags & KBASE_REG_NO_USER_FREE)
+ goto out_unlock;
+
/* Is the region being transitioning between not needed and needed? */
prev_needed = (KBASE_REG_DONT_NEED & reg->flags) == KBASE_REG_DONT_NEED;
new_needed = (BASE_MEM_DONT_NEED & flags) == BASE_MEM_DONT_NEED;