From patchwork Mon Jul 21 10:33:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 67189 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 A3116C87FCD for ; Mon, 21 Jul 2025 10:34:02 +0000 (UTC) Received: from smtp-bc0b.mail.infomaniak.ch (smtp-bc0b.mail.infomaniak.ch [45.157.188.11]) by mx.groups.io with SMTP id smtpd.web10.37287.1753094033378879041 for ; Mon, 21 Jul 2025 03:33:53 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 45.157.188.11, mailfrom: foss+yocto@0leil.net) Received: from smtp-4-0000.mail.infomaniak.ch (unknown [IPv6:2001:1600:7:10::a6b]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4blxZm0qQLzPHQ; Mon, 21 Jul 2025 12:33:52 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4blxZl4G5dzW4Q; Mon, 21 Jul 2025 12:33:51 +0200 (CEST) From: Quentin Schulz Date: Mon, 21 Jul 2025 12:33:38 +0200 Subject: [PATCH RFC v2 1/6] mesa: move PACKAGECONFIG defaults to recipes MIME-Version: 1.0 Message-Id: <20250721-mesa-libclc-panfrost-v2-1-f713d0858949@cherry.de> References: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> In-Reply-To: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Ross Burton , Otavio Salvador , 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 ; Mon, 21 Jul 2025 10:34:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220674 From: Quentin Schulz We're planning on reusing mesa.inc for a new mesa-tools-native recipe which will require much less in terms of PACKAGECONFIG than the actual mesa recipes. It also doesn't make a lot of sense to have a default PACKAGECONFIG in an include file inherited by multiple recipes (here mesa and mesa-gl) which is highlighted by the useless PACKAGECONFIG ??= that is in mesa-gl since it was entirely replaced by the one from mesa.inc (hence why it's removed in this commit). Signed-off-by: Quentin Schulz --- meta/recipes-graphics/mesa/mesa-gl.bb | 14 ++++++++++++-- meta/recipes-graphics/mesa/mesa.bb | 12 ++++++++++++ meta/recipes-graphics/mesa/mesa.inc | 13 ------------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/meta/recipes-graphics/mesa/mesa-gl.bb b/meta/recipes-graphics/mesa/mesa-gl.bb index e2f03c81c4588c6257ffec2892fef7fcbe9f82bf..8418f13bbc8aa84c6591eb8b46e1fa96d7aad9b6 100644 --- a/meta/recipes-graphics/mesa/mesa-gl.bb +++ b/meta/recipes-graphics/mesa/mesa-gl.bb @@ -8,7 +8,17 @@ S = "${UNPACKDIR}/mesa-${PV}" TARGET_CFLAGS = "-I${STAGING_INCDIR}/drm" -# At least one DRI rendering engine is required to build mesa. -PACKAGECONFIG ??= "opengl gallium ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" +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', 'vulkan', 'zink', '', d)} \ +" + PACKAGECONFIG:class-target = "opengl gallium ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" +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" diff --git a/meta/recipes-graphics/mesa/mesa.bb b/meta/recipes-graphics/mesa/mesa.bb index 96e8aa38d61661c02d2228d825f70cf41f985382..305b18070d6a47a53f204906a16bc8d4833fd9d6 100644 --- a/meta/recipes-graphics/mesa/mesa.bb +++ b/meta/recipes-graphics/mesa/mesa.bb @@ -1,2 +1,14 @@ require ${BPN}.inc +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', 'vulkan', 'zink', '', d)} \ +" + +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" diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 47b95728e0b33c43992e1200a9e50e0f22c9bd6b..0f896887a4d956514f1fcc807de2ad31afa29f18 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -81,22 +81,9 @@ EXTRA_OEMESON = " \ def strip_comma(s): return s.strip(',') -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', 'vulkan', 'zink', '', d)} \ -" - # skip all Rust dependencies if we are not building OpenCL" INHIBIT_DEFAULT_RUST_DEPS = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', '', '1', d)}" -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" - # "gbm" requires "opengl" PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled" From patchwork Mon Jul 21 10:33:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 67190 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 9A1A6C87FCA for ; Mon, 21 Jul 2025 10:34:02 +0000 (UTC) Received: from smtp-190f.mail.infomaniak.ch (smtp-190f.mail.infomaniak.ch [185.125.25.15]) by mx.groups.io with SMTP id smtpd.web11.37330.1753094033835386608 for ; Mon, 21 Jul 2025 03:33:54 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 185.125.25.15, mailfrom: foss+yocto@0leil.net) Received: from smtp-4-0000.mail.infomaniak.ch (unknown [IPv6:2001:1600:7:10::a6b]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4blxZm46vYzRlN; Mon, 21 Jul 2025 12:33:52 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4blxZm0kNRzWf2; Mon, 21 Jul 2025 12:33:52 +0200 (CEST) From: Quentin Schulz Date: Mon, 21 Jul 2025 12:33:39 +0200 Subject: [PATCH RFC v2 2/6] mesa: move PROVIDES out of include file MIME-Version: 1.0 Message-Id: <20250721-mesa-libclc-panfrost-v2-2-f713d0858949@cherry.de> References: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> In-Reply-To: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Ross Burton , Otavio Salvador , 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 ; Mon, 21 Jul 2025 10:34:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220675 From: Quentin Schulz There currently are two recipes including mesa.inc, mesa-gl and mesa. The former overrides PROVIDES and the latter just inherits it from mesa.inc. Let's just move PROVIDES to where it makes sense the mesa recipe. Signed-off-by: Quentin Schulz --- meta/recipes-graphics/mesa/mesa.bb | 11 +++++++++++ meta/recipes-graphics/mesa/mesa.inc | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/meta/recipes-graphics/mesa/mesa.bb b/meta/recipes-graphics/mesa/mesa.bb index 305b18070d6a47a53f204906a16bc8d4833fd9d6..51d0384ef5930f36ff2f5c20ebad2d7ad8b817a9 100644 --- a/meta/recipes-graphics/mesa/mesa.bb +++ b/meta/recipes-graphics/mesa/mesa.bb @@ -12,3 +12,14 @@ 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" + +GLPROVIDES = " \ + ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \ +" +PROVIDES = " \ + ${@bb.utils.contains('PACKAGECONFIG', 'glvnd', '', d.getVar('GLPROVIDES'), d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \ + virtual/mesa \ +" diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 0f896887a4d956514f1fcc807de2ad31afa29f18..cef62308f2cb8a5480c3dc5b42836b95b2a04284 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -41,16 +41,6 @@ do_install:append() { DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native python3-pyyaml-native" EXTRANATIVEPATH += "chrpath-native" -GLPROVIDES = " \ - ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \ -" -PROVIDES = " \ - ${@bb.utils.contains('PACKAGECONFIG', 'glvnd', '', d.getVar('GLPROVIDES'), d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \ - virtual/mesa \ - " inherit meson pkgconfig python3native gettext features_check rust From patchwork Mon Jul 21 10:33:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 67188 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 92B0AC87FC8 for ; Mon, 21 Jul 2025 10:34:02 +0000 (UTC) Received: from smtp-bc0f.mail.infomaniak.ch (smtp-bc0f.mail.infomaniak.ch [45.157.188.15]) by mx.groups.io with SMTP id smtpd.web10.37288.1753094034286766251 for ; Mon, 21 Jul 2025 03:33:54 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 45.157.188.15, mailfrom: foss+yocto@0leil.net) Received: from smtp-4-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4blxZn0HFfzP7T; Mon, 21 Jul 2025 12:33:53 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4blxZm41mTzSsw; Mon, 21 Jul 2025 12:33:52 +0200 (CEST) From: Quentin Schulz Date: Mon, 21 Jul 2025 12:33:40 +0200 Subject: [PATCH RFC v2 3/6] mesa: move BBCLASSEXTEND out of the include file MIME-Version: 1.0 Message-Id: <20250721-mesa-libclc-panfrost-v2-3-f713d0858949@cherry.de> References: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> In-Reply-To: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Ross Burton , Otavio Salvador , 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 ; Mon, 21 Jul 2025 10:34:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220676 From: Quentin Schulz We're going to have a new mesa-tools-native recipe include mesa.inc soon. We don't need a target mesa-tools recipe for now so we'll go with a native-only recipe which this BBCLASSEXTEND prevents us to do properly, so let's move them to the recipes instead. Signed-off-by: Quentin Schulz --- meta/recipes-graphics/mesa/mesa-gl.bb | 2 ++ meta/recipes-graphics/mesa/mesa.bb | 2 ++ meta/recipes-graphics/mesa/mesa.inc | 2 -- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/recipes-graphics/mesa/mesa-gl.bb b/meta/recipes-graphics/mesa/mesa-gl.bb index 8418f13bbc8aa84c6591eb8b46e1fa96d7aad9b6..460e5e60c8dcee69d43885954c431b175c19394f 100644 --- a/meta/recipes-graphics/mesa/mesa-gl.bb +++ b/meta/recipes-graphics/mesa/mesa-gl.bb @@ -22,3 +22,5 @@ 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" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-graphics/mesa/mesa.bb b/meta/recipes-graphics/mesa/mesa.bb index 51d0384ef5930f36ff2f5c20ebad2d7ad8b817a9..db5eab5fb27c6a7228f6e0fd823514352c42ad1f 100644 --- a/meta/recipes-graphics/mesa/mesa.bb +++ b/meta/recipes-graphics/mesa/mesa.bb @@ -23,3 +23,5 @@ PROVIDES = " \ ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \ virtual/mesa \ " + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index cef62308f2cb8a5480c3dc5b42836b95b2a04284..55793baa8de5a190ae5eadb44662c1d11487c026 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -44,8 +44,6 @@ EXTRANATIVEPATH += "chrpath-native" inherit meson pkgconfig python3native gettext features_check rust -BBCLASSEXTEND = "native nativesdk" - ANY_OF_DISTRO_FEATURES = "opengl vulkan" PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}" From patchwork Mon Jul 21 10:33:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 67187 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 87BDCC83F26 for ; Mon, 21 Jul 2025 10:34:02 +0000 (UTC) Received: from smtp-1909.mail.infomaniak.ch (smtp-1909.mail.infomaniak.ch [185.125.25.9]) by mx.groups.io with SMTP id smtpd.web11.37332.1753094034918336318 for ; Mon, 21 Jul 2025 03:33:55 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 185.125.25.9, mailfrom: foss+yocto@0leil.net) Received: from smtp-4-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4blxZn3dfszRK1; Mon, 21 Jul 2025 12:33:53 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4blxZn098hzTDT; Mon, 21 Jul 2025 12:33:53 +0200 (CEST) From: Quentin Schulz Date: Mon, 21 Jul 2025 12:33:41 +0200 Subject: [PATCH RFC v2 4/6] mesa: add asahi to TOOLS when selected in PACKAGECONFIG MIME-Version: 1.0 Message-Id: <20250721-mesa-libclc-panfrost-v2-4-f713d0858949@cherry.de> References: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> In-Reply-To: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Ross Burton , Otavio Salvador , 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 ; Mon, 21 Jul 2025 10:34:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220677 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 building asahi_clc precomp-compiler in native mesa 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 55793baa8de5a190ae5eadb44662c1d11487c026..5295b70fc9b4bb9570d86333f9229aef9114d93d 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -99,6 +99,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 Mon Jul 21 10:33:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 67186 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 78F8BC83F25 for ; Mon, 21 Jul 2025 10:34:02 +0000 (UTC) Received: from smtp-42af.mail.infomaniak.ch (smtp-42af.mail.infomaniak.ch [84.16.66.175]) by mx.groups.io with SMTP id smtpd.web10.37289.1753094035384236843 for ; Mon, 21 Jul 2025 03:33:55 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 84.16.66.175, mailfrom: foss+yocto@0leil.net) Received: from smtp-4-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4blxZn74wczP5B; Mon, 21 Jul 2025 12:33:53 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4blxZn3YB6zVBQ; Mon, 21 Jul 2025 12:33:53 +0200 (CEST) From: Quentin Schulz Date: Mon, 21 Jul 2025 12:33:42 +0200 Subject: [PATCH RFC v2 5/6] mesa: use simpler mesa-tools-native recipe as dependency for libclc MIME-Version: 1.0 Message-Id: <20250721-mesa-libclc-panfrost-v2-5-f713d0858949@cherry.de> References: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> In-Reply-To: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Ross Burton , Otavio Salvador , 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 ; Mon, 21 Jul 2025 10:34:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220678 From: Quentin Schulz libclc is required for some drivers (asahi, panfrost and intel at the very least). libclc brings very expensive dependencies such as llvm and clang. Building clang and llvm for each target architecture is very expensive, but mesa allows to depend on prebuilt host binaries (mesa-clc and precomp-compiler). Those are built by mesa as well, but can be compiled in mesa-native instead of mesa, making the dependency expensive but only once regardless of the number of target architectures to build for. Ideally the mesa-clc and precomp-compiler would only be compiled in mesa-native if target mesa requires libclc support, however this is not possible as a target recipe cannot impact or depend on a native recipe's configuration. We thus have two choices, always build libclc in mesa-native with its heavy dependencies and impact every build or force the user to modify the mesa-native recipe in a custom layer (as a native recipe cannot use target's OVERRIDES). The latter is unacceptable so the former seems to be the only option. Another big downside is that mesa-native currently builds drivers (amd, nouveau, svga) which we may have absolutely no interest in building, increasing the build time and possibly dependencies list). A third choice is to spin-off the native mesa recipe with libclc support into a new recipe without drivers and only what's necessary to build mesa-clc and precomp-compiler binaries. This allows to keep a "clean" mesa-native recipe for whoever needs those drivers built-in (e.g. for testing, for qemu-native, or whatever else) and only bring the libclc dependency when required by the target recipe. Because libclc is now only built for the host, opencl support now needs to explicitly bring libclc and others to build as libclc won't bring it in the build environment anymore. Suggested-by: Ross Burton Signed-off-by: Quentin Schulz --- meta/recipes-graphics/mesa/mesa-tools-native.bb | 21 +++++++++++++++++++++ meta/recipes-graphics/mesa/mesa.inc | 11 ++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/meta/recipes-graphics/mesa/mesa-tools-native.bb b/meta/recipes-graphics/mesa/mesa-tools-native.bb new file mode 100644 index 0000000000000000000000000000000000000000..5f7c3a2dc2338e328e0e30b93c263f6c87b61eaa --- /dev/null +++ b/meta/recipes-graphics/mesa/mesa-tools-native.bb @@ -0,0 +1,21 @@ +require mesa.inc +inherit native + +SUMMARY += " (tools only)" + +S = "${UNPACKDIR}/mesa-${PV}" + +PACKAGECONFIG = "tools asahi intel panfrost" +# llvm required for libclc +PACKAGECONFIG += "gallium-llvm" +# Doesn't compile without wayland-scanner if PLATFORMS has wayland in, and, +# doesn't compile at all if PLATFORMS is empty so add x11 and wayland +# to PACKAGECONFIG like in mesa.inc +PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland', d)}" + +DEPENDS += "libclc-native spirv-tools-native spirv-llvm-translator-native" + +EXTRA_OEMESON += " \ + -Dmesa-clc=enabled -Dinstall-mesa-clc=true -Dmesa-clc-bundle-headers=enabled \ + -Dprecomp-compiler=enabled -Dinstall-precomp-compiler=true \ +" diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 5295b70fc9b4bb9570d86333f9229aef9114d93d..0fdb6d19655a06b645c6ac8815dfc62fa7e0c9eb 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -126,7 +126,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" @@ -165,16 +165,9 @@ GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ' GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'amd', ',r600', '', d)}" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}" -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 = "" - 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=system -Dprecomp-compiler=system,,mesa-tools-native" PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial" PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau" From patchwork Mon Jul 21 10:33:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 67185 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 77FCFC83F1A for ; Mon, 21 Jul 2025 10:34:02 +0000 (UTC) Received: from smtp-190b.mail.infomaniak.ch (smtp-190b.mail.infomaniak.ch [185.125.25.11]) by mx.groups.io with SMTP id smtpd.web10.37290.1753094035742325769 for ; Mon, 21 Jul 2025 03:33:56 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 185.125.25.11, mailfrom: foss+yocto@0leil.net) Received: from smtp-4-0000.mail.infomaniak.ch (unknown [IPv6:2001:1600:7:10::a6b]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4blxZp3X4QzPDL; Mon, 21 Jul 2025 12:33:54 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4blxZn6zJrzVHF; Mon, 21 Jul 2025 12:33:53 +0200 (CEST) From: Quentin Schulz Date: Mon, 21 Jul 2025 12:33:43 +0200 Subject: [PATCH RFC v2 6/6] mesa: fix panfrost driver build MIME-Version: 1.0 Message-Id: <20250721-mesa-libclc-panfrost-v2-6-f713d0858949@cherry.de> References: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> In-Reply-To: <20250721-mesa-libclc-panfrost-v2-0-f713d0858949@cherry.de> To: openembedded-core@lists.openembedded.org Cc: Dmitry Baryshkov , Markus Volk , Trevor Woerner , Ross Burton , Otavio Salvador , 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 ; Mon, 21 Jul 2025 10:34:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220679 From: Quentin Schulz Panfrost drivers require libclc, so let's force libclc to be present in the PACKAGECONFIG to build the drivers. Reported-by: Trevor Woerner 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 0fdb6d19655a06b645c6ac8815dfc62fa7e0c9eb..ab86254a25a042763f5415f483b53f3484923e39 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -93,7 +93,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 @@ -182,7 +182,7 @@ PACKAGECONFIG[lima] = "" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}" 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)}"