diff --git a/.pick_status.json b/.pick_status.json index 2aacf9a8938..cb0eeb0b35a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -193,7 +193,7 @@ "description": "anv: Fix ANV_BO_ALLOC_NO_LOCAL_MEM flag", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "fbd32a04daf84f7ed931a4a2510f2181083753cf" }, diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 53007130001..01844610dcf 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -3754,13 +3754,13 @@ VkResult anv_AllocateMemory( (mem_type->propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) alloc_flags |= ANV_BO_ALLOC_LOCAL_MEM_CPU_VISIBLE; - if (!(mem_type->propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) + if (!mem_heap->is_local_mem) alloc_flags |= ANV_BO_ALLOC_NO_LOCAL_MEM; /* If the allocated buffer might end up in local memory and it's host * visible and uncached, enable CPU write-combining. It should be faster. */ - if (!(alloc_flags & ANV_BO_ALLOC_NO_LOCAL_MEM) && + if (mem_heap->is_local_mem && (mem_type->propertyFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) == 0 && (mem_type->propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) alloc_flags |= ANV_BO_ALLOC_WRITE_COMBINE; diff --git a/src/intel/vulkan/i915/anv_kmd_backend.c b/src/intel/vulkan/i915/anv_kmd_backend.c index 82917a88f4b..a3c26dede4a 100644 --- a/src/intel/vulkan/i915/anv_kmd_backend.c +++ b/src/intel/vulkan/i915/anv_kmd_backend.c @@ -136,6 +136,8 @@ mmap_calc_flags(struct anv_device *device, struct anv_bo *bo, flags |= I915_MMAP_WC; if (bo->map_wc) flags |= I915_MMAP_WC; + if (!(property_flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) + flags |= I915_MMAP_WC; if (likely(device->physical->info.has_mmap_offset)) flags = (flags & I915_MMAP_WC) ? I915_MMAP_OFFSET_WC : I915_MMAP_OFFSET_WB;