diff --git a/src/virtio/vulkan/vn_physical_device.c b/src/virtio/vulkan/vn_physical_device.c index ad9858e9f8d..0acdaf0bcc5 100644 --- a/src/virtio/vulkan/vn_physical_device.c +++ b/src/virtio/vulkan/vn_physical_device.c @@ -778,19 +778,21 @@ vn_physical_device_init_memory_properties( instance, vn_physical_device_to_handle(physical_dev), &physical_dev->memory_properties); - if (!instance->renderer->info.has_cache_management) { - VkPhysicalDeviceMemoryProperties *props = - &physical_dev->memory_properties.memoryProperties; - const uint32_t host_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | - VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + VkPhysicalDeviceMemoryProperties *props = + &physical_dev->memory_properties.memoryProperties; + const uint32_t host_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | + VK_MEMORY_PROPERTY_HOST_CACHED_BIT; - for (uint32_t i = 0; i < props->memoryTypeCount; i++) { - const bool coherent = props->memoryTypes[i].propertyFlags & - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; - if (!coherent) - props->memoryTypes[i].propertyFlags &= ~host_flags; - } + for (uint32_t i = 0; i < props->memoryTypeCount; i++) { + /* Kernel makes every mapping coherent. If a memory type is truly + * incoherent, it's better to remove the host-visible flag than silently + * making it coherent. + */ + const bool coherent = props->memoryTypes[i].propertyFlags & + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + if (!coherent) + props->memoryTypes[i].propertyFlags &= ~host_flags; } } diff --git a/src/virtio/vulkan/vn_renderer.h b/src/virtio/vulkan/vn_renderer.h index b5804838132..63ec3a2748e 100644 --- a/src/virtio/vulkan/vn_renderer.h +++ b/src/virtio/vulkan/vn_renderer.h @@ -62,7 +62,6 @@ struct vn_renderer_info { } pci; bool has_dma_buf_import; - bool has_cache_management; bool has_external_sync; bool has_implicit_fencing; bool has_guest_vram; diff --git a/src/virtio/vulkan/vn_renderer_virtgpu.c b/src/virtio/vulkan/vn_renderer_virtgpu.c index d836f5300e8..3736b925931 100644 --- a/src/virtio/vulkan/vn_renderer_virtgpu.c +++ b/src/virtio/vulkan/vn_renderer_virtgpu.c @@ -1375,10 +1375,6 @@ virtgpu_init_renderer_info(struct virtgpu *gpu) } info->has_dma_buf_import = true; - /* Kernel makes every mapping coherent. We are better off filtering - * incoherent memory types out than silently making them coherent. - */ - info->has_cache_management = false; /* TODO drm_syncobj */ info->has_external_sync = false; diff --git a/src/virtio/vulkan/vn_renderer_vtest.c b/src/virtio/vulkan/vn_renderer_vtest.c index 7203cc923b8..69ed024d486 100644 --- a/src/virtio/vulkan/vn_renderer_vtest.c +++ b/src/virtio/vulkan/vn_renderer_vtest.c @@ -938,7 +938,6 @@ vtest_init_renderer_info(struct vtest *vtest) info->pci.device_id = VTEST_PCI_DEVICE_ID; info->has_dma_buf_import = false; - info->has_cache_management = false; info->has_external_sync = false; info->has_implicit_fencing = false;