diff options
Diffstat (limited to 'meta/recipes-graphics/mesa/files')
6 files changed, 252 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch b/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch new file mode 100644 index 0000000000..8bedbac669 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch @@ -0,0 +1,31 @@ +From 8973e297f2f9b17498b9dc0e37a19481d4bb7df9 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 16 Oct 2020 11:03:47 -0700 +Subject: [PATCH] futex.h: Define __NR_futex if it does not exist + +__NR_futex is not defines by newer architectures e.g. arc, riscv32 as +they only have 64bit variant of time_t. Glibc defines SYS_futex interface based on +__NR_futex, since this is used in applications, such applications start +to fail to build for these newer architectures. This patch defines a +fallback to alias __NR_futex to __NR_futex_tim64 so SYS_futex keeps +working + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/util/futex.h | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/src/util/futex.h ++++ b/src/util/futex.h +@@ -34,6 +34,10 @@ + #include <sys/syscall.h> + #include <sys/time.h> + ++#if !defined(SYS_futex) && defined(SYS_futex_time64) ++# define SYS_futex SYS_futex_time64 ++#endif ++ + static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3) + { + return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3); diff --git a/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch b/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch new file mode 100644 index 0000000000..15485feb71 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch @@ -0,0 +1,27 @@ +From bb2f0bea553d51d659a9bc46f7ae186885405151 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +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 <raj.khem@gmail.com> +--- + 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 e4bffa8..58e1ddd 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 <stdint.h> + #include <pthread.h> +-- +2.24.1 + diff --git a/meta/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch new file mode 100644 index 0000000000..b6f86743e1 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch @@ -0,0 +1,43 @@ +From 38e984073e4c23b6278d1a2ff21e894fda7b93c5 Mon Sep 17 00:00:00 2001 +From: Alistair Francis <alistair@alistair23.me> +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 <anuj.mittal@intel.com> +Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br> +Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> +Signed-off-by: Alistair Francis <alistair@alistair23.me> + +--- + meson.build | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 932eb13..efc6171 100644 +--- a/meson.build ++++ b/meson.build +@@ -153,7 +153,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'].contains(host_machine.system()) ++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly'].contains(host_machine.system()) or host_machine.system().startswith('linux') + + dri_drivers = get_option('dri-drivers') + if dri_drivers.contains('auto') +@@ -970,7 +970,7 @@ if cc.compiles('__uint128_t foo(void) { return 0; }', + endif + + # TODO: this is very incomplete +-if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku'].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/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch b/meta/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch new file mode 100644 index 0000000000..80b9af08e8 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch @@ -0,0 +1,49 @@ +From 4febda271c6bb0dc69ebf573446c6922a1ec35fb Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +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 <raj.khem@gmail.com> +--- + 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 36c5e52008e..f0a00971691 100644 +--- a/src/util/format/u_format.c ++++ b/src/util/format/u_format.c +@@ -1138,7 +1138,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 a4a5cb1f723..1e4f794a295 100644 +--- a/src/util/format/u_format_unpack_neon.c ++++ b/src/util/format/u_format_unpack_neon.c +@@ -23,7 +23,7 @@ + + #include <u_format.h> + +-#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". +-- +2.34.1 + diff --git a/meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch b/meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch new file mode 100644 index 0000000000..e87d7d7311 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch @@ -0,0 +1,41 @@ +From e2e2fe86dd61b6fae682a1fec31bd0755ced5cd5 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 7 Dec 2021 11:13:27 -0800 +Subject: [PATCH] v3dv: account for 64bit time_t on 32bit arches + +This makes is a bit more portable, especially on 32bit architectures +with 64bit time_t defaults. Especially on musl its a must. + +Fixes +../mesa-21.3.0/src/broadcom/vulkan/v3dv_bo.c:71:15: error: format specifies type 'long' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat] + time.tv_sec); + ^~~~~~~~~~~ + +Also reported here [1] + +[1] https://github.com/agherzan/meta-raspberrypi/issues/969 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14118] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/broadcom/vulkan/v3dv_bo.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/broadcom/vulkan/v3dv_bo.c b/src/broadcom/vulkan/v3dv_bo.c +index 71679ce..dc5e7f5 100644 +--- a/src/broadcom/vulkan/v3dv_bo.c ++++ b/src/broadcom/vulkan/v3dv_bo.c +@@ -67,8 +67,8 @@ bo_dump_stats(struct v3dv_device *device) + + struct timespec time; + clock_gettime(CLOCK_MONOTONIC, &time); +- fprintf(stderr, " now: %ld\n", +- time.tv_sec); ++ fprintf(stderr, " now: %lld\n", ++ (long long)time.tv_sec); + } + + if (cache->size_list_size) { +-- +2.34.1 + diff --git a/meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch b/meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch new file mode 100644 index 0000000000..35ab8d5a72 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch @@ -0,0 +1,61 @@ +From 8f2f48b41aa17eec3c4d63685e3296f28e60b980 Mon Sep 17 00:00:00 2001 +From: Alistair Francis <alistair@alistair23.me> +Date: Thu, 14 Nov 2019 13:08:31 -0800 +Subject: [PATCH] meson.build: make TLS ELF optional + +USE_ELF_TLS has replaced GLX_USE_TLS so this patch is the original "make +TLS GLX optional again" patch updated to the latest mesa. + +For details, see: +https://gitlab.freedesktop.org/mesa/mesa/-/issues/966 + +This prevents runtime segfault on musl: + +Traceback (most recent call last): + File "/home/pokybuild/yocto-worker/musl-qemux86/build/meta/lib/oeqa/core/decorator/__init__.py", line 36, in wrapped_f + return func(*args, **kwargs) + File "/home/pokybuild/yocto-worker/musl-qemux86/build/meta/lib/oeqa/runtime/cases/parselogs.py", line 378, in test_parselogs + self.assertEqual(errcount, 0, msg=self.msg) +AssertionError: 1 != 0 : Log: /home/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/qemux86-poky-linux-musl/core-image-sato-sdk/1.0-r0/target_logs/Xorg.0.log +----------------------- +Central error: [ 10.477] (EE) Failed to load /usr/lib/xorg/modules/extensions/libglx.so: Error relocating /usr/lib/libGL.so.1: alphasort: initial-exec TLS resolves to dynamic definition in /usr/lib/libGL.so.1 +*********************** + +Upstream-Status: Inappropriate [configuration] +Signed-off-by: Alistair Francis <alistair@alistair23.me> + +--- + meson.build | 2 +- + meson_options.txt | 6 ++++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 23618c1..c8cc5e3 100644 +--- a/meson.build ++++ b/meson.build +@@ -476,7 +476,7 @@ endif + use_elf_tls = false + if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and + (not with_platform_android or get_option('platform-sdk-version') >= 29) and +- (not with_platform_windows or not with_shared_glapi)) ++ (not with_platform_windows or not with_shared_glapi) and get_option('elf-tls')) + pre_args += '-DUSE_ELF_TLS' + use_elf_tls = true + +diff --git a/meson_options.txt b/meson_options.txt +index 29c402c..f70d9b2 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -455,6 +455,12 @@ option( + value : true, + description : 'Enable direct rendering in GLX and EGL for DRI', + ) ++option( ++ 'elf-tls', ++ type : 'boolean', ++ value : true, ++ description : 'Enable TLS support in ELF', ++) + option( + 'prefer-iris', + type : 'boolean', |