From: Dmitry Baryshkov Date: Wed, 10 Dec 2025 17:58:47 +0000 (+0200) Subject: mesa: enable virtio and gfxstream Vulkan drivers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e7ffdceded33091e72c9a3ceb239d847cf917a9;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git mesa: enable virtio and gfxstream Vulkan drivers Enable two more virtual drivers: gfxstream and virtio. Replace the 'virgl' PACKAGECONFIG with 'virtio' which now governs all virtual drivers. Signed-off-by: Dmitry Baryshkov Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-graphics/mesa/files/0001-gfxstream-don-t-dump-genvk.py-args-to-generated-file.patch b/meta/recipes-graphics/mesa/files/0001-gfxstream-don-t-dump-genvk.py-args-to-generated-file.patch new file mode 100644 index 0000000000..097ca84e3b --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-gfxstream-don-t-dump-genvk.py-args-to-generated-file.patch @@ -0,0 +1,34 @@ +From c0f067e86bc9f7fbc60c2539dc612a050ee2569f Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov +Date: Wed, 19 Nov 2025 11:36:42 +0200 +Subject: [PATCH] gfxstream: don't dump genvk.py args to generated files + +Full command lines include full path to the output file, which triggers +the 'buildpath' QA warning. Drop the args and print only a basename of +the script used to generate the file. + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38875] +Signed-off-by: Dmitry Baryshkov +--- + src/gfxstream/codegen/scripts/cerealgenerator.py | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/src/gfxstream/codegen/scripts/cerealgenerator.py b/src/gfxstream/codegen/scripts/cerealgenerator.py +index 077571e9eda5..217c3e1d0e94 100644 +--- a/src/gfxstream/codegen/scripts/cerealgenerator.py ++++ b/src/gfxstream/codegen/scripts/cerealgenerator.py +@@ -254,13 +254,7 @@ def banner_command(argv): + Return a string corresponding to the command, with platform-specific + paths removed.""" + +- def makePosixRelative(someArg): +- # Do not use relative for /tmp/ to avoid effects of checkout location +- if os.path.exists(someArg) and someArg != "/tmp/": +- return str(PurePosixPath(Path(os.path.relpath(someArg)))) +- return someArg +- +- return ' '.join(map(makePosixRelative, argv)) ++ return os.path.basename(argv[0]) + + def envGetOrDefault(key, default=None): + if key in os.environ: diff --git a/meta/recipes-graphics/mesa/mesa.bb b/meta/recipes-graphics/mesa/mesa.bb index cfa5d0f40f..2c9a38cf65 100644 --- a/meta/recipes-graphics/mesa/mesa.bb +++ b/meta/recipes-graphics/mesa/mesa.bb @@ -4,9 +4,10 @@ PACKAGECONFIG = " \ gallium \ video-codecs \ ${@bb.utils.filter('DISTRO_FEATURES', 'x11 vulkan wayland glvnd', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm virgl', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'opencl', 'opencl libclc gallium-llvm', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'zink', '', d)} \ + ${@bb.utils.contains_any('DISTRO_FEATURES', 'opengl vulkan', 'virtio', '', d)} \ xmlconfig \ " diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 9b25bc0301..ac6038873a 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -17,6 +17,7 @@ PE = "2" SRC_URI = "https://archive.mesa3d.org/mesa-${PV}.tar.xz \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ file://0001-freedreno-don-t-encode-build-path-into-binaries.patch \ + file://0001-gfxstream-don-t-dump-genvk.py-args-to-generated-file.patch \ " SRC_URI[sha256sum] = "097842f3e49d996868b38688db87b006f7d4541e93ce86d2f341d8b3e7be7c93" @@ -113,7 +114,7 @@ PACKAGECONFIG[svga] = "" PACKAGECONFIG[tegra] = "" PACKAGECONFIG[v3d] = "" PACKAGECONFIG[vc4] = "" -PACKAGECONFIG[virgl] = "" +PACKAGECONFIG[virtio] = "" PACKAGECONFIG[zink] = "" @@ -121,16 +122,23 @@ VULKAN_DRIVERS_SWRAST = ",swrast" # Crashes on x32 VULKAN_DRIVERS_SWRAST:x86-x32 = "" +VULKAN_DRIVERS_VIRTIO = ",virtio" +# No atomic_uint on ARMv4 / v5 +VULKAN_DRIVERS_VIRTIO:armv4 = "" +VULKAN_DRIVERS_VIRTIO:armv5 = "" + # keep sorted by the driver name (rather than PKGCONFIG) VULKAN_DRIVERS = "" VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'amd gallium-llvm', ',amd', '', d)}" VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'asahi libclc gallium-llvm', ',asahi', '', d)}" VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}" VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" +VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'virtio', ',gfxstream', '', d)}" VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'imagination', ',imagination-experimental', '', d)}" VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'intel libclc gallium-llvm', ',intel', '', d)}" VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'panfrost libclc', ',panfrost', '', d)}" VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', '${VULKAN_DRIVERS_SWRAST}', '', d)}" +VULKAN_DRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'virtio', '${VULKAN_DRIVERS_VIRTIO}', '', d)}" PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers" PACKAGECONFIG[vulkan-beta] = "-Dvulkan-beta=true,-Dvulkan-beta=false" @@ -178,7 +186,7 @@ GALLIUMDRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'svga gallium-llvm', ', GALLIUMDRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'tegra', ',tegra', '', d)}" GALLIUMDRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}" GALLIUMDRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}" -GALLIUMDRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}" +GALLIUMDRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'virtio', ',virgl', '', d)}" GALLIUMDRIVERS .= "${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}" PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm"