From patchwork Tue Jun 24 12:44:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 65578 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D62D1C77B7F for ; Tue, 24 Jun 2025 12:44:48 +0000 (UTC) Received: from smtp-bc0e.mail.infomaniak.ch (smtp-bc0e.mail.infomaniak.ch [45.157.188.14]) by mx.groups.io with SMTP id smtpd.web10.7290.1750769082959721965 for ; Tue, 24 Jun 2025 05:44:43 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 45.157.188.14, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4bRPm92w8TzHnv; Tue, 24 Jun 2025 14:44:41 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4bRPm85sRDzm7X; Tue, 24 Jun 2025 14:44:40 +0200 (CEST) From: Quentin Schulz Date: Tue, 24 Jun 2025 14:44:24 +0200 Subject: [PATCH RFC 1/4] mesa: add asahi to TOOLS when selected in PACKAGECONFIG MIME-Version: 1.0 Message-Id: <20250624-mesa-libclc-panfrost-v1-1-9ed8ca980e21@cherry.de> References: <20250624-mesa-libclc-panfrost-v1-0-9ed8ca980e21@cherry.de> In-Reply-To: <20250624-mesa-libclc-panfrost-v1-0-9ed8ca980e21@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 24 Jun 2025 12:44:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219262 From: Quentin Schulz Similarly to panfrost and other PACKAGECONFIG, mesa has tools for asahi. So let's build the tools whenever asked. This will be useful for precompiled compilers in mesa-native for example. Signed-off-by: Quentin Schulz --- meta/recipes-graphics/mesa/mesa.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index c3adb5ef78ac3a4d52ee0b8f45de0ece2d7fc237..1355c0c3ba5ee07ec24bc5e05f6adf0e17e9782a 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -124,6 +124,7 @@ PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, # mesa development and testing tools support, per driver TOOLS = "" TOOLS_DEPS = "" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'asahi', ',asahi', '', d)}" TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}" From patchwork Tue Jun 24 12:44:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 65579 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5555C7EE32 for ; Tue, 24 Jun 2025 12:44:48 +0000 (UTC) Received: from smtp-42ac.mail.infomaniak.ch (smtp-42ac.mail.infomaniak.ch [84.16.66.172]) by mx.groups.io with SMTP id smtpd.web10.7291.1750769083609969147 for ; Tue, 24 Jun 2025 05:44:43 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 84.16.66.172, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (unknown [IPv6:2001:1600:4:17::246b]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4bRPmB1Y37zJmD; Tue, 24 Jun 2025 14:44:42 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4bRPm946X3zpCr; Tue, 24 Jun 2025 14:44:41 +0200 (CEST) From: Quentin Schulz Date: Tue, 24 Jun 2025 14:44:25 +0200 Subject: [PATCH RFC 2/4] mesa: use native precompiled compilers instead of compiling them for the target recipe MIME-Version: 1.0 Message-Id: <20250624-mesa-libclc-panfrost-v1-2-9ed8ca980e21@cherry.de> References: <20250624-mesa-libclc-panfrost-v1-0-9ed8ca980e21@cherry.de> In-Reply-To: <20250624-mesa-libclc-panfrost-v1-0-9ed8ca980e21@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 24 Jun 2025 12:44:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219263 From: Quentin Schulz Make mesa-native build and install precompiled compilers so that mesa can use them. The goal is to eventually remove the heavy dependencies for libclc in the mesa target recipe. As far as I know, this needs libclc in mesa-native but it's already enabled by default. Because we would need the mesa target recipe to know whether the mesa-native has built and installed the precompiled compilers in order to make use of them in the target recipe and that it is not possible to do that (as it crosses the recipe boundary), we force the building and installing of the precompiled compilers in mesa-native. Since asahi and panfrost both have precompiled compilers, they are now added to the default native PACKAGECONFIG. We technically wouldn't need to build the drivers since only the tools are required in the native recipe but this is necessary for both to appear in TOOLS variable, so we'll leave it at that for the moment. We also don't really need to compile panfrost and asahi drivers, only the panfrost and asahi tools but the latter cannot be enabled without the former with the current state of the recipe. Signed-off-by: Quentin Schulz --- meta/recipes-graphics/mesa/mesa.inc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 1355c0c3ba5ee07ec24bc5e05f6adf0e17e9782a..330a04f1b098a2d3a6874f40feabe8836dd4cb37 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -73,7 +73,14 @@ def check_buildtype(d): return 'plain' MESON_BUILDTYPE = "${@check_buildtype(d)}" +PRECOMP_COMPILER = "system" +PRECOMP_COMPILER:class-native = "enabled" +INSTALL_PRECOMP_COMPILER = "false" +INSTALL_PRECOMP_COMPILER:class-native = "true" + EXTRA_OEMESON = " \ + -Dprecomp-compiler=${PRECOMP_COMPILER} \ + -Dinstall-precomp-compiler=${INSTALL_PRECOMP_COMPILER} \ -Dglx-read-only-text=true \ -Dplatforms='${@",".join("${PLATFORMS}".split())}' \ " @@ -95,7 +102,7 @@ INHIBIT_DEFAULT_RUST_DEPS = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', '', PACKAGECONFIG:append:x86 = " libclc gallium-llvm intel amd nouveau svga" PACKAGECONFIG:append:x86-64 = " libclc gallium-llvm intel amd nouveau svga" PACKAGECONFIG:append:i686 = " libclc gallium-llvm intel amd nouveau svga" -PACKAGECONFIG:append:class-native = " libclc gallium-llvm amd nouveau svga" +PACKAGECONFIG:append:class-native = " libclc gallium-llvm amd nouveau svga panfrost asahi tools" # "gbm" requires "opengl" PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled" @@ -205,7 +212,8 @@ PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpa PACKAGECONFIG[imagination] = "-Dimagination-srv=true,-Dimagination-srv=false" -PACKAGECONFIG[asahi] = "" +# Asahi requires precompiled compilers from mesa-native +PACKAGECONFIG[asahi] = ",,${MESA_NATIVE}" PACKAGECONFIG[intel] = "" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'intel', ',i915,crocus', '', d)}" @@ -213,7 +221,8 @@ GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'intel', ',i915,c PACKAGECONFIG[lima] = "" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}" -PACKAGECONFIG[panfrost] = "" +# Panfrost requires precompiled compilers from mesa-native +PACKAGECONFIG[panfrost] = ",,${MESA_NATIVE}" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" PACKAGECONFIG[tegra] = "" From patchwork Tue Jun 24 12:44:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 65580 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB371C7EE39 for ; Tue, 24 Jun 2025 12:44:48 +0000 (UTC) Received: from smtp-bc0c.mail.infomaniak.ch (smtp-bc0c.mail.infomaniak.ch [45.157.188.12]) by mx.groups.io with SMTP id smtpd.web11.7441.1750769084573955245 for ; Tue, 24 Jun 2025 05:44:44 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 45.157.188.12, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4bRPmB6yLhz6Sl; Tue, 24 Jun 2025 14:44:42 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4bRPmB1xlqznk7; Tue, 24 Jun 2025 14:44:42 +0200 (CEST) From: Quentin Schulz Date: Tue, 24 Jun 2025 14:44:26 +0200 Subject: [PATCH RFC 3/4] mesa: lighten up libclc dependencies for the target MIME-Version: 1.0 Message-Id: <20250624-mesa-libclc-panfrost-v1-3-9ed8ca980e21@cherry.de> References: <20250624-mesa-libclc-panfrost-v1-0-9ed8ca980e21@cherry.de> In-Reply-To: <20250624-mesa-libclc-panfrost-v1-0-9ed8ca980e21@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 24 Jun 2025 12:44:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219264 From: Quentin Schulz By using mesa-native mesa-clc instead of libclc, we do not actually need most of the heavy dependencies of the libclc PACKAGECONFIG as we simply need to use the natively compiled mesa-clc instead. We thus can simply depend on mesa-native for the target recipe. libclc however is still required if opencl (rusticl) is selected. Because asahi drivers are only enabled when libclc is also selected, we can now remove the explicit dependency on MESA_NATIVE. We do the same for panfrost even though libclc isn't enforced yet for mesa for the target. Support for panfrost has been broken for a while already anyway (because of the possibly missing libclc) but we'll fix it in a later commit. Signed-off-by: Quentin Schulz --- meta/recipes-graphics/mesa/mesa.inc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 330a04f1b098a2d3a6874f40feabe8836dd4cb37..eafe1697c48edc661b33a54c5856d8e577608fd5 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -158,7 +158,7 @@ PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled" # "opencl" also requires libclc and gallium-llvm to be present in PKGCONFIG! # Be sure to enable them both for the target and for the native build. -PACKAGECONFIG[opencl] = "-Dgallium-rusticl=true, -Dgallium-rusticl=false, bindgen-cli-native" +PACKAGECONFIG[opencl] = "-Dgallium-rusticl=true, -Dgallium-rusticl=false, bindgen-cli-native libclc spirv-tools spirv-llvm-translator" PACKAGECONFIG[broadcom] = "" PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native" @@ -201,19 +201,21 @@ MESA_CLC = "system" MESA_CLC:class-native = "enabled" INSTALL_MESA_CLC = "false" INSTALL_MESA_CLC:class-native = "true" -MESA_NATIVE = "mesa-native" -MESA_NATIVE:class-native = "" +# Reuse libclc from mesa-native instead of bringing heavy dependencies +LIBCLC_DEPS = "mesa-native" +LIBCLC_DEPS:class-native = "libclc spirv-tools spirv-llvm-translator" PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm" PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm llvm-native elfutils" -PACKAGECONFIG[libclc] = "-Dmesa-clc=${MESA_CLC} -Dinstall-mesa-clc=${INSTALL_MESA_CLC} -Dmesa-clc-bundle-headers=enabled,,libclc spirv-tools spirv-llvm-translator ${MESA_NATIVE}" +PACKAGECONFIG[libclc] = "-Dmesa-clc=${MESA_CLC} -Dinstall-mesa-clc=${INSTALL_MESA_CLC} -Dmesa-clc-bundle-headers=enabled,,${LIBCLC_DEPS}" PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial" PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau" PACKAGECONFIG[imagination] = "-Dimagination-srv=true,-Dimagination-srv=false" -# Asahi requires precompiled compilers from mesa-native -PACKAGECONFIG[asahi] = ",,${MESA_NATIVE}" +# Asahi requires precompiled compilers and libclc from mesa-native +# Make sure libclc is in mesa-native AND mesa PACKAGECONFIG +PACKAGECONFIG[asahi] = "" PACKAGECONFIG[intel] = "" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'intel', ',i915,crocus', '', d)}" @@ -221,8 +223,9 @@ GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'intel', ',i915,c PACKAGECONFIG[lima] = "" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}" -# Panfrost requires precompiled compilers from mesa-native -PACKAGECONFIG[panfrost] = ",,${MESA_NATIVE}" +# Panfrost requires precompiled compilers and libclc from mesa-native +# Make sure libclc is in mesa-native AND mesa PACKAGECONFIG +PACKAGECONFIG[panfrost] = "" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" PACKAGECONFIG[tegra] = "" From patchwork Tue Jun 24 12:44:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 65577 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7794C7EE30 for ; Tue, 24 Jun 2025 12:44:48 +0000 (UTC) Received: from smtp-bc0a.mail.infomaniak.ch (smtp-bc0a.mail.infomaniak.ch [45.157.188.10]) by mx.groups.io with SMTP id smtpd.web10.7292.1750769084985921029 for ; Tue, 24 Jun 2025 05:44:45 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 45.157.188.10, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (unknown [IPv6:2001:1600:4:17::246b]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4bRPmC4H1BzJX8; Tue, 24 Jun 2025 14:44:43 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4bRPmB6z19zmv8; Tue, 24 Jun 2025 14:44:42 +0200 (CEST) From: Quentin Schulz Date: Tue, 24 Jun 2025 14:44:27 +0200 Subject: [PATCH RFC 4/4] mesa: fix panfrost driver build MIME-Version: 1.0 Message-Id: <20250624-mesa-libclc-panfrost-v1-4-9ed8ca980e21@cherry.de> References: <20250624-mesa-libclc-panfrost-v1-0-9ed8ca980e21@cherry.de> In-Reply-To: <20250624-mesa-libclc-panfrost-v1-0-9ed8ca980e21@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 24 Jun 2025 12:44:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219265 From: Quentin Schulz Panfrost drivers require libclc, so let's force libclc to be present in the PACKAGECONFIG to build the drivers. This essentially only brings mesa-native as dependency for the target recipe as the target libclc PACKAGECONFIG relies on libclc from mesa-native (via the mesa-clc knob). Signed-off-by: Quentin Schulz --- meta/recipes-graphics/mesa/mesa.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index eafe1697c48edc661b33a54c5856d8e577608fd5..1992e0a8c9fe4ee6dc7d0b46ff8ed7a220ec981e 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -125,7 +125,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)}" +VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost libclc', ',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 @@ -226,7 +226,7 @@ GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', # Panfrost requires precompiled compilers and libclc from mesa-native # Make sure libclc is in mesa-native AND mesa PACKAGECONFIG PACKAGECONFIG[panfrost] = "" -GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost libclc', ',panfrost', '', d)}" PACKAGECONFIG[tegra] = "" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'tegra', ',tegra,nouveau', '', d)}"