public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 0/5] Add virglrenderer support
@ 2026-03-17 22:16 Joseph Kogut
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 1/5] package/libepoxy: remove gl/egl dependency Joseph Kogut
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Joseph Kogut @ 2026-03-17 22:16 UTC (permalink / raw)
  To: buildroot
  Cc: Adrian Perez de Castro, Eric Le Bihan, Romain Naour, Joseph Kogut,
	Joseph Kogut

Hello,

This patch series adds support for building the virglrenderer library in
buildroot.

Virglrenderer is a userspace library used to support rendering and
compute in virtual machines over virtio-gpu. Virglrenderer supports
serialized API level access to OpenGL and Vulkan through virgl and venus
respectively, as well as mediated DRM level access using host native
context [0]. Notably libkrun [1] and rutabaga_gfx [2] are also capable of
utilizing virglrenderer.

The first patch removes libepoxy's dependency on EGL/GL(X), as it may
have depended on them in the past, but now builds without any EGL/GLX
support. This allows virglrenderer to build with its libepoxy
dependency, without actually depending on EGL/GLX.

This enables, for example, headless compute through Vulkan using Venus
or host native context inside virtual machines.

I'm interested in feedback on this change in particular, as it may have
second order effects on other packages.

The second patch adds the new virglrenderer package. Optional configs
enable VirGL (API-level OpenGL passthrough), Venus (API-level Vulkan
passthrough), hardware accelerated video encode/decode through VA-API,
and DRM driver specific backends for host native context support.

The third patch adds a patch from upstream virglrenderer that fixes a
build issue with glibc 2.43.

The fourth patch adds an OpenGL config for qemu.

The fifth patch adds a qemu virglrenderer config that selects OpenGL
support, as virgl/venus support in qemu currently requires a GL
accelerated display frontend (a patch series on the mailing list [3] is
proposing decoupling display GL support from Venus). Other VMMs
such as libkrun don't suffer from the same coupling currently.

For v4 of the series, I realized enabling DRM backends with the optional
dependency on specific Mesa drivers didn't make sense. Host native
context depends on specific *host kernel* interfaces, and the host may
or may not have Mesa at all.

If the host does have Mesa, and a specific DRM consumer (i.e. a vendor's
gallium/vulkan driver) is enabled, it's reasonable to assume that the
host supports that DRM interface, and we should enable the corresponding
DRM backend. For cases where the guest alone runs mesa (headless
compute), I introduced explicit configs to enable DRM backends.

Tested with llama-bench running with the vulkan backend in a nested VM. 
As seen below, the nested guest is sending commands to the host through
virtio-gpu twice.

        # llama-bench -m llama-2-7b.Q4_0.gguf -ngl 100 
        ggml_vulkan: Found 1 Vulkan devices:
        ggml_vulkan: 0 = Virtio-GPU Venus (Virtio-GPU Venus (AMD Radeon RX 6900 XT (RADV NAVI21))) (venus) | uma: 0 | fp16: 1 | warp size: 64 | shared memory: 65536 | int dot: 1 | matrix cores: none
        | model                          |       size |     params | backend    | ngl |            test |                  t/s |
        | ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
        | llama 7B Q4_0                  |   3.56 GiB |     6.74 B | Vulkan     | 100 |           pp512 |      1220.99 ± 10.12 |
        | llama 7B Q4_0                  |   3.56 GiB |     6.74 B | Vulkan     | 100 |           tg128 |         82.24 ± 1.00 |

        build: unknown (0)

More information about the benchmark and results from other hardware on
the llama.cpp GitHub discussion here [4].

Build tested with several configs, to ensure correct dependencies and
configuration. Not all toolchains build every configuration
successfully, but every configuration has multiple passing builds.
Failures generally are from warnings treated as errors by default. 

-- qemu-virgl-egl --
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_QEMU=y
BR2_PACKAGE_QEMU_SYSTEM=y
BR2_PACKAGE_QEMU_SYSTEM_TCG=y
BR2_PACKAGE_QEMU_VIRGLRENDERER=y

-- qemu-virgl-glx --
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_QEMU=y
BR2_PACKAGE_QEMU_SYSTEM=y
BR2_PACKAGE_QEMU_SYSTEM_TCG=y
BR2_PACKAGE_QEMU_VIRGLRENDERER=y
BR2_PACKAGE_XORG7=y

-- virglrenderer-venus --
BR2_PACKAGE_VIRGLRENDERER=y
BR2_PACKAGE_VIRGLRENDERER_VENUS=y

-- virglrenderer-drm-amdgpu --
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_VULKAN_DRIVER_AMD=y
BR2_PACKAGE_VIRGLRENDERER=y

Feedback welcome.

[0] https://www.collabora.com/news-and-blog/blog/2025/01/15/the-state-of-gfx-virtualization-using-virglrenderer/
[1] https://github.com/containers/libkrun
[2] https://github.com/magma-gpu/rutabaga_gfx
[3] https://lore.kernel.org/qemu-devel/20260317182049.33848-1-lucaaamaral@gmail.com/
[4] https://github.com/ggml-org/llama.cpp/discussions/10879

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
---
Changes in v4:
- Removed libepoxy dependency on GL/EGL
- Introduce explicit configs for virglrenderer DRM backends, virgl
  (see above note)
- Moved virglrenderer Kconfig from Libraries -> Graphics to 'Graphics
  libraries and applications' (next to mesa3d && X.org)
- Add a patch from upstream virglrenderer to fix glibc 2.43 builds
- select libdrm in virglrenderer only when required (drm backends,
  video)
- BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_MSM depends on !BR2_arm
- Explicitly configure GLX and/or EGL when
  BR2_PACKAGE_VIRGLRENDERER_VIRGL=y
- Separate comments for qemu GL/virglrenderer [Romain]
- Split up qemu feature configs into separate commits [Romain]
- Link to v3: https://lore.kernel.org/buildroot/20260219-virglrenderer-v3-0-e2ff1a23be3f@gmail.com/

Changes in v3:
- Bump version to v1.3.0
- Add optional deps for panfrost and i915 native context (new)
- Add config for vaapi support
- Remove GLX in favor of EGL
- Update qemu docs links, as previous ones 404 [Romain]
- Fix invalid config reference in BR2_PACKAGE_QEMU_VIRGLRENDERER
  [Romain]
- Select libepoxy when enabling OpenGL support in qemu [Romain]
- Add depends on gcc >= 4.1 to virglrenderer (from meson.build)
- Add depends on libgbm to virglrenderer [Romain]
- Add comments for missing dependencies to virglrenderer Kconfig
- Select vulkan-headers when venus is enabled [Romain]
- Disable venus explicitly when the symbol isn't selected
- Link to v2: https://lore.kernel.org/buildroot/20251203-virglrenderer-v2-v2-0-2846fc1a579a@gmail.com

Changes in v2:
- Rebase onto next (python-glslang patch merged)
- Bump version to v1.2.0
- Remove hidden configs for virglrenderer vDRM backends [Romain]
- Fixed typo in qemu/Config.in [Romain]
- Split up configs for qemu OpenGL and virglrenderer support [Romain]
- More detailed qemu config help messages
- Link to v1: https://lore.kernel.org/r/20250618-virglrenderer-upstream-v1-0-57525ac8406e@gmail.com

---
Joseph Kogut (5):
      package/libepoxy: remove gl/egl dependency
      package/virglrenderer: new package
      package/virglrenderer: Fix build with glibc 2.43
      package/qemu: add OpenGL config
      package/qemu: add virglrenderer support

 DEVELOPERS                                         |   1 +
 package/Config.in                                  |   1 +
 package/libepoxy/Config.in                         |   4 -
 package/qemu/Config.in                             |  31 +++++++
 package/qemu/qemu.mk                               |  15 ++-
 .../0001-fix-build-with-glibc-2.43.patch           |  39 ++++++++
 package/virglrenderer/Config.in                    | 101 +++++++++++++++++++++
 package/virglrenderer/virglrenderer.hash           |   5 +
 package/virglrenderer/virglrenderer.mk             |  60 ++++++++++++
 9 files changed, 252 insertions(+), 5 deletions(-)
---
base-commit: e555590b94532097c1319b9450ac84fab06b758b
change-id: 20260219-virglrenderer-c4dad969ad89

Best regards,
-- 
Joseph Kogut <joseph.kogut@gmail.com>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v4 1/5] package/libepoxy: remove gl/egl dependency
  2026-03-17 22:16 [Buildroot] [PATCH v4 0/5] Add virglrenderer support Joseph Kogut
@ 2026-03-17 22:16 ` Joseph Kogut
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 2/5] package/virglrenderer: new package Joseph Kogut
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Joseph Kogut @ 2026-03-17 22:16 UTC (permalink / raw)
  To: buildroot
  Cc: Adrian Perez de Castro, Eric Le Bihan, Romain Naour, Joseph Kogut,
	Joseph Kogut

From: Joseph Kogut <joseph@anodize.com>

Libepoxy is a library for handling OpenGL function pointer management.

It has backends for egl/glx, which may at one point have been mandatory
to enable, but the library now builds with none of the above enabled
features, as seen below.

  libepoxy 1.5.10

    User defined options
      Cross files            : /home/joseph/br-test-pkg/arm-aarch64/build/libepoxy-1.5.10//buildroot-build/cross-compilation.conf
      b_pie                  : false
      b_staticpic            : true
      buildtype              : release
      build.cmake_prefix_path: /home/joseph/br-test-pkg/arm-aarch64/host/lib/cmake
      default_library        : shared
      docs                   : false
      egl                    : no
      glx                    : no
      libdir                 : lib
      build.pkg_config_path  : /home/joseph/br-test-pkg/arm-aarch64/host/lib/pkgconfig
      prefix                 : /usr
      strip                  : false
      tests                  : false
      x11                    : false

Removing these dependencies allows for some applications that require it
as a build dependency, but otherwise can run headless or without GL, to
build and function.

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
---
 package/libepoxy/Config.in | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/package/libepoxy/Config.in b/package/libepoxy/Config.in
index 9da190b895..27d2b968d2 100644
--- a/package/libepoxy/Config.in
+++ b/package/libepoxy/Config.in
@@ -1,12 +1,8 @@
 config BR2_PACKAGE_LIBEPOXY
 	bool "libepoxy"
-	depends on BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL
 	select BR2_PACKAGE_XUTIL_UTIL_MACROS
 	help
 	  Epoxy is a library for handling OpenGL function pointer
 	  management for you.
 
 	  https://github.com/anholt/libepoxy
-
-comment "libepoxy needs an OpenGL and/or OpenGL EGL backend"
-	depends on !BR2_PACKAGE_HAS_LIBEGL && !BR2_PACKAGE_HAS_LIBGL

-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v4 2/5] package/virglrenderer: new package
  2026-03-17 22:16 [Buildroot] [PATCH v4 0/5] Add virglrenderer support Joseph Kogut
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 1/5] package/libepoxy: remove gl/egl dependency Joseph Kogut
@ 2026-03-17 22:16 ` Joseph Kogut
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 3/5] package/virglrenderer: Fix build with glibc 2.43 Joseph Kogut
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Joseph Kogut @ 2026-03-17 22:16 UTC (permalink / raw)
  To: buildroot
  Cc: Adrian Perez de Castro, Eric Le Bihan, Romain Naour, Joseph Kogut

Add virglrenderer, an optional dependency of QEMU, which facilitates
acceleration of rendering and optionally video decode through
virtio-gpu.

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
---
 DEVELOPERS                               |   1 +
 package/Config.in                        |   1 +
 package/virglrenderer/Config.in          | 101 +++++++++++++++++++++++++++++++
 package/virglrenderer/virglrenderer.hash |   5 ++
 package/virglrenderer/virglrenderer.mk   |  60 ++++++++++++++++++
 5 files changed, 168 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 88a684d9ac..a34cf57923 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1766,6 +1766,7 @@ F:	package/python-xlib/
 F:	package/sentry-cli/
 F:	package/sentry-native/
 F:	package/unclutter-xfixes/
+F:	package/virglrenderer/
 
 N:	Joshua Henderson <joshua.henderson@microchip.com>
 F:	package/qt5/qt5wayland/
diff --git a/package/Config.in b/package/Config.in
index 371a1c33e1..da54fc2704 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -366,6 +366,7 @@ comment "Graphic libraries"
 	source "package/sdl2_ttf/Config.in"
 	source "package/spirv-headers/Config.in"
 	source "package/tk/Config.in"
+	source "package/virglrenderer/Config.in"
 	source "package/vulkan-headers/Config.in"
 	source "package/vulkan-loader/Config.in"
 	source "package/vulkan-sdk/Config.in"
diff --git a/package/virglrenderer/Config.in b/package/virglrenderer/Config.in
new file mode 100644
index 0000000000..fdf785288b
--- /dev/null
+++ b/package/virglrenderer/Config.in
@@ -0,0 +1,101 @@
+config BR2_PACKAGE_VIRGLRENDERER
+	bool "virglrenderer"
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_LIBEPOXY
+	help
+	  A library for accelerated graphics and compute in
+	  virtualized guests.
+
+	  https://qemu.readthedocs.io/en/v10.0.3/system/devices/virtio-gpu.html#virtio-gpu-virglrenderer
+
+if BR2_PACKAGE_VIRGLRENDERER
+config BR2_PACKAGE_VIRGLRENDERER_VIRGL
+	bool "virgl"
+	default y
+	depends on (BR2_PACKAGE_HAS_LIBEGL && BR2_PACKAGE_HAS_LIBGBM) \
+		|| BR2_PACKAGE_HAS_LIBGL
+	help
+	  Enable API-level OpenGL acceleration over virtio-gpu.
+
+	  Say 'y' if you want to run applications with OpenGL
+	  acceleration in virtualized guests. Requires host
+	  support for OpenGL.
+
+	  https://docs.mesa3d.org/drivers/virgl.html
+
+comment "virgl needs OpenGL or OpenGL EGL and libgbm"
+	depends on !((BR2_PACKAGE_HAS_LIBEGL && BR2_PACKAGE_HAS_LIBGBM) \
+		|| BR2_PACKAGE_HAS_LIBGL) \
+
+config BR2_PACKAGE_VIRGLRENDERER_VENUS
+	bool "venus"
+	default y if BR2_PACKAGE_MESA3D_VULKAN_DRIVER
+	depends on BR2_INSTALL_LIBSTDCPP # vulkan-loader
+	depends on !BR2_STATIC_LIBS # vulkan-loader
+	depends on BR2_TOOLCHAIN_HAS_THREADS # vulkan-loader
+	select BR2_PACKAGE_VULKAN_HEADERS
+	select BR2_PACKAGE_VULKAN_LOADER
+	help
+	  Enable API-level Vulkan acceleration over virtio-gpu.
+
+	  Say 'y' if you want to run applications with Vulkan
+	  acceleration in virtualized guests. Requires host
+	  support for Vulkan.
+
+	  https://docs.mesa3d.org/drivers/venus.html
+
+config BR2_PACKAGE_VIRGLRENDERER_VAAPI
+	bool "vaapi support"
+	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_LIBVA
+	help
+	  Enable hardware accelerated video encode/decode through
+	  libva over virtio-gpu.
+
+comment "DRM backends"
+
+config BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_AMDGPU
+	bool "amdgpu"
+	default y if BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
+	default y if BR2_PACKAGE_MESA3D_VULKAN_DRIVER_AMD
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_LIBDRM_AMDGPU
+	help
+	  Enable DRM backend for amdgpu, used by Gallium radeonsi
+	  and RADV vulkan drivers.
+
+config BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_INTEL
+	bool "intel"
+	default y if BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_I915
+	default y if BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS
+	default y if BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
+	select BR2_PACKAGE_LIBDRM
+	help
+	  Enable DRM backend for i915, used by Gallium i915/Iris
+	  and Intel vulkan drivers.
+
+config BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_MSM
+	bool "msm"
+	default y if BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO
+	depends on !BR2_arm
+	select BR2_PACKAGE_LIBDRM
+	help
+	  Enable DRM backend for msm, used by Gallium freedreno
+	  driver.
+
+config BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_PANFROST
+	bool "panfrost"
+	default y if BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST
+	default y if BR2_PACKAGE_MESA3D_VULKAN_DRIVER_PANFROST
+	select BR2_PACKAGE_LIBDRM
+	help
+	  Enable DRM backend for Panfrost, used by the panfrost
+	  Gallium/vulkan drivers.
+
+endif
+
+comment "virglrenderer needs a toolchain w/ gcc >= 4.9"
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
diff --git a/package/virglrenderer/virglrenderer.hash b/package/virglrenderer/virglrenderer.hash
new file mode 100644
index 0000000000..03da595091
--- /dev/null
+++ b/package/virglrenderer/virglrenderer.hash
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  065bc56e89e6f631f96101cd62eba0748e48eb888b434edc86e89d05395e76f3  virglrenderer-1.3.0.tar.gz
+
+# License
+sha256  3b32caf16e2402c2aff2b716858713f3e1feded85c25e71bf829816ee5009402  COPYING
diff --git a/package/virglrenderer/virglrenderer.mk b/package/virglrenderer/virglrenderer.mk
new file mode 100644
index 0000000000..4e7bcbb849
--- /dev/null
+++ b/package/virglrenderer/virglrenderer.mk
@@ -0,0 +1,60 @@
+################################################################################
+#
+# virglrenderer
+#
+################################################################################
+
+VIRGLRENDERER_VERSION = 1.3.0
+VIRGLRENDERER_SITE = https://gitlab.freedesktop.org/virgl/virglrenderer/-/archive/$(VIRGLRENDERER_VERSION)
+VIRGLRENDERER_LICENSE = MIT
+VIRGLRENDERER_LICENSE_FILES = COPYING
+VIRGLRENDERER_INSTALL_STAGING = YES
+VIRGLRENDERER_DEPENDENCIES = \
+	libepoxy \
+	host-pkgconf \
+	host-python3 \
+	host-python-pyyaml
+VIRGLRENDERER_CPE_ID_VALID = YES
+
+ifeq ($(BR2_PACKAGE_VIRGLRENDERER_VIRGL),y)
+ifeq ($(BR2_PACKAGE_HAS_LIBEGL)$(BR2_PACKAGE_HAS_LIBGBM),yy)
+VIRGLRENDERER_PLATFORMS += egl
+VIRGLRENDERER_DEPENDENCIES += libegl \
+			      libgbm
+endif
+
+ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
+VIRGLRENDERER_PLATFORMS += glx
+VIRGLRENDERER_DEPENDENCIES += libgl
+endif
+endif # BR2_PACKAGE_VIRGLRENDERER_VIRGL
+
+VIRGLRENDERER_CONF_OPTS += -Dplatforms=$(subst $(space),$(comma),$(VIRGLRENDERER_PLATFORMS))
+
+ifeq ($(BR2_PACKAGE_VIRGLRENDERER_VENUS),y)
+VIRGLRENDERER_CONF_OPTS += -Dvenus=true
+VIRGLRENDERER_DEPENDENCIES += vulkan-headers \
+			      vulkan-loader
+else
+VIRGLRENDERER_CONF_OPTS += -Dvenus=false
+endif
+
+VIRGLRENDERER_DRM_BACKENDS-$(BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_AMDGPU) += amdgpu-experimental
+VIRGLRENDERER_DRM_BACKENDS-$(BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_INTEL) += i915-experimental
+VIRGLRENDERER_DRM_BACKENDS-$(BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_MSM) += msm
+VIRGLRENDERER_DRM_BACKENDS-$(BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_PANFROST) += panfrost-experimental
+
+VIRGLRENDERER_CONF_OPTS += -Ddrm-renderers=$(subst $(space),$(comma),$(VIRGLRENDERER_DRM_BACKENDS-y))
+
+ifneq ($(VIRGLRENDERER_DRM_BACKENDS-y),)
+VIRGLRENDERER_DEPENDENCIES += libdrm
+endif
+
+ifeq ($(BR2_PACKAGE_VIRGLRENDERER_VAAPI),y)
+VIRGLRENDERER_CONF_OPTS += -Dvideo=true
+VIRGLRENDERER_DEPENDENCIES += libva libdrm
+else
+VIRGLRENDERER_CONF_OPTS += -Dvideo=false
+endif
+
+$(eval $(meson-package))

-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v4 3/5] package/virglrenderer: Fix build with glibc 2.43
  2026-03-17 22:16 [Buildroot] [PATCH v4 0/5] Add virglrenderer support Joseph Kogut
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 1/5] package/libepoxy: remove gl/egl dependency Joseph Kogut
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 2/5] package/virglrenderer: new package Joseph Kogut
@ 2026-03-17 22:16 ` Joseph Kogut
  2026-03-18 19:07   ` Joseph Kogut
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 4/5] package/qemu: add OpenGL config Joseph Kogut
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 5/5] package/qemu: add virglrenderer support Joseph Kogut
  4 siblings, 1 reply; 7+ messages in thread
From: Joseph Kogut @ 2026-03-17 22:16 UTC (permalink / raw)
  To: buildroot
  Cc: Adrian Perez de Castro, Eric Le Bihan, Romain Naour, Joseph Kogut,
	Joseph Kogut

From: Joseph Kogut <joseph@anodize.com>

Add an upstream patch to fix the build with glibc 2.43, not present in a
stable release yet.
---
 .../0001-fix-build-with-glibc-2.43.patch           | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/package/virglrenderer/0001-fix-build-with-glibc-2.43.patch b/package/virglrenderer/0001-fix-build-with-glibc-2.43.patch
new file mode 100644
index 0000000000..fda1d9b218
--- /dev/null
+++ b/package/virglrenderer/0001-fix-build-with-glibc-2.43.patch
@@ -0,0 +1,39 @@
+From 986b5fc57b07c06b5e0b3a3694d06898ebc80163 Mon Sep 17 00:00:00 2001
+From: Maximilian Hofmann <maxi@maxiicodes.dev>
+Date: Thu, 26 Feb 2026 23:28:58 +0100
+Subject: [PATCH] fix: build with glibc 2.43
+
+Several glibc functions now return a const pointer if the input is a
+const pointer and a non-const pointer if the input is non-const, causing
+a build failure.
+
+Fix this by declaring the output pointers as const if they are never
+modified, and for the lone failure where the output is modified, instead
+make the input non-const.
+
+Signed-off-by: Maximilian Hofmann <maxi@maxiicodes.dev>
+Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1599>
+
+Upstream: https://gitlab.freedesktop.org/virgl/virglrenderer/-/commit/986b5fc57b07c06b5e0b3a3694d06898ebc80163
+
+Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
+---
+ src/gallium/auxiliary/tgsi/tgsi_text.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
+index db7d7b95..7e37bf79 100644
+--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
++++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
+@@ -84,7 +84,7 @@ streq_nocase_uprcase(const char *str1,
+ static inline bool skip_n_chars(const char **pcur,
+                                    int n)
+ {
+-   char* str = memchr(*pcur, '\0', n);
++   const char* str = memchr(*pcur, '\0', n);
+    if (unlikely(str)) {
+       *pcur = str;
+       return false;
+-- 
+2.53.0
+

-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v4 4/5] package/qemu: add OpenGL config
  2026-03-17 22:16 [Buildroot] [PATCH v4 0/5] Add virglrenderer support Joseph Kogut
                   ` (2 preceding siblings ...)
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 3/5] package/virglrenderer: Fix build with glibc 2.43 Joseph Kogut
@ 2026-03-17 22:16 ` Joseph Kogut
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 5/5] package/qemu: add virglrenderer support Joseph Kogut
  4 siblings, 0 replies; 7+ messages in thread
From: Joseph Kogut @ 2026-03-17 22:16 UTC (permalink / raw)
  To: buildroot
  Cc: Adrian Perez de Castro, Eric Le Bihan, Romain Naour, Joseph Kogut,
	Joseph Kogut

From: Joseph Kogut <joseph@anodize.com>

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
---
 package/qemu/Config.in | 14 ++++++++++++++
 package/qemu/qemu.mk   |  8 +++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index e16eafe446..e4e8eb3b63 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -116,6 +116,20 @@ config BR2_PACKAGE_QEMU_SDL
 	  Say 'y' to enable the SDL frontend, that is, a graphical
 	  window presenting the VM's display.
 
+config BR2_PACKAGE_QEMU_OPENGL
+	bool "Enable OpenGL"
+	depends on BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL # libepoxy
+	select BR2_PACKAGE_LIBEPOXY
+	help
+	  Say 'y' to enable OpenGL accelerated display frontend support.
+	  This is necessary to efficiently display frames rendered in a
+	  guest on the host.
+
+	  Run qemu with `-display sdl,gl=on`
+
+comment "OpenGL support needs an OpenGL and/or OpenGL EGL backend"
+	depends on !(BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
+
 config BR2_PACKAGE_QEMU_FDT
 	bool "Enable FDT"
 	select BR2_PACKAGE_DTC
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 97f8e22091..9b780797fa 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -274,6 +274,13 @@ else
 QEMU_OPTS += --disable-usb-redir
 endif
 
+ifeq ($(BR2_PACKAGE_QEMU_OPENGL),y)
+QEMU_OPTS += --enable-opengl
+QEMU_DEPENDENCIES += libepoxy
+else
+QEMU_OPTS += --disable-opengl
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 QEMU_OPTS += --static
 endif
@@ -330,7 +337,6 @@ define QEMU_CONFIGURE_CMDS
 			--disable-membarrier \
 			--disable-mpath \
 			--disable-netmap \
-			--disable-opengl \
 			--disable-oss \
 			--disable-pa \
 			--disable-plugins \

-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v4 5/5] package/qemu: add virglrenderer support
  2026-03-17 22:16 [Buildroot] [PATCH v4 0/5] Add virglrenderer support Joseph Kogut
                   ` (3 preceding siblings ...)
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 4/5] package/qemu: add OpenGL config Joseph Kogut
@ 2026-03-17 22:16 ` Joseph Kogut
  4 siblings, 0 replies; 7+ messages in thread
From: Joseph Kogut @ 2026-03-17 22:16 UTC (permalink / raw)
  To: buildroot
  Cc: Adrian Perez de Castro, Eric Le Bihan, Romain Naour, Joseph Kogut

Add optional virglrenderer support, along with enabling OpenGL when
necessary.

https://qemu.readthedocs.io/en/v10.0.3/system/devices/virtio-gpu.html#virtio-gpu-virglrenderer

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
---
 package/qemu/Config.in | 17 +++++++++++++++++
 package/qemu/qemu.mk   |  7 +++++++
 2 files changed, 24 insertions(+)

diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index e4e8eb3b63..599bcb11bb 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -130,6 +130,23 @@ config BR2_PACKAGE_QEMU_OPENGL
 comment "OpenGL support needs an OpenGL and/or OpenGL EGL backend"
 	depends on !(BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
 
+config BR2_PACKAGE_QEMU_VIRGLRENDERER
+	bool "Enable virglrenderer"
+	depends on BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL
+	select BR2_PACKAGE_QEMU_OPENGL
+	select BR2_PACKAGE_VIRGLRENDERER
+	help
+	  Say 'y' to enable virglrenderer, enabling GL and Vulkan
+	  passthrough from the host to the guest through virtio-gpu.
+	  This enables the guest to have accelerated GL and/or Vulkan.
+
+	  Run qemu with `-device virtio-gpu-gl`
+
+	  https://qemu.readthedocs.io/en/v10.0.3/system/devices/virtio-gpu.html#virtio-gpu-virglrenderer
+
+comment "virglrenderer needs OpenGL accelerated display frontend support"
+	depends on !(BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
+
 config BR2_PACKAGE_QEMU_FDT
 	bool "Enable FDT"
 	select BR2_PACKAGE_DTC
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 9b780797fa..e250128dfa 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -281,6 +281,13 @@ else
 QEMU_OPTS += --disable-opengl
 endif
 
+ifeq ($(BR2_PACKAGE_QEMU_VIRGLRENDERER),y)
+QEMU_OPTS += --enable-virglrenderer
+QEMU_DEPENDENCIES += virglrenderer
+else
+QEMU_OPTS += --disable-virglrenderer
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 QEMU_OPTS += --static
 endif

-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH v4 3/5] package/virglrenderer: Fix build with glibc 2.43
  2026-03-17 22:16 ` [Buildroot] [PATCH v4 3/5] package/virglrenderer: Fix build with glibc 2.43 Joseph Kogut
@ 2026-03-18 19:07   ` Joseph Kogut
  0 siblings, 0 replies; 7+ messages in thread
From: Joseph Kogut @ 2026-03-18 19:07 UTC (permalink / raw)
  To: buildroot
  Cc: Adrian Perez de Castro, Eric Le Bihan, Romain Naour, Joseph Kogut

Hi all,

On Tue, Mar 17, 2026 at 3:16 PM Joseph Kogut <joseph.kogut@gmail.com> wrote:
>
> From: Joseph Kogut <joseph@anodize.com>
>
> Add an upstream patch to fix the build with glibc 2.43, not present in a
> stable release yet.

It looks like I'm missing a Signed-off-by line here. Also, my
git-send-email configuration was inconsistent for this series, some
commits are authored with one email and signed off with another. I'll
fix that and resubmit, sorry for the noise.

Best,
Joseph
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-03-18 19:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 22:16 [Buildroot] [PATCH v4 0/5] Add virglrenderer support Joseph Kogut
2026-03-17 22:16 ` [Buildroot] [PATCH v4 1/5] package/libepoxy: remove gl/egl dependency Joseph Kogut
2026-03-17 22:16 ` [Buildroot] [PATCH v4 2/5] package/virglrenderer: new package Joseph Kogut
2026-03-17 22:16 ` [Buildroot] [PATCH v4 3/5] package/virglrenderer: Fix build with glibc 2.43 Joseph Kogut
2026-03-18 19:07   ` Joseph Kogut
2026-03-17 22:16 ` [Buildroot] [PATCH v4 4/5] package/qemu: add OpenGL config Joseph Kogut
2026-03-17 22:16 ` [Buildroot] [PATCH v4 5/5] package/qemu: add virglrenderer support Joseph Kogut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox