diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index c9be1b0abcf..42e499a822b 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -874,7 +874,7 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc pdev->info.has_packed_math_16bit || (pdev->info.gfx_level == GFX8 && instance->drirc.expose_float16_gfx8), .shaderInt8 = true, - .descriptorIndexing = true, + .descriptorIndexing = pdev->info.has_vm_always_valid, .shaderInputAttachmentArrayDynamicIndexing = true, .shaderUniformTexelBufferArrayDynamicIndexing = true, .shaderStorageTexelBufferArrayDynamicIndexing = true, @@ -885,14 +885,14 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc .shaderInputAttachmentArrayNonUniformIndexing = true, .shaderUniformTexelBufferArrayNonUniformIndexing = true, .shaderStorageTexelBufferArrayNonUniformIndexing = true, - .descriptorBindingUniformBufferUpdateAfterBind = true, - .descriptorBindingSampledImageUpdateAfterBind = true, - .descriptorBindingStorageImageUpdateAfterBind = true, - .descriptorBindingStorageBufferUpdateAfterBind = true, - .descriptorBindingUniformTexelBufferUpdateAfterBind = true, - .descriptorBindingStorageTexelBufferUpdateAfterBind = true, - .descriptorBindingUpdateUnusedWhilePending = true, - .descriptorBindingPartiallyBound = true, + .descriptorBindingUniformBufferUpdateAfterBind = pdev->info.has_vm_always_valid, + .descriptorBindingSampledImageUpdateAfterBind = pdev->info.has_vm_always_valid, + .descriptorBindingStorageImageUpdateAfterBind = pdev->info.has_vm_always_valid, + .descriptorBindingStorageBufferUpdateAfterBind = pdev->info.has_vm_always_valid, + .descriptorBindingUniformTexelBufferUpdateAfterBind = pdev->info.has_vm_always_valid, + .descriptorBindingStorageTexelBufferUpdateAfterBind = pdev->info.has_vm_always_valid, + .descriptorBindingUpdateUnusedWhilePending = pdev->info.has_vm_always_valid, + .descriptorBindingPartiallyBound = pdev->info.has_vm_always_valid, .descriptorBindingVariableDescriptorCount = true, .runtimeDescriptorArray = true, @@ -904,7 +904,7 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc .separateDepthStencilLayouts = true, .hostQueryReset = true, .timelineSemaphore = pdev->info.has_timeline_syncobj, - .bufferDeviceAddress = true, + .bufferDeviceAddress = pdev->info.has_vm_always_valid, .bufferDeviceAddressCaptureReplay = true, .bufferDeviceAddressMultiDevice = false, .vulkanMemoryModel = true, diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c index 4fc71d2226a..9fcabebb91e 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c @@ -493,13 +493,9 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws, uint64_t size, unsigned request.flags |= AMDGPU_GEM_CREATE_EXPLICIT_SYNC; if ((initial_domain & RADEON_DOMAIN_VRAM_GTT) && (flags & RADEON_FLAG_NO_INTERPROCESS_SHARING) && ((ws->perftest & RADV_PERFTEST_LOCAL_BOS) || (flags & RADEON_FLAG_PREFER_LOCAL_BO))) { - /* virtio needs to be able to create a dmabuf if CPU access is required but a - * dmabuf cannot be created if VM_ALWAYS_VALID is used. - */ - if (!ws->info.is_virtio || (request.flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)) { - bo->base.is_local = true; - request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID; - } + assert(ws->info.has_vm_always_valid); + bo->base.is_local = true; + request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID; } /* Set AMDGPU_GEM_CREATE_VIRTIO_SHARED if the driver didn't disable buffer sharing. */ if (ws->info.is_virtio && (initial_domain & RADEON_DOMAIN_VRAM_GTT) && diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c index 525c2f0bda7..e27eb6dc0c4 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c @@ -211,6 +211,13 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags, ++ws->refcount; } + if (is_virtio && + (perftest_flags & (RADV_PERFTEST_BO_LIST | RADV_PERFTEST_LOCAL_BOS))) { + /* virtio doesn't support VM_ALWAYS_VALID, so disable options that requires it. */ + fprintf(stderr, "localbos and bolist options are not supported values for RADV_PERFTEST with virtio.\n"); + return VK_ERROR_INITIALIZATION_FAILED; + } + if (ws) { simple_mtx_unlock(&winsys_creation_mutex); ac_drm_device_deinitialize(dev);