package/mesa3d: add amdgpu-virtio config

Add a config section for host native context drivers, which currently
use virtio-gpu as a backend to mediate access to the host kernel's DRM
uAPI.

https://www.collabora.com/news-and-blog/blog/2025/01/15/the-state-of-gfx-virtualization-using-virglrenderer/

Signed-off-by: Joseph Kogut <joseph@anodize.com>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
This commit is contained in:
Joseph Kogut
2026-05-14 14:43:37 -07:00
committed by Romain Naour
parent a24698054b
commit ab1de2ec7f
2 changed files with 25 additions and 0 deletions

View File

@@ -253,6 +253,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
depends on BR2_USE_MMU # libdrm
depends on BR2_i386 || BR2_x86_64
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
select BR2_PACKAGE_LIBDRM_AMDGPU
select BR2_PACKAGE_LIBDRM_RADEON
select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
@@ -345,6 +346,7 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_AMD
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || !BR2_PACKAGE_XORG7 # libxshmfence
select BR2_PACKAGE_LIBDRM_AMDGPU
select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
RADV is a userspace driver that implements the
@@ -419,6 +421,23 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_VIRTIO
help
Vulkan VirtIO (venus) driver.
comment "Host native context drivers"
depends on BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_AMDGPU
bool "amdgpu-virtio"
depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI || \
BR2_PACKAGE_MESA3D_VULKAN_DRIVER_AMD
help
Enable VirtIO support for AMDGPU native contexts
used by the radeonsi (OpenGL) and RADV (Vulkan) drivers.
Select this when running Mesa inside a virtual machine
with virtio-gpu host native context support.
config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
bool
if BR2_PACKAGE_MESA3D_DRIVER
comment "OpenGL API Support"

View File

@@ -151,6 +151,12 @@ ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
MESA3D_DEPENDENCIES += host-python-pycparser
endif
ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_AMDGPU),y)
MESA3D_CONF_OPTS += -Damdgpu-virtio=true
else
MESA3D_CONF_OPTS += -Damdgpu-virtio=false
endif
ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL),y)
MESA3D_DEPENDENCIES += host-python-ply
endif