package/virglrenderer: new package

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

Add an upstream patch to fix the build with glibc 2.43, not present in a
stable release yet.

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
This commit is contained in:
Joseph Kogut
2026-06-07 19:06:07 -07:00
committed by Romain Naour
parent cd2583ca0a
commit 76d4a9b297
6 changed files with 222 additions and 0 deletions

View File

@@ -1763,6 +1763,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/

View File

@@ -365,6 +365,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"

View File

@@ -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

View File

@@ -0,0 +1,114 @@
config BR2_PACKAGE_VIRGLRENDERER
bool "virglrenderer"
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # needs gcc >= 4.9 for __sync builtins
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
virtual machines.
A backend must be selected to enable guest acceleration.
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
select BR2_PACKAGE_VIRGLRENDERER_HAS_BACKEND
help
Enable API-level OpenGL acceleration over virtio-gpu.
Requires the host to support 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_VIRGLRENDERER_HAS_BACKEND
select BR2_PACKAGE_VULKAN_HEADERS
select BR2_PACKAGE_VULKAN_LOADER
help
Enable API-level Vulkan acceleration over virtio-gpu.
Requires the host to support Vulkan.
https://docs.mesa3d.org/drivers/venus.html
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_VIRGLRENDERER_HAS_BACKEND
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_VIRGLRENDERER_HAS_BACKEND
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_VIRGLRENDERER_HAS_BACKEND
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_VIRGLRENDERER_HAS_BACKEND
select BR2_PACKAGE_LIBDRM
help
Enable DRM backend for Panfrost, used by the panfrost
Gallium/vulkan drivers.
comment "Other options"
comment "vaapi support needs libgbm with dma-buf"
depends on !BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
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.
endif
comment "virglrenderer needs a toolchain w/ gcc >= 4.9"
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
config BR2_PACKAGE_VIRGLRENDERER_HAS_BACKEND
bool

View File

@@ -0,0 +1,5 @@
# Locally calculated
sha256 065bc56e89e6f631f96101cd62eba0748e48eb888b434edc86e89d05395e76f3 virglrenderer-1.3.0.tar.gz
# License
sha256 3b32caf16e2402c2aff2b716858713f3e1feded85c25e71bf829816ee5009402 COPYING

View File

@@ -0,0 +1,62 @@
################################################################################
#
# 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))