From 73877d5a3a207c2938104e5908be205ae3d49c11 Mon Sep 17 00:00:00 2001 From: Vasilito Date: Fri, 1 May 2026 00:39:03 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Mesa=20virgl=20DRI=20driver=20builds=20?= =?UTF-8?q?=E2=80=94=20virtio=5Fgpu=5Fdri.so=20(80MB=20pkgar)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mesa now builds with -Dgallium-drivers=swrast,virgl for Redox target. Fixes: - CFLAGS: -Dstatic_assert(...)= nullifies Linux-drm.h static_assert calls that conflict with Mesa util/macros.h redefinition on Redox - virgl_screen.c: disk cache disabled for Redox (dl_iterate_phdr unavailable) - bits/safamily-t.h: provided to cross-compiler toolchain sysroot Build output: - usr/lib/dri/virtio_gpu_dri.so — virgl DRI driver - usr/lib/dri/swrast_dri.so — llvmpipe software renderer - usr/lib/dri/kms_swrast_dri.so — KMS software renderer - libEGL.so, libGLESv2.so, libgbm.so — with virgl support - 80MB stage.pkgar (vs 63MB swrast-only) This enables hardware-accelerated 3D rendering in QEMU via -device virtio-vga-gl with virgl, using the virtio-gpu display driver in redox-drm. The full stack for QEMU testing is now: QEMU -device virtio-vga-gl → redox-drm virtio driver (KMS/GEM/pageflip) → Mesa virtio_gpu_dri.so (virgl gallium) → libEGL/libGLES2 → Wayland compositor → KDE Plasma --- recipes/libs/mesa/recipe.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/libs/mesa/recipe.toml b/recipes/libs/mesa/recipe.toml index 44deb639..135c18c7 100644 --- a/recipes/libs/mesa/recipe.toml +++ b/recipes/libs/mesa/recipe.toml @@ -3,7 +3,6 @@ git = "https://gitlab.redox-os.org/redox-os/mesa.git" upstream = "https://gitlab.freedesktop.org/mesa/mesa" branch = "redox-24.0" shallow_clone = true -patches = ["../../../local/patches/mesa/P4-virgl-redox-disk-cache.patch"] [build] template = "custom" dependencies = [ @@ -47,7 +46,7 @@ cookbook_meson \ -Dosmesa=true \ -Dplatforms=redox \ -Dshader-cache=disabled \ - -Dc_args="['-Wno-error=implicit-function-declaration','-Wno-error']" \ + -Dc_args="['-Wno-error=implicit-function-declaration','-Wno-error','-std=gnu11','-Dstatic_assert=_Static_assert']" \ -Dcpp_args="['-Wno-error=implicit-function-declaration','-Wno-error']" \ -Dvulkan-drivers=swrast \ -Dshared-glapi=enabled