From 17a32b9eb04080cbbdcc57f442f2676fb7b53a4b Mon Sep 17 00:00:00 2001 From: Randolph Sapp Date: Thu, 30 Jan 2025 17:26:51 -0600 Subject: mesa-pvr: relocate 22.3.5 patches Relocate the patches for 22.3.5 to the mesa-pvr-22.3.5 subdirectory so it's more clear what version of mesa they apply to. Signed-off-by: Randolph Sapp Signed-off-by: Ryan Eatmon --- ...-limit-usage-of-LLVMContextSetOpaquePoint.patch | 128 --------------------- ...m4-Use-unsigned-instead-of-uint-to-fix-mu.patch | 43 ------- .../0001-gallium-Fix-build-with-llvm-17.patch | 58 ---------- ...1-gbm-backend-fix-gbm-compile-without-dri.patch | 64 ----------- ...on-misdetects-64bit-atomics-on-mips-clang.patch | 25 ---- ...-check-for-all-linux-host_os-combinations.patch | 43 ------- ...til-format-Check-for-NEON-before-using-it.patch | 47 -------- ...-limit-usage-of-LLVMContextSetOpaquePoint.patch | 128 +++++++++++++++++++++ ...m4-Use-unsigned-instead-of-uint-to-fix-mu.patch | 43 +++++++ .../0001-gallium-Fix-build-with-llvm-17.patch | 58 ++++++++++ ...1-gbm-backend-fix-gbm-compile-without-dri.patch | 64 +++++++++++ ...on-misdetects-64bit-atomics-on-mips-clang.patch | 25 ++++ ...-check-for-all-linux-host_os-combinations.patch | 43 +++++++ ...til-format-Check-for-NEON-before-using-it.patch | 47 ++++++++ 14 files changed, 408 insertions(+), 408 deletions(-) delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch delete mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gallium-Fix-build-with-llvm-17.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gbm-backend-fix-gbm-compile-without-dri.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-meson.build-check-for-all-linux-host_os-combinations.patch create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-util-format-Check-for-NEON-before-using-it.patch diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch deleted file mode 100644 index 905fad04..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/files/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 1a894699354f5f984f31e5d3418b651edf486df9 Mon Sep 17 00:00:00 2001 -From: Ryan Eatmon -Date: Fri, 22 Sep 2023 22:32:41 -0500 -Subject: [PATCH] fix: gallivm: limit usage of LLVMContextSetOpaquePointers() - to LLVM 15 - -LLVMContextSetOpaquePointers() was a temporary workaround offered to -allow transitioning to opaque pointers. Mesa is ready for this now with -recent versions of LLVM (16+). Therefore we limit the workaround of -using LLVMContextSetOpaquePointers() to LLVM 15 now, that this C -interface was removed in LLVM 17. - -Reference: https://github.com/llvm/llvm-project/commit/1270879376025457e266572c7cccc51eb5de9276 - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21124] -Signed-off-by: Ryan Eatmon ---- - src/gallium/auxiliary/draw/draw_llvm.c | 2 +- - src/gallium/drivers/llvmpipe/lp_context.c | 2 +- - src/gallium/drivers/llvmpipe/lp_test_arit.c | 2 +- - src/gallium/drivers/llvmpipe/lp_test_blend.c | 2 +- - src/gallium/drivers/llvmpipe/lp_test_conv.c | 2 +- - src/gallium/drivers/llvmpipe/lp_test_format.c | 4 ++-- - src/gallium/drivers/llvmpipe/lp_test_printf.c | 2 +- - 7 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c -index 50c157bc3cc..8b3a1522725 100644 ---- a/src/gallium/auxiliary/draw/draw_llvm.c -+++ b/src/gallium/auxiliary/draw/draw_llvm.c -@@ -784,7 +784,7 @@ draw_llvm_create(struct draw_context *draw, LLVMContextRef context) - if (!llvm->context) { - llvm->context = LLVMContextCreate(); - --#if LLVM_VERSION_MAJOR >= 15 -+#if LLVM_VERSION_MAJOR == 15 - LLVMContextSetOpaquePointers(llvm->context, false); - #endif - -diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c -index 8309335aebc..0ef4317fc76 100644 ---- a/src/gallium/drivers/llvmpipe/lp_context.c -+++ b/src/gallium/drivers/llvmpipe/lp_context.c -@@ -263,7 +263,7 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv, - if (!llvmpipe->context) - goto fail; - --#if LLVM_VERSION_MAJOR >= 15 -+#if LLVM_VERSION_MAJOR == 15 - LLVMContextSetOpaquePointers(llvmpipe->context, false); - #endif - -diff --git a/src/gallium/drivers/llvmpipe/lp_test_arit.c b/src/gallium/drivers/llvmpipe/lp_test_arit.c -index 4118928d52e..565b1c47753 100644 ---- a/src/gallium/drivers/llvmpipe/lp_test_arit.c -+++ b/src/gallium/drivers/llvmpipe/lp_test_arit.c -@@ -434,7 +434,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned - } - - context = LLVMContextCreate(); --#if LLVM_VERSION_MAJOR >= 15 -+#if LLVM_VERSION_MAJOR == 15 - LLVMContextSetOpaquePointers(context, false); - #endif - gallivm = gallivm_create("test_module", context, NULL); -diff --git a/src/gallium/drivers/llvmpipe/lp_test_blend.c b/src/gallium/drivers/llvmpipe/lp_test_blend.c -index 37c3f731eaf..3d2899a78d4 100644 ---- a/src/gallium/drivers/llvmpipe/lp_test_blend.c -+++ b/src/gallium/drivers/llvmpipe/lp_test_blend.c -@@ -452,7 +452,7 @@ test_one(unsigned verbose, - dump_blend_type(stdout, blend, type); - - context = LLVMContextCreate(); --#if LLVM_VERSION_MAJOR >= 15 -+#if LLVM_VERSION_MAJOR == 15 - LLVMContextSetOpaquePointers(context, false); - #endif - gallivm = gallivm_create("test_module", context, NULL); -diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c -index c7ea9efc12d..83236f0c0ba 100644 ---- a/src/gallium/drivers/llvmpipe/lp_test_conv.c -+++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c -@@ -223,7 +223,7 @@ test_one(unsigned verbose, - } - - context = LLVMContextCreate(); --#if LLVM_VERSION_MAJOR >= 15 -+#if LLVM_VERSION_MAJOR == 15 - LLVMContextSetOpaquePointers(context, false); - #endif - gallivm = gallivm_create("test_module", context, NULL); -diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c -index 0a2a1e449e8..89f7d5dec1a 100644 ---- a/src/gallium/drivers/llvmpipe/lp_test_format.c -+++ b/src/gallium/drivers/llvmpipe/lp_test_format.c -@@ -150,7 +150,7 @@ test_format_float(unsigned verbose, FILE *fp, - unsigned i, j, k, l; - - context = LLVMContextCreate(); --#if LLVM_VERSION_MAJOR >= 15 -+#if LLVM_VERSION_MAJOR == 15 - LLVMContextSetOpaquePointers(context, false); - #endif - gallivm = gallivm_create("test_module_float", context, NULL); -@@ -254,7 +254,7 @@ test_format_unorm8(unsigned verbose, FILE *fp, - unsigned i, j, k, l; - - context = LLVMContextCreate(); --#if LLVM_VERSION_MAJOR >= 15 -+#if LLVM_VERSION_MAJOR == 15 - LLVMContextSetOpaquePointers(context, false); - #endif - gallivm = gallivm_create("test_module_unorm8", context, NULL); -diff --git a/src/gallium/drivers/llvmpipe/lp_test_printf.c b/src/gallium/drivers/llvmpipe/lp_test_printf.c -index b3de9cb9e8b..850c0abfe22 100644 ---- a/src/gallium/drivers/llvmpipe/lp_test_printf.c -+++ b/src/gallium/drivers/llvmpipe/lp_test_printf.c -@@ -96,7 +96,7 @@ test_printf(unsigned verbose, FILE *fp, - boolean success = TRUE; - - context = LLVMContextCreate(); --#if LLVM_VERSION_MAJOR >= 15 -+#if LLVM_VERSION_MAJOR == 15 - LLVMContextSetOpaquePointers(context, false); - #endif - gallivm = gallivm_create("test_module", context, NULL); --- -2.17.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch deleted file mode 100644 index f0775176..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 8a5de0b6cf1090d7f29f3974ec79c32776cf2745 Mon Sep 17 00:00:00 2001 -From: Jami Kettunen -Date: Tue, 31 Aug 2021 00:15:58 +0300 -Subject: [PATCH] freedreno/pm4: Use unsigned instead of uint to fix musl build - -Upstream-Status: Backport - -Fixes the following error I noticed when building against aarch64 with -musl libc: - - In file included from ../src/freedreno/decode/crashdec.h:38, - from ../src/freedreno/decode/crashdec.c:40: - ../src/freedreno/common/freedreno_pm4.h:104:15: error: unknown type name 'uint' - 104 | static inline uint - | ^~~~ - ../src/freedreno/common/freedreno_pm4.h:105:25: error: unknown type name 'uint'; did you mean 'int'? - 105 | pm4_calc_odd_parity_bit(uint val) - | ^~~~ - | int - -Signed-off-by: Jami Kettunen -Part-of: ---- - src/freedreno/common/freedreno_pm4.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/freedreno/common/freedreno_pm4.h b/src/freedreno/common/freedreno_pm4.h -index 8f958953d693..091247e709a0 100644 ---- a/src/freedreno/common/freedreno_pm4.h -+++ b/src/freedreno/common/freedreno_pm4.h -@@ -105,8 +105,8 @@ pm4_pkt7_hdr(uint8_t opcode, uint16_t cnt) - #define cp_type3_opcode(pkt) (((pkt) >> 8) & 0xFF) - #define type3_pkt_size(pkt) ((((pkt) >> 16) & 0x3FFF) + 1) - --static inline uint --pm4_calc_odd_parity_bit(uint val) -+static inline unsigned -+pm4_calc_odd_parity_bit(unsigned val) - { - return (0x9669 >> (0xf & ((val) ^ ((val) >> 4) ^ ((val) >> 8) ^ - ((val) >> 12) ^ ((val) >> 16) ^ ((val) >> 20) ^ --- -2.39.2 diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch deleted file mode 100644 index bdfe7bb8..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 2dfe0f899aeb415a5491b8c67e208673d2a2914f Mon Sep 17 00:00:00 2001 -From: Ryan Eatmon -Date: Fri, 22 Sep 2023 21:50:08 -0500 -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/21262] -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22980] -Signed-off-by: Ryan Eatmon ---- - src/gallium/auxiliary/gallivm/lp_bld_init.c | 8 ++++---- - src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 4 ++++ - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c -index 584ea738668..fe8bb2b11af 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_init.c -+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c -@@ -42,14 +42,14 @@ - - #include - #include --#include --#if LLVM_VERSION_MAJOR >= 7 --#include --#endif - #include - #if GALLIVM_USE_NEW_PASS == 1 - #include - #elif GALLIVM_HAVE_CORO == 1 -+#include -+#if LLVM_VERSION_MAJOR >= 7 -+#include -+#endif - #if LLVM_VERSION_MAJOR <= 8 && (defined(PIPE_ARCH_AARCH64) || defined (PIPE_ARCH_ARM) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_MIPS64)) - #include - #endif -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -index 2279e5acb28..0caeaf94263 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -@@ -56,7 +56,11 @@ - #include - #include - #include -+#if LLVM_VERSION_MAJOR >= 17 -+#include -+#else - #include -+#endif - #include - #include - #include --- -2.17.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch deleted file mode 100644 index 289ff032..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 25946100e21cf2095bea334e8d7096798561d0b7 Mon Sep 17 00:00:00 2001 -From: Vincent Davis Jr -Date: Wed, 28 Dec 2022 16:28:01 -0600 -Subject: [PATCH] gbm/backend: fix gbm compile without dri - -Upstream-Status: Backport - -https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20447 -https://gitlab.freedesktop.org/mesa/mesa/-/commit/842ca284650f066e58706741a7d22d67b5088e60 - -At mesa version 22.2.3 patch wasn't introduced until after. - -Commit introduces a fix that allows for gbm to be built with an empty -backend. There are situation especially in a Yocto/OE cross compilation -environment where you want to build with an empty backend. The particular -situation is as such: - -The mesa-gl recipe is the preferred provider for virtual/libgbm, virtual/libgl, -virtual/mesa, etc... But the x11 DISTRO_FEATURE in't included this leads to build -errors such as: - -| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o: in function `find_backend': -| backend.c:(.text.find_backend+0xa4): undefined reference to `gbm_dri_backend' -| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o:(.data.rel.ro.builtin_backends+0x4): - undefined reference to `gbm_dri_backend' -| collect2: error: ld returned 1 exit status - -Issue should be replicable by setting -Ddri3=disabled and -Dgbm=enabled - -Add fix to bypasses compilation issue by excluding gbm dri backend. If -HAVE_DRI || HAVE_DRIX not specified. - -Acked-by: David Heidelberg -Signed-off-by: Vincent Davis Jr ---- - src/gbm/main/backend.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/gbm/main/backend.c b/src/gbm/main/backend.c -index 974d0a76a4e..feee0703495 100644 ---- a/src/gbm/main/backend.c -+++ b/src/gbm/main/backend.c -@@ -42,7 +42,9 @@ - #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) - #define VER_MIN(a, b) ((a) < (b) ? (a) : (b)) - -+#if defined(HAVE_DRI) || defined(HAVE_DRI2) || defined(HAVE_DRI3) - extern const struct gbm_backend gbm_dri_backend; -+#endif - - struct gbm_backend_desc { - const char *name; -@@ -51,7 +53,9 @@ struct gbm_backend_desc { - }; - - static const struct gbm_backend_desc builtin_backends[] = { -+#if defined(HAVE_DRI) || defined(HAVE_DRI2) || defined(HAVE_DRI3) - { "dri", &gbm_dri_backend }, -+#endif - }; - - #define BACKEND_LIB_SUFFIX "_gbm" --- -2.34.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch deleted file mode 100644 index 35bd0ea1..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/files/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/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch deleted file mode 100644 index f0c1de46..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 3b4d6b89f644b43e507c08181fef06db4326f9da 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 172c64a..9b5294c 100644 ---- a/meson.build -+++ b/meson.build -@@ -173,7 +173,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') - - with_freedreno_kgsl = get_option('freedreno-kgsl') - if with_freedreno_kgsl -@@ -1076,7 +1076,7 @@ if cc.has_function('reallocarray') - 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/files/0001-util-format-Check-for-NEON-before-using-it.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch deleted file mode 100644 index 6eea5ed8..00000000 --- a/meta-ti-bsp/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch +++ /dev/null @@ -1,47 +0,0 @@ -From f17e836ef9b1bbc6056790596420b699e48128c2 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 2 Dec 2021 19:57:42 -0800 -Subject: [PATCH] util/format: Check for NEON before using it - -This fixes build on rpi0-w and any other machine which does not have -neon unit and is not used as FPU unit - -Fixes errors e.g. - -In file included from ../mesa-21.3.0/src/util/format/u_format_unpack_neon.c:35: -/mnt/b/yoe/master/build/tmp/work/arm1176jzfshf-vfp-yoe-linux-gnueabi/mesa/2_21.3.0-r0/recipe-sysroot-native/usr/lib/clang/13.0.1/include/arm_neon.h:32:2: error: "NEON support not enabled" - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14032] -Signed-off-by: Khem Raj - ---- - src/util/format/u_format.c | 2 +- - src/util/format/u_format_unpack_neon.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/util/format/u_format.c b/src/util/format/u_format.c -index c071250..0880984 100644 ---- a/src/util/format/u_format.c -+++ b/src/util/format/u_format.c -@@ -1184,7 +1184,7 @@ static void - util_format_unpack_table_init(void) - { - for (enum pipe_format format = PIPE_FORMAT_NONE; format < PIPE_FORMAT_COUNT; format++) { --#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) -+#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) - const struct util_format_unpack_description *unpack = util_format_unpack_description_neon(format); - if (unpack) { - util_format_unpack_table[format] = unpack; -diff --git a/src/util/format/u_format_unpack_neon.c b/src/util/format/u_format_unpack_neon.c -index a4a5cb1..1e4f794 100644 ---- a/src/util/format/u_format_unpack_neon.c -+++ b/src/util/format/u_format_unpack_neon.c -@@ -23,7 +23,7 @@ - - #include - --#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) -+#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) - - /* armhf builds default to vfp, not neon, and refuses to compile neon intrinsics - * unless you tell it "no really". diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch new file mode 100644 index 00000000..905fad04 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch @@ -0,0 +1,128 @@ +From 1a894699354f5f984f31e5d3418b651edf486df9 Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon +Date: Fri, 22 Sep 2023 22:32:41 -0500 +Subject: [PATCH] fix: gallivm: limit usage of LLVMContextSetOpaquePointers() + to LLVM 15 + +LLVMContextSetOpaquePointers() was a temporary workaround offered to +allow transitioning to opaque pointers. Mesa is ready for this now with +recent versions of LLVM (16+). Therefore we limit the workaround of +using LLVMContextSetOpaquePointers() to LLVM 15 now, that this C +interface was removed in LLVM 17. + +Reference: https://github.com/llvm/llvm-project/commit/1270879376025457e266572c7cccc51eb5de9276 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21124] +Signed-off-by: Ryan Eatmon +--- + src/gallium/auxiliary/draw/draw_llvm.c | 2 +- + src/gallium/drivers/llvmpipe/lp_context.c | 2 +- + src/gallium/drivers/llvmpipe/lp_test_arit.c | 2 +- + src/gallium/drivers/llvmpipe/lp_test_blend.c | 2 +- + src/gallium/drivers/llvmpipe/lp_test_conv.c | 2 +- + src/gallium/drivers/llvmpipe/lp_test_format.c | 4 ++-- + src/gallium/drivers/llvmpipe/lp_test_printf.c | 2 +- + 7 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c +index 50c157bc3cc..8b3a1522725 100644 +--- a/src/gallium/auxiliary/draw/draw_llvm.c ++++ b/src/gallium/auxiliary/draw/draw_llvm.c +@@ -784,7 +784,7 @@ draw_llvm_create(struct draw_context *draw, LLVMContextRef context) + if (!llvm->context) { + llvm->context = LLVMContextCreate(); + +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(llvm->context, false); + #endif + +diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c +index 8309335aebc..0ef4317fc76 100644 +--- a/src/gallium/drivers/llvmpipe/lp_context.c ++++ b/src/gallium/drivers/llvmpipe/lp_context.c +@@ -263,7 +263,7 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv, + if (!llvmpipe->context) + goto fail; + +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(llvmpipe->context, false); + #endif + +diff --git a/src/gallium/drivers/llvmpipe/lp_test_arit.c b/src/gallium/drivers/llvmpipe/lp_test_arit.c +index 4118928d52e..565b1c47753 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_arit.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_arit.c +@@ -434,7 +434,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned + } + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module", context, NULL); +diff --git a/src/gallium/drivers/llvmpipe/lp_test_blend.c b/src/gallium/drivers/llvmpipe/lp_test_blend.c +index 37c3f731eaf..3d2899a78d4 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_blend.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_blend.c +@@ -452,7 +452,7 @@ test_one(unsigned verbose, + dump_blend_type(stdout, blend, type); + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module", context, NULL); +diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c +index c7ea9efc12d..83236f0c0ba 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_conv.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c +@@ -223,7 +223,7 @@ test_one(unsigned verbose, + } + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module", context, NULL); +diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c +index 0a2a1e449e8..89f7d5dec1a 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_format.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_format.c +@@ -150,7 +150,7 @@ test_format_float(unsigned verbose, FILE *fp, + unsigned i, j, k, l; + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module_float", context, NULL); +@@ -254,7 +254,7 @@ test_format_unorm8(unsigned verbose, FILE *fp, + unsigned i, j, k, l; + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module_unorm8", context, NULL); +diff --git a/src/gallium/drivers/llvmpipe/lp_test_printf.c b/src/gallium/drivers/llvmpipe/lp_test_printf.c +index b3de9cb9e8b..850c0abfe22 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_printf.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_printf.c +@@ -96,7 +96,7 @@ test_printf(unsigned verbose, FILE *fp, + boolean success = TRUE; + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module", context, NULL); +-- +2.17.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch new file mode 100644 index 00000000..f0775176 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch @@ -0,0 +1,43 @@ +From 8a5de0b6cf1090d7f29f3974ec79c32776cf2745 Mon Sep 17 00:00:00 2001 +From: Jami Kettunen +Date: Tue, 31 Aug 2021 00:15:58 +0300 +Subject: [PATCH] freedreno/pm4: Use unsigned instead of uint to fix musl build + +Upstream-Status: Backport + +Fixes the following error I noticed when building against aarch64 with +musl libc: + + In file included from ../src/freedreno/decode/crashdec.h:38, + from ../src/freedreno/decode/crashdec.c:40: + ../src/freedreno/common/freedreno_pm4.h:104:15: error: unknown type name 'uint' + 104 | static inline uint + | ^~~~ + ../src/freedreno/common/freedreno_pm4.h:105:25: error: unknown type name 'uint'; did you mean 'int'? + 105 | pm4_calc_odd_parity_bit(uint val) + | ^~~~ + | int + +Signed-off-by: Jami Kettunen +Part-of: +--- + src/freedreno/common/freedreno_pm4.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/freedreno/common/freedreno_pm4.h b/src/freedreno/common/freedreno_pm4.h +index 8f958953d693..091247e709a0 100644 +--- a/src/freedreno/common/freedreno_pm4.h ++++ b/src/freedreno/common/freedreno_pm4.h +@@ -105,8 +105,8 @@ pm4_pkt7_hdr(uint8_t opcode, uint16_t cnt) + #define cp_type3_opcode(pkt) (((pkt) >> 8) & 0xFF) + #define type3_pkt_size(pkt) ((((pkt) >> 16) & 0x3FFF) + 1) + +-static inline uint +-pm4_calc_odd_parity_bit(uint val) ++static inline unsigned ++pm4_calc_odd_parity_bit(unsigned val) + { + return (0x9669 >> (0xf & ((val) ^ ((val) >> 4) ^ ((val) >> 8) ^ + ((val) >> 12) ^ ((val) >> 16) ^ ((val) >> 20) ^ +-- +2.39.2 diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gallium-Fix-build-with-llvm-17.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gallium-Fix-build-with-llvm-17.patch new file mode 100644 index 00000000..bdfe7bb8 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gallium-Fix-build-with-llvm-17.patch @@ -0,0 +1,58 @@ +From 2dfe0f899aeb415a5491b8c67e208673d2a2914f Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon +Date: Fri, 22 Sep 2023 21:50:08 -0500 +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/21262] +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22980] +Signed-off-by: Ryan Eatmon +--- + src/gallium/auxiliary/gallivm/lp_bld_init.c | 8 ++++---- + src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 4 ++++ + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c +index 584ea738668..fe8bb2b11af 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c ++++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c +@@ -42,14 +42,14 @@ + + #include + #include +-#include +-#if LLVM_VERSION_MAJOR >= 7 +-#include +-#endif + #include + #if GALLIVM_USE_NEW_PASS == 1 + #include + #elif GALLIVM_HAVE_CORO == 1 ++#include ++#if LLVM_VERSION_MAJOR >= 7 ++#include ++#endif + #if LLVM_VERSION_MAJOR <= 8 && (defined(PIPE_ARCH_AARCH64) || defined (PIPE_ARCH_ARM) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_MIPS64)) + #include + #endif +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +index 2279e5acb28..0caeaf94263 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -56,7 +56,11 @@ + #include + #include + #include ++#if LLVM_VERSION_MAJOR >= 17 ++#include ++#else + #include ++#endif + #include + #include + #include +-- +2.17.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gbm-backend-fix-gbm-compile-without-dri.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gbm-backend-fix-gbm-compile-without-dri.patch new file mode 100644 index 00000000..289ff032 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gbm-backend-fix-gbm-compile-without-dri.patch @@ -0,0 +1,64 @@ +From 25946100e21cf2095bea334e8d7096798561d0b7 Mon Sep 17 00:00:00 2001 +From: Vincent Davis Jr +Date: Wed, 28 Dec 2022 16:28:01 -0600 +Subject: [PATCH] gbm/backend: fix gbm compile without dri + +Upstream-Status: Backport + +https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20447 +https://gitlab.freedesktop.org/mesa/mesa/-/commit/842ca284650f066e58706741a7d22d67b5088e60 + +At mesa version 22.2.3 patch wasn't introduced until after. + +Commit introduces a fix that allows for gbm to be built with an empty +backend. There are situation especially in a Yocto/OE cross compilation +environment where you want to build with an empty backend. The particular +situation is as such: + +The mesa-gl recipe is the preferred provider for virtual/libgbm, virtual/libgl, +virtual/mesa, etc... But the x11 DISTRO_FEATURE in't included this leads to build +errors such as: + +| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o: in function `find_backend': +| backend.c:(.text.find_backend+0xa4): undefined reference to `gbm_dri_backend' +| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o:(.data.rel.ro.builtin_backends+0x4): + undefined reference to `gbm_dri_backend' +| collect2: error: ld returned 1 exit status + +Issue should be replicable by setting -Ddri3=disabled and -Dgbm=enabled + +Add fix to bypasses compilation issue by excluding gbm dri backend. If +HAVE_DRI || HAVE_DRIX not specified. + +Acked-by: David Heidelberg +Signed-off-by: Vincent Davis Jr +--- + src/gbm/main/backend.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/gbm/main/backend.c b/src/gbm/main/backend.c +index 974d0a76a4e..feee0703495 100644 +--- a/src/gbm/main/backend.c ++++ b/src/gbm/main/backend.c +@@ -42,7 +42,9 @@ + #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) + #define VER_MIN(a, b) ((a) < (b) ? (a) : (b)) + ++#if defined(HAVE_DRI) || defined(HAVE_DRI2) || defined(HAVE_DRI3) + extern const struct gbm_backend gbm_dri_backend; ++#endif + + struct gbm_backend_desc { + const char *name; +@@ -51,7 +53,9 @@ struct gbm_backend_desc { + }; + + static const struct gbm_backend_desc builtin_backends[] = { ++#if defined(HAVE_DRI) || defined(HAVE_DRI2) || defined(HAVE_DRI3) + { "dri", &gbm_dri_backend }, ++#endif + }; + + #define BACKEND_LIB_SUFFIX "_gbm" +-- +2.34.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/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-22.3.5/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-22.3.5/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-meson.build-check-for-all-linux-host_os-combinations.patch new file mode 100644 index 00000000..f0c1de46 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-meson.build-check-for-all-linux-host_os-combinations.patch @@ -0,0 +1,43 @@ +From 3b4d6b89f644b43e507c08181fef06db4326f9da 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 172c64a..9b5294c 100644 +--- a/meson.build ++++ b/meson.build +@@ -173,7 +173,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') + + with_freedreno_kgsl = get_option('freedreno-kgsl') + if with_freedreno_kgsl +@@ -1076,7 +1076,7 @@ if cc.has_function('reallocarray') + 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-22.3.5/0001-util-format-Check-for-NEON-before-using-it.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-util-format-Check-for-NEON-before-using-it.patch new file mode 100644 index 00000000..6eea5ed8 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-util-format-Check-for-NEON-before-using-it.patch @@ -0,0 +1,47 @@ +From f17e836ef9b1bbc6056790596420b699e48128c2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 2 Dec 2021 19:57:42 -0800 +Subject: [PATCH] util/format: Check for NEON before using it + +This fixes build on rpi0-w and any other machine which does not have +neon unit and is not used as FPU unit + +Fixes errors e.g. + +In file included from ../mesa-21.3.0/src/util/format/u_format_unpack_neon.c:35: +/mnt/b/yoe/master/build/tmp/work/arm1176jzfshf-vfp-yoe-linux-gnueabi/mesa/2_21.3.0-r0/recipe-sysroot-native/usr/lib/clang/13.0.1/include/arm_neon.h:32:2: error: "NEON support not enabled" + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14032] +Signed-off-by: Khem Raj + +--- + src/util/format/u_format.c | 2 +- + src/util/format/u_format_unpack_neon.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/util/format/u_format.c b/src/util/format/u_format.c +index c071250..0880984 100644 +--- a/src/util/format/u_format.c ++++ b/src/util/format/u_format.c +@@ -1184,7 +1184,7 @@ static void + util_format_unpack_table_init(void) + { + for (enum pipe_format format = PIPE_FORMAT_NONE; format < PIPE_FORMAT_COUNT; format++) { +-#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) ++#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) + const struct util_format_unpack_description *unpack = util_format_unpack_description_neon(format); + if (unpack) { + util_format_unpack_table[format] = unpack; +diff --git a/src/util/format/u_format_unpack_neon.c b/src/util/format/u_format_unpack_neon.c +index a4a5cb1..1e4f794 100644 +--- a/src/util/format/u_format_unpack_neon.c ++++ b/src/util/format/u_format_unpack_neon.c +@@ -23,7 +23,7 @@ + + #include + +-#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) ++#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) + + /* armhf builds default to vfp, not neon, and refuses to compile neon intrinsics + * unless you tell it "no really". -- cgit v1.2.3-54-g00ecf