radv: detect platform:virtio-mmio devices for virtgpu native context
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

VirtIO devices can be configured as platform devices instead of PCI,
which is especially common in microVM projects like libkrun.

Let's allow RADV to probe MMIO virtgpu devices.

Signed-off-by: Val Packett <val@invisiblethingslab.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37281>
This commit is contained in:
Val Packett 2025-09-10 15:44:41 -03:00 committed by Marge Bot
parent 31a627bdc2
commit 7f556805c1

View file

@ -2508,14 +2508,15 @@ create_drm_physical_device(struct vk_instance *vk_instance, struct _drmDevice *d
#ifndef _WIN32
bool supported_device = false;
if (!(device->available_nodes & (1 << DRM_NODE_RENDER)) || device->bustype != DRM_BUS_PCI)
if (!(device->available_nodes & (1 << DRM_NODE_RENDER)))
return VK_ERROR_INCOMPATIBLE_DRIVER;
#ifdef HAVE_AMDGPU_VIRTIO
supported_device |= device->deviceinfo.pci->vendor_id == VIRTGPU_PCI_VENDOR_ID;
supported_device |= device->bustype == DRM_BUS_PCI && device->deviceinfo.pci->vendor_id == VIRTGPU_PCI_VENDOR_ID;
supported_device |= device->bustype == DRM_BUS_PLATFORM; /* virtio-mmio */
#endif
supported_device |= device->deviceinfo.pci->vendor_id == ATI_VENDOR_ID;
supported_device |= device->bustype == DRM_BUS_PCI && device->deviceinfo.pci->vendor_id == ATI_VENDOR_ID;
if (!supported_device)
return VK_ERROR_INCOMPATIBLE_DRIVER;