Skip to contentSkip to conversation

package/mesa3d: add intel-virtio host native context config

PATCH In review Adam Ford 3 participants 4 messages Jul 10 – Aug 16

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/1 package/mesa3d: add intel-virtio host native context config

Add BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL in the same pattern as amdgpu-virtio. When enabled, -Dintel-virtio-experimental=true defines HAVE_INTEL_VIRTIO so the guest-side Intel native context (i915 and xe context types) is compiled in. This is the guest half of the Intel vDRM GPU passthrough path, usable by the crocus/iris (OpenGL) and ANV (Vulkan) drivers.

Note that this is an experimental Mesa feature (the upstream meson option is named intel-virtio-experimental) and is disabled by default.

package/mesa3d/Config.in +19 -0
index e184039150..ad02b5e829 100644
@@ -130,6 +130,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS
 	bool "Gallium crocus driver"
 	depends on BR2_i386 || BR2_x86_64
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+	select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
 	help
 	  Mesa driver for gen4-7 Intel GPUs.
 
@@ -167,6 +168,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS
 	bool "Gallium iris driver"
 	depends on BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+	select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
 	select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
 	select BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
 	help
@@ -393,6 +395,7 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # memfd.h
 	depends on BR2_TOOLCHAIN_USES_GLIBC # ifunc, static_assert
 	depends on BR2_PACKAGE_MESA3D_LLVM
+	select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
 	select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
 	select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
 	help
@@ -459,6 +462,22 @@ config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO
 	  Select this when running Mesa inside a virtual machine
 	  with virtio-gpu host native context support.
 
+config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL
+	bool "intel-virtio"
+	depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS || \
+		BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS || \
+		BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
+	help
+	  Enable VirtIO support for Intel native contexts
+	  used by the crocus/iris (OpenGL) and ANV (Vulkan)
+	  drivers.
+
+	  This is an experimental Mesa feature and is disabled
+	  by default.
+
+	  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
 
package/mesa3d/mesa3d.mk +6 -0
index 8e6c2ee5b8..87377b7ce4 100644
@@ -164,6 +164,12 @@ else
 MESA3D_CONF_OPTS += -Damdgpu-virtio=false
 endif
 
+ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL),y)
+MESA3D_CONF_OPTS += -Dintel-virtio-experimental=true
+else
+MESA3D_CONF_OPTS += -Dintel-virtio-experimental=false
+endif
+
 ifneq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO)$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_FREEDRENO),)
 MESA3D_FREEDRENO_KMDS = msm
 ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO),y)
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#1 lore raw
Quoted 7 lines · Adam Ford

Add BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL in the same pattern as amdgpu-virtio. When enabled, -Dintel-virtio-experimental=true defines HAVE_INTEL_VIRTIO so the guest-side Intel native context (i915 and xe context types) is compiled in. This is the guest half of the Intel vDRM GPU passthrough path, usable by the crocus/iris (OpenGL) and ANV (Vulkan) drivers.

Quoted 6 lines

Note that this is an experimental Mesa feature (the upstream meson option is named intel-virtio-experimental) and is disabled by default.

Gentle nudge on this.

adam

Quoted 69 lines
package/mesa3d/Config.in +3 -0
index e184039150..ad02b5e829 100644
@@ -130,6 +130,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS
        bool "Gallium crocus driver"
        depends on BR2_i386 || BR2_x86_64
        select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+       select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
        help
          Mesa driver for gen4-7 Intel GPUs.
 
@@ -167,6 +168,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS
        bool "Gallium iris driver"
        depends on BR2_PACKAGE_MESA3D_LLVM
        select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+       select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
        select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
        select BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
        help
@@ -393,6 +395,7 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
        depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # memfd.h
        depends on BR2_TOOLCHAIN_USES_GLIBC # ifunc, static_assert
        depends on BR2_PACKAGE_MESA3D_LLVM
+       select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
        select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
        select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
        help
@@ -459,6 +462,22 @@ config

BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO
Select this when running Mesa inside a virtual machine with virtio-gpu host native context support.

package/mesa3d/Config.in +16 -0
+config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL
+       bool "intel-virtio"
+       depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS || \
+               BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS || \
+               BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
+       help
+         Enable VirtIO support for Intel native contexts
+         used by the crocus/iris (OpenGL) and ANV (Vulkan)
+         drivers.
+
+         This is an experimental Mesa feature and is disabled
+         by default.
+
+         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
package/mesa3d/mesa3d.mk +6 -0
index 8e6c2ee5b8..87377b7ce4 100644
@@ -164,6 +164,12 @@ else
 MESA3D_CONF_OPTS += -Damdgpu-virtio=false
 endif
 
+ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL),y)
+MESA3D_CONF_OPTS += -Dintel-virtio-experimental=true
+else
+MESA3D_CONF_OPTS += -Dintel-virtio-experimental=false
+endif
+
 ifneq
 ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO)$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_FREEDRENO),)
 MESA3D_FREEDRENO_KMDS = msm
Quoted 5 lines

ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO),y)
--
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Reviewed-by Romain Naour on v1 1/1
#2 lore raw
In reply to Adam Ford

Hello Adam, All,

Le 10/07/2026 à 15:32, Adam Ford a écrit :

Quoted 68 lines

Add BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL in the same pattern as amdgpu-virtio. When enabled, -Dintel-virtio-experimental=true defines HAVE_INTEL_VIRTIO so the guest-side Intel native context (i915 and xe context types) is compiled in. This is the guest half of the Intel vDRM GPU passthrough path, usable by the crocus/iris (OpenGL) and ANV (Vulkan) drivers.

Note that this is an experimental Mesa feature (the upstream meson option is named intel-virtio-experimental) and is disabled by default.

package/mesa3d/Config.in +19 -0
index e184039150..ad02b5e829 100644
@@ -130,6 +130,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS
 	bool "Gallium crocus driver"
 	depends on BR2_i386 || BR2_x86_64
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+	select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
 	help
 	  Mesa driver for gen4-7 Intel GPUs.
 
@@ -167,6 +168,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS
 	bool "Gallium iris driver"
 	depends on BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+	select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
 	select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
 	select BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
 	help
@@ -393,6 +395,7 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # memfd.h
 	depends on BR2_TOOLCHAIN_USES_GLIBC # ifunc, static_assert
 	depends on BR2_PACKAGE_MESA3D_LLVM
+	select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
 	select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
 	select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
 	help
@@ -459,6 +462,22 @@ config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO
 	  Select this when running Mesa inside a virtual machine
 	  with virtio-gpu host native context support.
 
+config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL
+	bool "intel-virtio"
+	depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS || \
+		BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS || \
+		BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
+	help
+	  Enable VirtIO support for Intel native contexts
+	  used by the crocus/iris (OpenGL) and ANV (Vulkan)
+	  drivers.
+
+	  This is an experimental Mesa feature and is disabled
+	  by default.
+
+	  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
 
package/mesa3d/mesa3d.mk +0 -0
index 8e6c2ee5b8..87377b7ce4 100644

package/mesa3d/mesa3d.mk else · line 172

Quoted 9 lines
package/mesa3d/mesa3d.mk +6 -0
@@ -164,6 +164,12 @@ else
 MESA3D_CONF_OPTS += -Damdgpu-virtio=false
 endif
 
+ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL),y)
+MESA3D_CONF_OPTS += -Dintel-virtio-experimental=true
+else
+MESA3D_CONF_OPTS += -Dintel-virtio-experimental=false
+endif
+

Looks good.

Joseph, since is related to mesa virtio support can you have a look too? Thanks!

Best regards,
Romain

package/mesa3d/mesa3d.mk else · line 175

Quoted 3 lines
package/mesa3d/mesa3d.mk +0 -0
 ifneq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO)$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_FREEDRENO),)
 MESA3D_FREEDRENO_KMDS = msm
 ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO),y)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Reviewed-by on v1 1/1
#3 lore raw
In reply to Adam Ford

Hello Adam,

Thanks for submitting this.

Quoted 8 lines · Adam Ford

Add BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL in the same pattern as amdgpu-virtio. When enabled, -Dintel-virtio-experimental=true defines HAVE_INTEL_VIRTIO so the guest-side Intel native context (i915 and xe context types) is compiled in. This is the guest half of the Intel vDRM GPU passthrough path, usable by the crocus/iris (OpenGL) and ANV (Vulkan) drivers.

As I understand, this currently requires the i915 KMD, and does not support the newer Xe KMD that also supports the Iris/anv UMDs, is that correct? Perhaps we should note that in the Kconfig help, and remove mention of Xe context support, to prevent confusion.

It looks like there's some out-of-tree effort to support Xe contexts, but this is not upstream or pending review as of now. [0]

Quoted 74 lines

Note that this is an experimental Mesa feature (the upstream meson option is named intel-virtio-experimental) and is disabled by default.

package/mesa3d/Config.in +19 -0
index e184039150..ad02b5e829 100644
@@ -130,6 +130,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS
        bool "Gallium crocus driver"
        depends on BR2_i386 || BR2_x86_64
        select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+       select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
        help
          Mesa driver for gen4-7 Intel GPUs.
 
@@ -167,6 +168,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS
        bool "Gallium iris driver"
        depends on BR2_PACKAGE_MESA3D_LLVM
        select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+       select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
        select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
        select BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
        help
@@ -393,6 +395,7 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
        depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # memfd.h
        depends on BR2_TOOLCHAIN_USES_GLIBC # ifunc, static_assert
        depends on BR2_PACKAGE_MESA3D_LLVM
+       select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
        select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
        select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
        help
@@ -459,6 +462,22 @@ config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO
          Select this when running Mesa inside a virtual machine
          with virtio-gpu host native context support.
 
+config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL
+       bool "intel-virtio"
+       depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS || \
+               BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS || \
+               BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
+       help
+         Enable VirtIO support for Intel native contexts
+         used by the crocus/iris (OpenGL) and ANV (Vulkan)
+         drivers.
+
+         This is an experimental Mesa feature and is disabled
+         by default.
+
+         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
 
package/mesa3d/mesa3d.mk +6 -1
index 8e6c2ee5b8..87377b7ce4 100644
@@ -164,6 +164,12 @@ else
 MESA3D_CONF_OPTS += -Damdgpu-virtio=false
 endif
 
+ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_INTEL),y)
+MESA3D_CONF_OPTS += -Dintel-virtio-experimental=true
+else
+MESA3D_CONF_OPTS += -Dintel-virtio-experimental=false
+endif
+
 ifneq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO)$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_FREEDRENO),)
 MESA3D_FREEDRENO_KMDS = msm
 ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO),y)
--
Quoted 2 lines

2.53.0

With the revised help message, you have my

Best
Joseph

[0] https://github.com/cmspam/xe-native-context-enablement
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot