Message ID | 20250415-mesa-panvk-v1-1-39592671ef11@cherry.de |
---|---|
State | New |
Headers | show |
Series | mesa: enable PanVK | expand |
On Tue, Apr 15, 2025 at 02:41:51PM +0200, Quentin Schulz wrote: > From: Quentin Schulz <quentin.schulz@cherry.de> > > If panfrost is enabled, we currently build panfrost tools and the > gallium driver. There's also a vulkan driver available for panfrost, so > let's enable it as well whenever panfrost PACKAGECONFIG is enabled, > similarly to how it's done for the gallium driver. > > PanVK is the "commercial" name for the vulkan driver for panfrost but > it's enabled under the panfrost name in meson. > > This was "tested" with `vkgears -info` with mesa-demos from commit > 11939e1697b894be3c68a89e3ea86fc51a320836 on an RK3588-based system. Could you possibly try with vkcube from https://github.com/lumag/vkcube/tree/kms ? This is the branch that I've fixed to work without Xorg or Wayland. > Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> > --- > Just stumbled upon PanVK yesterday[1] so wondered how to make this work. > > Sadly, vkgears from mesa-demos 9.0.0 doesn't seem to work well: > > root@jaguar:~# vkgears -info > xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb > Segmentation fault > > But I've bumped it to the latest commit in main branch with the > following: > [...] > --- > meta/recipes-graphics/mesa/mesa-demos_git.bb | 47 ++++++++++++++++++++++++++++ This should come as a separate patch and ideally just by bumping current 9.0 to _git. > meta/recipes-graphics/mesa/mesa.inc | 1 + > 2 files changed, 48 insertions(+) > > diff --git a/meta/recipes-graphics/mesa/mesa-demos_git.bb b/meta/recipes-graphics/mesa/mesa-demos_git.bb > new file mode 100644 > index 0000000000000000000000000000000000000000..99dc298389f4d6c2a11a0df5cca484799f986bc5 > --- /dev/null > +++ b/meta/recipes-graphics/mesa/mesa-demos_git.bb [skipped] > diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc > index aca34983e97ca684d662987d3a1d0b61ba44029a..0163d96a36a5e8eb016ddbe2b645d6bcaba71179 100644 > --- a/meta/recipes-graphics/mesa/mesa.inc > +++ b/meta/recipes-graphics/mesa/mesa.inc > @@ -119,6 +119,7 @@ VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',fr > VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}" > VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', '${VULKAN_DRIVERS_LLVM}', '', d)}" > VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'imagination', ',imagination-experimental', '', d)}" > +VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" LGTM > PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers" > > # mesa development and testing tools support, per driver > > --- > base-commit: 122e9a49614b2ddedaae1d90c06004a7a4c43998 > change-id: 20250415-mesa-panvk-7039f4060425 > > Best regards, > -- > Quentin Schulz <quentin.schulz@cherry.de> > >
Hi Dmitry, On 4/15/25 2:52 PM, Dmitry Baryshkov wrote: > On Tue, Apr 15, 2025 at 02:41:51PM +0200, Quentin Schulz wrote: >> From: Quentin Schulz <quentin.schulz@cherry.de> >> >> If panfrost is enabled, we currently build panfrost tools and the >> gallium driver. There's also a vulkan driver available for panfrost, so >> let's enable it as well whenever panfrost PACKAGECONFIG is enabled, >> similarly to how it's done for the gallium driver. >> >> PanVK is the "commercial" name for the vulkan driver for panfrost but >> it's enabled under the panfrost name in meson. >> >> This was "tested" with `vkgears -info` with mesa-demos from commit >> 11939e1697b894be3c68a89e3ea86fc51a320836 on an RK3588-based system. > > Could you possibly try with vkcube from > https://github.com/lumag/vkcube/tree/kms ? This is the branch that I've > fixed to work without Xorg or Wayland. vkcube from meta-vulkan master branch + https://github.com/lumag/vkcube/commit/a726b82a1d74a3c87846c463f0060c49f4f75fc8.patch I get: root@jaguar:~# vkcube error: XDG_RUNTIME_DIR is invalid or not set in the environment. failed to initialize wayland, falling back to xcb failed to initialize xcb, falling back to kms failed to take control of vt handling root@jaguar:~# vkcube -m kms failed to take control of vt handling root@jaguar:~# vkcube -n WARNING: panvk is not a conformant Vulkan implementation, testing use only. 1 physical devices vendor id 13b5, device name Mali-G610 writing first frame to ./cube.png cube.png resembles the one from kmscube so I guess that's fine? > >> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> >> --- >> Just stumbled upon PanVK yesterday[1] so wondered how to make this work. >> >> Sadly, vkgears from mesa-demos 9.0.0 doesn't seem to work well: >> >> root@jaguar:~# vkgears -info >> xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb >> Segmentation fault >> >> But I've bumped it to the latest commit in main branch with the >> following: >> > > [...] > >> --- >> meta/recipes-graphics/mesa/mesa-demos_git.bb | 47 ++++++++++++++++++++++++++++ > > This should come as a separate patch and ideally just by bumping current > 9.0 to _git. > Welp, this should have never made it to the patch in the first place :) Sorry! Cheers, Quentin
diff --git a/meta/recipes-graphics/mesa/mesa-demos_git.bb b/meta/recipes-graphics/mesa/mesa-demos_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..99dc298389f4d6c2a11a0df5cca484799f986bc5 --- /dev/null +++ b/meta/recipes-graphics/mesa/mesa-demos_git.bb @@ -0,0 +1,47 @@ +SUMMARY = "Mesa demo applications" +DESCRIPTION = "This package includes the demonstration application, such as glxgears. \ +These applications can be used for Mesa validation and benchmarking." +HOMEPAGE = "http://mesa3d.org" +BUGTRACKER = "https://bugs.freedesktop.org" +SECTION = "x11" + +LICENSE = "MIT & PD" +LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=a481fbdb2ac800ecb12405c33bcfacae \ + file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06" + +SRC_URI = "git://gitlab.freedesktop.org/mesa/demos.git;branch=main;protocol=https" +SRCREV = "11939e1697b894be3c68a89e3ea86fc51a320836" + +PV = "9.0.0+" + +S = "${WORKDIR}/git" + +inherit meson pkgconfig features_check +# depends on virtual/egl, virtual/libgl ... +REQUIRED_DISTRO_FEATURES = "opengl x11" + +EXTRA_OEMESON = "-Dwith-system-data-files=true" + +# Note: wayland is not included as the feature requires libdecor recipe, +# which is not currently in core +PACKAGECONFIG ?= "drm egl gles1 gles2 \ + ${@bb.utils.filter('DISTRO_FEATURES', 'vulkan x11', d)}" + +PACKAGECONFIG[drm] = "-Dlibdrm=enabled,-Dlibdrm=disabled,libdrm" +PACKAGECONFIG[egl] = "-Degl=enabled,-Degl=disabled,virtual/egl" +PACKAGECONFIG[gles1] = "-Dgles1=enabled,-Dgles1=disabled,virtual/libgles1" +PACKAGECONFIG[gles2] = "-Dgles2=enabled,-Dgles2=disabled,virtual/libgles2" +PACKAGECONFIG[glut] = "-Dwith-glut=${STAGING_EXECPREFIXDIR} -Dglut=enabled,-Dglut=disabled,freeglut" +PACKAGECONFIG[osmesa] = "-Dosmesa=enabled,-Dosmesa=disabled," +PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,vulkan-loader glslang-native" +PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,virtual/libgl wayland wayland-native wayland-protocols libxkbcommon libdecor" +PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 libglu libxkbcommon libxcb" + +do_install:append() { + # it can be completely empty when all PACKAGECONFIG options are disabled + rmdir --ignore-fail-on-non-empty ${D}${bindir} + + if [ -f ${D}${bindir}/clear ]; then + mv ${D}${bindir}/clear ${D}${bindir}/clear.mesa-demos + fi +} diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index aca34983e97ca684d662987d3a1d0b61ba44029a..0163d96a36a5e8eb016ddbe2b645d6bcaba71179 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -119,6 +119,7 @@ VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',fr VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}" VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', '${VULKAN_DRIVERS_LLVM}', '', d)}" VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'imagination', ',imagination-experimental', '', d)}" +VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers" # mesa development and testing tools support, per driver