From b758f1dcb8c5dbe8866985fb7db722eae09c5e1c Mon Sep 17 00:00:00 2001 From: Randolph Sapp Date: Wed, 22 Jan 2025 19:08:17 -0600 Subject: mesa-pvr: version 23.2.1 -> 24.0.1 The gfx library provided by rogue can support this never version of mesa out of the box. Pull it in now that we have ported the SGX side of things. Signed-off-by: Randolph Sapp Signed-off-by: Ryan Eatmon --- .../0001-gallium-Fix-build-with-llvm-17.patch | 40 --------------- ...001-gallium-Fix-build-with-llvm-18-and-19.patch | 53 -------------------- ...isable-cmake-dependency-detector-for-llvm.patch | 42 ---------------- ...on-misdetects-64bit-atomics-on-mips-clang.patch | 25 ---------- ...-check-for-all-linux-host_os-combinations.patch | 43 ---------------- ...Update-lp_bld_misc.cpp-to-support-llvm-19.patch | 38 ++++++++++++++ .../0001-drisw-fix-build-without-dri3.patch | 57 +++++++++++++++++++++ .../0001-gallium-Fix-build-with-llvm-17.patch | 40 +++++++++++++++ ...vm-Call-StringMapIterator-from-llvm-scope.patch | 31 ++++++++++++ ...on-misdetects-64bit-atomics-on-mips-clang.patch | 25 ++++++++++ ...-check-for-all-linux-host_os-combinations.patch | 43 ++++++++++++++++ ...ext-don-t-try-zink-if-not-enabled-in-mesa.patch | 41 +++++++++++++++ .../recipes-graphics/mesa/mesa-pvr_23.2.1.bb | 58 ---------------------- .../recipes-graphics/mesa/mesa-pvr_24.0.1.bb | 54 ++++++++++++++++++++ 14 files changed, 329 insertions(+), 261 deletions(-) delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-17.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-Update-lp_bld_misc.cpp-to-support-llvm-19.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-drisw-fix-build-without-dri3.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallium-Fix-build-with-llvm-17.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallivm-Call-StringMapIterator-from-llvm-scope.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_24.0.1.bb diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-17.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-17.patch deleted file mode 100644 index 738ff267..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-17.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 6d07f6aa7f92f40d78a2db645f16f0f3e7d3c2e8 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 23 Jun 2023 01:20:38 -0700 -Subject: [PATCH] gallium: Fix build with llvm 17 - -These headers are not available for C files in llvm 17+ -and they seem to be not needed to compile after all with llvm 17 -so add conditions to exclude them for llvm >= 17 - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23827] -Signed-off-by: Khem Raj - ---- - src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c -index cd2108f..b1a4d03 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_init.c -+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c -@@ -46,15 +46,19 @@ - #if GALLIVM_USE_NEW_PASS == 1 - #include - #elif GALLIVM_HAVE_CORO == 1 -+#if LLVM_VERSION_MAJOR < 17 - #include --#if LLVM_VERSION_MAJOR >= 7 -+#endif -+#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17 - #include - #endif - #if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64) - #include - #endif -+#if LLVM_VERSION_MAJOR < 17 - #include - #endif -+#endif - - unsigned gallivm_perf = 0; diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch deleted file mode 100644 index ad5059f1..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 6c5033bb01a3a1341d4db5007586a5f2e2727b0a Mon Sep 17 00:00:00 2001 -From: Ryan Eatmon -Date: Mon, 4 Nov 2024 13:37:29 -0600 -Subject: [PATCH] gallium: Fix build with llvm 18 and 19 - -- CodeGenOpt::Level changed to CodeGenOoptLevel. [1] -- llvm::sys::getHostCPUFeatures() now returns the features instead of -modifying the passed in argument. [2] - -Upstream-Status: Backport [1][https://gitlab.freedesktop.org/mesa/mesa/-/commit/f79617fe804ea6524651ff1bc3a91098d3199179] -Upstream-Status: Backport [2][https://gitlab.freedesktop.org/mesa/mesa/-/commit/fa9cd89a85b904615ebc11da609445b5b751e68d] - -Signed-off-by: Ryan Eatmon ---- - src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -index 5e7a30a6cc2..dbc777e3096 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -@@ -366,7 +366,11 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, - builder.setEngineKind(EngineKind::JIT) - .setErrorStr(&Error) - .setTargetOptions(options) -+#if LLVM_VERSION_MAJOR >= 18 -+ .setOptLevel((CodeGenOptLevel)OptLevel); -+#else - .setOptLevel((CodeGenOpt::Level)OptLevel); -+#endif - - #if DETECT_OS_WINDOWS - /* -@@ -394,8 +398,14 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, - * which allows us to enable/disable code generation based - * on the results of cpuid on these architectures. - */ -- llvm::StringMap features; -- llvm::sys::getHostCPUFeatures(features); -+ #if LLVM_VERSION_MAJOR >= 19 -+ /* llvm-19+ returns StringMap from getHostCPUFeatures. -+ */ -+ auto features = llvm::sys::getHostCPUFeatures(); -+ #else -+ llvm::StringMap features; -+ llvm::sys::getHostCPUFeatures(features); -+ #endif - - for (StringMapIterator f = features.begin(); - f != features.end(); --- -2.17.1 - diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch deleted file mode 100644 index 4cded054..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 00d41cd5aa3f4b494dc276c9b4ccdc096310c91f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 28 Sep 2023 15:34:22 -0700 -Subject: [PATCH] meson: use llvm-config instead of cmake to fix linking errors with meson 1.2.1 - -meson dependency auto dependency detection uses cmake and then -config-tool to process dependencies, in mesa the logic to detect llvm is -using auto detection which means if it finds cmake then it will try to -use cmake method. Cmake method works ok except a case when llvm-dev -package is installed on the build host then it generates its own -native.meson file and ignores OE supplied meson.native file which has -correct llvm-config tool specified which is pointing to llvm-config from -native sysroot. The generated meson.native file points to one found in -/usr/bin and there onwards detector finds native install of llvm and -configures that into building native mesa package. - -Since cmake detector does not always work, disable it by default and use -config-tool which works in all cases. This is suggested in below issues -too - -A similar issue is open in meson upstream [1] and mesa [2] - -[1] https://github.com/mesonbuild/meson/issues/10483 -[2] https://gitlab.freedesktop.org/mesa/mesa/-/issues/6738 - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25438] - -Signed-off-by: Khem Raj ---- - meson.build | 1 + - 1 file changed, 1 insertion(+) - ---- a/meson.build -+++ b/meson.build -@@ -1659,6 +1659,7 @@ with_llvm = false - if _llvm.allowed() - dep_llvm = dependency( - 'llvm', -+ method : host_machine.system() == 'windows' ? 'auto' : 'config-tool', - version : _llvm_version, - modules : llvm_modules, - optional_modules : llvm_optional_modules, diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch deleted file mode 100644 index 35bd0ea1..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 3ef37c63f03ad6f2af407de350486fdd25e9132a Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 13 Jan 2020 15:23:47 -0800 -Subject: [PATCH] meson misdetects 64bit atomics on mips/clang - -Upstream-Status: Pending -Signed-off-by: Khem Raj - ---- - src/util/u_atomic.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/util/u_atomic.c b/src/util/u_atomic.c -index 5a5eab4..e499516 100644 ---- a/src/util/u_atomic.c -+++ b/src/util/u_atomic.c -@@ -21,7 +21,7 @@ - * IN THE SOFTWARE. - */ - --#if defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD) -+#if !defined(__clang__) && defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD) - - #include - #include diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch deleted file mode 100644 index e9a6fd3f..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch +++ /dev/null @@ -1,43 +0,0 @@ -From b251af67df5a6840d2e9cc06edae2c387f8778f1 Mon Sep 17 00:00:00 2001 -From: Alistair Francis -Date: Thu, 14 Nov 2019 13:04:49 -0800 -Subject: [PATCH] meson.build: check for all linux host_os combinations - -Make sure that we are also looking for our host_os combinations like -linux-musl etc. when assuming support for DRM/KMS. - -Also delete a duplicate line. - -Upstream-Status: Pending - -Signed-off-by: Anuj Mittal -Signed-off-by: Fabio Berton -Signed-off-by: Otavio Salvador -Signed-off-by: Alistair Francis - ---- - meson.build | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index 22385d8..15f48a6 100644 ---- a/meson.build -+++ b/meson.build -@@ -121,7 +121,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2 - # Only build shared_glapi if at least one OpenGL API is enabled - with_shared_glapi = with_shared_glapi and with_any_opengl - --system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system()) -+system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system()) or host_machine.system().startswith('linux') - - gallium_drivers = get_option('gallium-drivers') - if gallium_drivers.contains('auto') -@@ -909,7 +909,7 @@ if cc.has_function('fmemopen') - endif - - # TODO: this is very incomplete --if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android'].contains(host_machine.system()) -+if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku'].contains(host_machine.system()) or host_machine.system().startswith('linux') - pre_args += '-D_GNU_SOURCE' - elif host_machine.system() == 'sunos' - pre_args += '-D__EXTENSIONS__' diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-Update-lp_bld_misc.cpp-to-support-llvm-19.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-Update-lp_bld_misc.cpp-to-support-llvm-19.patch new file mode 100644 index 00000000..9e5bb342 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-Update-lp_bld_misc.cpp-to-support-llvm-19.patch @@ -0,0 +1,38 @@ +From fa9cd89a85b904615ebc11da609445b5b751e68d Mon Sep 17 00:00:00 2001 +From: Satadru Pramanik +Date: Sat, 5 Oct 2024 13:35:52 +0000 +Subject: [PATCH] Update lp_bld_misc.cpp to support llvm-19+. + +Fixes #11896. +cc: mesa-stable + +Part-of: +Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/commit/fa9cd89a85b904615ebc11da609445b5b751e68d] +Signed-off-by: Randolph Sapp +--- + src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +index 7975fcf1ac9..5b615d627ff 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -329,8 +329,14 @@ lp_build_fill_mattrs(std::vector &MAttrs) + * which allows us to enable/disable code generation based + * on the results of cpuid on these architectures. + */ +- llvm::StringMap features; +- llvm::sys::getHostCPUFeatures(features); ++ #if LLVM_VERSION_MAJOR >= 19 ++ /* llvm-19+ returns StringMap from getHostCPUFeatures. ++ */ ++ auto features = llvm::sys::getHostCPUFeatures(); ++ #else ++ llvm::StringMap features; ++ llvm::sys::getHostCPUFeatures(features); ++ #endif + + for (llvm::StringMapIterator f = features.begin(); + f != features.end(); +-- +2.47.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-drisw-fix-build-without-dri3.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-drisw-fix-build-without-dri3.patch new file mode 100644 index 00000000..9d662b34 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-drisw-fix-build-without-dri3.patch @@ -0,0 +1,57 @@ +From 4bd15a419e892da843489c374c58c5b29c40b5d6 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Tue, 6 Feb 2024 09:47:09 +0100 +Subject: [PATCH 1/2] drisw: fix build without dri3 + +commit 1887368df41 ("glx/sw: check for modifier support in the kopper path") +added dri3_priv.h header and dri3_check_multibuffer() function in drisw that +can be build without dri3. + + i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in function `driswCreateScreenDriver': + drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined reference to `dri3_check_multibuffer' + collect2: error: ld returned 1 exit status + +Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using +dri3_check_multibuffer(). + +Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path") + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478] +Signed-off-by: Romain Naour +Signed-off-by: Khem Raj +--- + src/glx/drisw_glx.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c +index 3d3f752..4b19e2d 100644 +--- a/src/glx/drisw_glx.c ++++ b/src/glx/drisw_glx.c +@@ -32,7 +32,9 @@ + #include + #include "dri_common.h" + #include "drisw_priv.h" ++#ifdef HAVE_DRI3 + #include "dri3_priv.h" ++#endif + #include + #include + #include +@@ -995,6 +997,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, + goto handle_error; + } + ++#ifdef HAVE_DRI3 + if (pdpyp->zink) { + bool err; + psc->has_multibuffer = dri3_check_multibuffer(priv->dpy, &err); +@@ -1005,6 +1008,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, + goto handle_error; + } + } ++#endif + + glx_config_destroy_list(psc->base.configs); + psc->base.configs = configs; +-- +2.44.0 diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallium-Fix-build-with-llvm-17.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallium-Fix-build-with-llvm-17.patch new file mode 100644 index 00000000..738ff267 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallium-Fix-build-with-llvm-17.patch @@ -0,0 +1,40 @@ +From 6d07f6aa7f92f40d78a2db645f16f0f3e7d3c2e8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 23 Jun 2023 01:20:38 -0700 +Subject: [PATCH] gallium: Fix build with llvm 17 + +These headers are not available for C files in llvm 17+ +and they seem to be not needed to compile after all with llvm 17 +so add conditions to exclude them for llvm >= 17 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23827] +Signed-off-by: Khem Raj + +--- + src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c +index cd2108f..b1a4d03 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c ++++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c +@@ -46,15 +46,19 @@ + #if GALLIVM_USE_NEW_PASS == 1 + #include + #elif GALLIVM_HAVE_CORO == 1 ++#if LLVM_VERSION_MAJOR < 17 + #include +-#if LLVM_VERSION_MAJOR >= 7 ++#endif ++#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17 + #include + #endif + #if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64) + #include + #endif ++#if LLVM_VERSION_MAJOR < 17 + #include + #endif ++#endif + + unsigned gallivm_perf = 0; diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallivm-Call-StringMapIterator-from-llvm-scope.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallivm-Call-StringMapIterator-from-llvm-scope.patch new file mode 100644 index 00000000..1751df6f --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallivm-Call-StringMapIterator-from-llvm-scope.patch @@ -0,0 +1,31 @@ +From d17338d403980e1932a42f5d11c2a1fb7b25127b Mon Sep 17 00:00:00 2001 +From: MastaG +Date: Wed, 3 Jul 2024 21:00:42 +0200 +Subject: [PATCH] gallivm: Call StringMapIterator from llvm:: scope + +Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11392 +Fixes: b035d9cab5a4 ("gallivm: use getHostCPUFeatures on x86/llvm-4.0+.") +Reviewed-by: David Heidelberg +Signed-off-by: David Heidelberg +Part-of: +Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/commit/d17338d403980e1932a42f5d11c2a1fb7b25127b] +Signed-off-by: Randolph Sapp +--- + src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +index 95a8a6c6a08..f3c10652ed6 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -332,7 +332,7 @@ lp_build_fill_mattrs(std::vector &MAttrs) + llvm::StringMap features; + llvm::sys::getHostCPUFeatures(features); + +- for (StringMapIterator f = features.begin(); ++ for (llvm::StringMapIterator f = features.begin(); + f != features.end(); + ++f) { + MAttrs.push_back(((*f).second ? "+" : "-") + (*f).first().str()); +-- +2.47.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch new file mode 100644 index 00000000..35bd0ea1 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch @@ -0,0 +1,25 @@ +From 3ef37c63f03ad6f2af407de350486fdd25e9132a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 13 Jan 2020 15:23:47 -0800 +Subject: [PATCH] meson misdetects 64bit atomics on mips/clang + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +--- + src/util/u_atomic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/util/u_atomic.c b/src/util/u_atomic.c +index 5a5eab4..e499516 100644 +--- a/src/util/u_atomic.c ++++ b/src/util/u_atomic.c +@@ -21,7 +21,7 @@ + * IN THE SOFTWARE. + */ + +-#if defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD) ++#if !defined(__clang__) && defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD) + + #include + #include diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch new file mode 100644 index 00000000..964e0a44 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch @@ -0,0 +1,43 @@ +From f2fe76d506f356de055b8eca83a7c9d0744a40af Mon Sep 17 00:00:00 2001 +From: Alistair Francis +Date: Thu, 14 Nov 2019 13:04:49 -0800 +Subject: [PATCH] meson.build: check for all linux host_os combinations + +Make sure that we are also looking for our host_os combinations like +linux-musl etc. when assuming support for DRM/KMS. + +Also delete a duplicate line. + +Upstream-Status: Pending + +Signed-off-by: Anuj Mittal +Signed-off-by: Fabio Berton +Signed-off-by: Otavio Salvador +Signed-off-by: Alistair Francis + +--- + meson.build | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 35cc5f1..9a49c0d 100644 +--- a/meson.build ++++ b/meson.build +@@ -128,7 +128,7 @@ + # Only build shared_glapi if at least one OpenGL API is enabled + with_shared_glapi = with_shared_glapi and with_any_opengl + +-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm'].contains(host_machine.system()) ++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm'].contains(host_machine.system()) or host_machine.system().startswith('linux') + + gallium_drivers = get_option('gallium-drivers') + if gallium_drivers.contains('auto') +@@ -998,7 +998,7 @@ + endif + + # TODO: this is very incomplete +-if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android', 'managarm'].contains(host_machine.system()) ++if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android', 'managarm'].contains(host_machine.system()) or host_machine.system().startswith('linux') + pre_args += '-D_GNU_SOURCE' + elif host_machine.system() == 'sunos' + pre_args += '-D__EXTENSIONS__' diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch new file mode 100644 index 00000000..1203c446 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch @@ -0,0 +1,41 @@ +From 62495ebb977866c52d5bed8499a547c49f0d9bc1 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Tue, 6 Feb 2024 09:47:10 +0100 +Subject: [PATCH 2/2] glxext: don't try zink if not enabled in mesa + +Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") +added an automatic zink fallback even when the zink gallium is not +enabled at build time. + +It leads to unexpected error log while loading drisw driver and +zink is not installed on the rootfs: + + MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so + +Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478] +Signed-off-by: Romain Naour +Signed-off-by: Khem Raj +--- + src/glx/glxext.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/glx/glxext.c b/src/glx/glxext.c +index 05c825a..7a06aa9 100644 +--- a/src/glx/glxext.c ++++ b/src/glx/glxext.c +@@ -908,9 +908,11 @@ __glXInitialize(Display * dpy) + #endif /* HAVE_DRI3 */ + if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false)) + dpyPriv->dri2Display = dri2CreateDisplay(dpy); ++#if defined(HAVE_ZINK) + if (!dpyPriv->dri3Display && !dpyPriv->dri2Display) + try_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && + !getenv("GALLIUM_DRIVER"); ++#endif /* HAVE_ZINK */ + } + #endif /* GLX_USE_DRM */ + if (glx_direct) +-- +2.44.0 diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb deleted file mode 100644 index cdff372a..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb +++ /dev/null @@ -1,58 +0,0 @@ -# PowerVR Graphics require several patches that have not made their way -# upstream yet. This allows us to build the shims we need without completely -# clobbering mesa. - -require recipes-graphics/mesa/mesa.inc - -SUMMARY += " (with PowerVR support for TI platforms)" - -LIC_FILES_CHKSUM = "file://docs/license.rst;md5=63779ec98d78d823a9dc533a0735ef10" - -BRANCH = "powervr/${PV}" - -SRC_URI = " \ - git://gitlab.freedesktop.org/StaticRocket/mesa.git;protocol=https;branch=${BRANCH} \ - file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ - file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ - file://0001-gallium-Fix-build-with-llvm-17.patch \ - file://0001-meson-Disable-cmake-dependency-detector-for-llvm.patch \ - file://0001-gallium-Fix-build-with-llvm-18-and-19.patch \ -" - -S = "${WORKDIR}/git" - -PACKAGECONFIG:append = " \ - ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-img-rogue-driver', 'pvr', '', d)} \ - ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-sgx-ddk-km', 'sgx', '', d)} \ -" - -SRCREV = "0e75e7ded360ea6aee4140393b30960e152f3994" -PV = "23.2.1" - -PVR_DISPLAY_CONTROLLER_ALIAS ??= "tidss" -PACKAGECONFIG[pvr] = "-Dgallium-pvr-alias=${PVR_DISPLAY_CONTROLLER_ALIAS}," -PACKAGECONFIG[sgx] = "-Dgallium-sgx-alias=${PVR_DISPLAY_CONTROLLER_ALIAS}," - -PACKAGECONFIG:remove = "video-codecs" -PACKAGECONFIG[video-codecs] = "" -PACKAGECONFIG:remove = "elf-tls" -PACKAGECONFIG[elf-tls] = "" -PACKAGECONFIG:remove = "xvmc" -PACKAGECONFIG[xvmc] = "" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}" -GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'sgx', ',sgx', '', d)}" - -VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}" - -do_install:append () { - # remove pvr custom pkgconfig - rm -rf ${D}${datadir}/pkgconfig -} - -FILES:${PN}-dev += "${datadir}/mesa/wayland-drm.xml" -FILES:mesa-vulkan-drivers += "${libdir}/libpvr_mesa_wsi.so" - -RRECOMMENDS:mesa-megadriver:append:class-target = " ${@d.getVar('PREFERRED_PROVIDER_virtual/gpudriver')}" diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_24.0.1.bb b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_24.0.1.bb new file mode 100644 index 00000000..1ac022d2 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_24.0.1.bb @@ -0,0 +1,54 @@ +# PowerVR Graphics require several patches that have not made their way +# upstream yet. This allows us to build the shims we need without completely +# clobbering mesa. + +require recipes-graphics/mesa/mesa.inc + +SUMMARY += " (with PowerVR support for TI platforms)" + +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=63779ec98d78d823a9dc533a0735ef10" + +BRANCH = "powervr/${PV}" + +SRC_URI = " \ + git://gitlab.freedesktop.org/StaticRocket/mesa.git;protocol=https;branch=${BRANCH} \ + file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ + file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ + file://0001-gallium-Fix-build-with-llvm-17.patch \ + file://0001-drisw-fix-build-without-dri3.patch \ + file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \ + file://0001-gallivm-Call-StringMapIterator-from-llvm-scope.patch \ + file://0001-Update-lp_bld_misc.cpp-to-support-llvm-19.patch \ +" + +S = "${WORKDIR}/git" + +PACKAGECONFIG:append = " \ + ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-img-rogue-driver', 'pvr', '', d)} \ + ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-sgx-ddk-km', 'sgx', '', d)} \ +" + +SRCREV = "82e6a9293c476267417c5b6b906b01fb73a34e38" +PV = "24.0.1" + +PVR_DISPLAY_CONTROLLER_ALIAS ??= "tidss" +PACKAGECONFIG[pvr] = "-Dgallium-pvr-alias=${PVR_DISPLAY_CONTROLLER_ALIAS}," +PACKAGECONFIG[sgx] = "-Dgallium-sgx-alias=${PVR_DISPLAY_CONTROLLER_ALIAS}," + + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}" +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'sgx', ',sgx', '', d)}" + +VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}" + +do_install:append () { + # remove pvr custom pkgconfig + rm -rf ${D}${datadir}/pkgconfig +} + +FILES:${PN}-dev += "${datadir}/mesa/wayland-drm.xml" +FILES:mesa-vulkan-drivers += "${libdir}/libpvr_mesa_wsi.so" + +RRECOMMENDS:mesa-megadriver:append:class-target = " ${@d.getVar('PREFERRED_PROVIDER_virtual/gpudriver')}" -- cgit v1.2.3-54-g00ecf