From cbae3052587cddc3a099130dd1550fdb69662db0 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Mon, 18 Jul 2022 22:56:13 -0700 Subject: [PATCH] anv, iris: Make use of devinfo::has_caching_uapi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jordan Justen Reviewed-by: José Roberto de Souza Part-of: --- src/gallium/drivers/iris/iris_bufmgr.c | 4 +++- src/intel/vulkan/anv_allocator.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index 6b2bdbd60b3..c6fc65e437f 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -234,6 +234,7 @@ struct iris_bufmgr { bool has_llc:1; bool has_local_mem:1; bool has_mmap_offset:1; + bool has_caching_uapi:1; bool has_tiling_uapi:1; bool has_userptr_probe:1; bool bo_reuse:1; @@ -1159,7 +1160,7 @@ iris_bo_alloc(struct iris_bufmgr *bufmgr, * For discrete, we instead use SMEM and avoid WB maps for coherency. */ if ((flags & BO_ALLOC_COHERENT) && - !bufmgr->has_llc && bufmgr->vram.size == 0) { + !bufmgr->has_llc && bufmgr->has_caching_uapi) { struct drm_i915_gem_caching arg = { .handle = bo->gem_handle, .caching = 1, @@ -2406,6 +2407,7 @@ iris_bufmgr_create(struct intel_device_info *devinfo, int fd, bool bo_reuse) bufmgr->has_llc = devinfo->has_llc; bufmgr->has_local_mem = devinfo->has_local_mem; + bufmgr->has_caching_uapi = devinfo->has_caching_uapi; bufmgr->has_tiling_uapi = devinfo->has_tiling_uapi; bufmgr->bo_reuse = bo_reuse; bufmgr->has_mmap_offset = devinfo->has_mmap_offset; diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index a83ecf0b3b3..6ffdd7a24ac 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -1527,7 +1527,7 @@ anv_device_alloc_bo(struct anv_device *device, * I915_CACHING_CACHED, which on non-LLC means snooped so there's no * need to do this there. */ - if (!device->info->has_llc) { + if (device->info->has_caching_uapi && !device->info->has_llc) { anv_gem_set_caching(device, new_bo.gem_handle, I915_CACHING_CACHED); }