summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/mesa/files')
-rw-r--r--meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch53
-rw-r--r--meta/recipes-graphics/mesa/files/0001-anv-fix-a-build-race-between-generating-a-header-and.patch31
-rw-r--r--meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch58
-rw-r--r--meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch31
-rw-r--r--meta/recipes-graphics/mesa/files/0001-meson-Add-xcb-fixes-to-loader-when-using-x11-and-dri.patch36
-rw-r--r--meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch7
-rw-r--r--meta/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch21
-rw-r--r--meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch42
-rw-r--r--meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch46
-rw-r--r--meta/recipes-graphics/mesa/files/0004-Revert-mesa-Enable-asm-unconditionally-now-that-gen_.patch147
-rw-r--r--meta/recipes-graphics/mesa/files/0005-vc4-use-intmax_t-for-formatted-output-of-timespec-me.patch51
11 files changed, 165 insertions, 358 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch b/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch
new file mode 100644
index 0000000000..1711e22585
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch
@@ -0,0 +1,53 @@
+From 051f41beda540f0ae77b341db01a6de83c9e938a Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Fri, 8 Mar 2024 15:53:11 +0100
+Subject: [PATCH] Revert "meson: do not pull in clc for clover"
+
+This reverts commit 815a6647eb1383e9dc704ffcc266d85f3b13338a.
+Upstream-Status: Inappropriate [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27783/diffs?commit_id=a976f2c9f0c07f9e06cc9affd9124b45bc60c2bd]
+
+Once the merge request above was added, it will only be possible to provide opencl spir-v with gallium-rusticl=true. This is not yet supported in the mesa recipe.
+For now reverting this commit allows to still use clover with opencl-spirv, which would otherwise be broken starting from mesa 24.0.2.
+
+After it was merged, this patch needs to be removed and rusticl support will be required
+
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
+---
+ meson.build | 3 ++-
+ src/compiler/meson.build | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 2db6185..741b5d1 100644
+--- a/meson.build
++++ b/meson.build
+@@ -813,6 +813,7 @@ if _opencl != 'disabled'
+ error('The Clover OpenCL state tracker requires rtti')
+ endif
+
++ with_clc = true
+ with_gallium_opencl = true
+ with_opencl_icd = _opencl == 'icd'
+ else
+@@ -837,7 +838,7 @@ if with_gallium_rusticl
+ endif
+
+ dep_clc = null_dep
+-if with_gallium_opencl or with_clc
++if with_clc
+ dep_clc = dependency('libclc')
+ endif
+
+diff --git a/src/compiler/meson.build b/src/compiler/meson.build
+index 8d73544..1dae56d 100644
+--- a/src/compiler/meson.build
++++ b/src/compiler/meson.build
+@@ -79,7 +79,7 @@ subdir('nir')
+
+ subdir('spirv')
+
+-if with_clc
++if with_opencl_spirv
+ subdir('clc')
+ endif
+ if with_gallium
diff --git a/meta/recipes-graphics/mesa/files/0001-anv-fix-a-build-race-between-generating-a-header-and.patch b/meta/recipes-graphics/mesa/files/0001-anv-fix-a-build-race-between-generating-a-header-and.patch
deleted file mode 100644
index a61e7b2160..0000000000
--- a/meta/recipes-graphics/mesa/files/0001-anv-fix-a-build-race-between-generating-a-header-and.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From f148d4f1b5b13288b254ead07f1d008d997e2342 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 2 Nov 2020 23:23:53 +0100
-Subject: [PATCH] anv: fix a build race between generating a header and using
- it
-
-anv_batch_chain.c includes genX_bits.h but doesn't ensure it gets
-generated first. This causes build failures, as observed here:
-https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1501/steps/8/logs/step2d
-
-Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7412]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- src/intel/vulkan/meson.build | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build
-index 36e1689314e..b713d8eade3 100644
---- a/src/intel/vulkan/meson.build
-+++ b/src/intel/vulkan/meson.build
-@@ -131,6 +131,7 @@ libanv_files = files(
- anv_deps = [
- dep_libdrm,
- dep_valgrind,
-+ idep_genxml,
- idep_nir_headers,
- idep_vulkan_util_headers,
- ]
---
-2.29.0
-
diff --git a/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch b/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch
new file mode 100644
index 0000000000..ab16152090
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch
@@ -0,0 +1,58 @@
+From 4bd15a419e892da843489c374c58c5b29c40b5d6 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@smile.fr>
+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 <romain.naour@smile.fr>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ 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 <dlfcn.h>
+ #include "dri_common.h"
+ #include "drisw_priv.h"
++#ifdef HAVE_DRI3
+ #include "dri3_priv.h"
++#endif
+ #include <X11/extensions/shmproto.h>
+ #include <assert.h>
+ #include <vulkan/vulkan_core.h>
+@@ -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/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
deleted file mode 100644
index 8bedbac669..0000000000
--- a/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-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-Add-xcb-fixes-to-loader-when-using-x11-and-dri.patch b/meta/recipes-graphics/mesa/files/0001-meson-Add-xcb-fixes-to-loader-when-using-x11-and-dri.patch
deleted file mode 100644
index 9ee72880a2..0000000000
--- a/meta/recipes-graphics/mesa/files/0001-meson-Add-xcb-fixes-to-loader-when-using-x11-and-dri.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From cf17d6251653f4a98e7c4f904ea2f0bc0ecedd5c Mon Sep 17 00:00:00 2001
-From: Duncan Hopkins <duncan@duncanhopkins.me.uk>
-Date: Thu, 15 Oct 2020 12:14:57 +0100
-Subject: [PATCH] meson: Add xcb-fixes to loader when using x11 and dri3. Fixes
- undefined symbol for xcb_xfixes_create_region in loader_dri3_helper.c
-
-loader_dr3_helper.c uses xcb_xfixes_create_region() that requires dep_xcb_xfixes to link. This is dependent on with_platform_x11 and with_dri3.
-But the source meson file does not set this up dependent on with_dri3.
-The build was initialsed using platforms=x11 and gallium-drivers=zink,swrast.
-
-Reviewed-by: Eric Anholt <eric@anholt.net>
-Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7164>
-
-Upstream-Status: Backport [cf17d6251653f4a98e7c4f904ea2f0bc0ecedd5c]
-
----
- meson.build | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index cfe02fa6373..3cb3c904927 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1782,7 +1782,8 @@ if with_platform_x11
- dep_xxf86vm = dependency('xxf86vm')
- endif
- endif
-- if (with_egl or (
-+ if (with_egl or
-+ with_dri3 or (
- with_gallium_vdpau or with_gallium_xvmc or with_gallium_xa or
- with_gallium_omx != 'disabled'))
- dep_xcb_xfixes = dependency('xcb-xfixes')
---
-2.17.1
-
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
index 15485feb71..baa98a0d46 100644
--- 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
@@ -1,4 +1,4 @@
-From bb2f0bea553d51d659a9bc46f7ae186885405151 Mon Sep 17 00:00:00 2001
+From 02cc21800fe29f566add525e63f619c0536d6e7b 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
@@ -10,7 +10,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
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
+index 5a5eab4..e499516 100644
--- a/src/util/u_atomic.c
+++ b/src/util/u_atomic.c
@@ -21,7 +21,7 @@
@@ -22,6 +22,3 @@ index e4bffa8..58e1ddd 100644
#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
index 085254323c..7be7d81eeb 100644
--- 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
@@ -1,4 +1,4 @@
-From 0d9ed002eff176b902da266d89829a9b0cb10946 Mon Sep 17 00:00:00 2001
+From e8ec6b1cc5e401ba719095722d8b317d755ae613 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
@@ -14,30 +14,29 @@ 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 898d025..09e3759 100644
+index 133fd9a..817861e 100644
--- a/meson.build
+++ b/meson.build
-@@ -124,7 +124,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2
+@@ -128,7 +128,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')
+-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')
- dri_drivers = get_option('dri-drivers')
- if dri_drivers.contains('auto')
-@@ -884,7 +884,7 @@ if cc.compiles('__uint128_t foo(void) { return 0; }',
+ gallium_drivers = get_option('gallium-drivers')
+ if gallium_drivers.contains('auto')
+@@ -997,7 +997,7 @@ if cc.has_function('fmemopen')
endif
# TODO: this is very incomplete
--if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd'].contains(host_machine.system())
-+if ['cygwin', 'gnu', 'gnu/kfreebsd'].contains(host_machine.system()) or host_machine.system().startswith('linux')
+-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/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch b/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch
new file mode 100644
index 0000000000..036a0b4945
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch
@@ -0,0 +1,42 @@
+From 62495ebb977866c52d5bed8499a547c49f0d9bc1 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@smile.fr>
+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 <romain.naour@smile.fr>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ 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/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
deleted file mode 100644
index 74f7fe5c2d..0000000000
--- a/meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From ce57ce220d9c377beabf4914f33c43118f672ffe 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.
-
-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 c5136ea..185270d 100644
---- a/meson.build
-+++ b/meson.build
-@@ -424,7 +424,7 @@ endif
-
- # Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
- use_elf_tls = false
--if not ['windows', 'freebsd', 'openbsd'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29)
-+if not ['windows', 'freebsd', 'openbsd'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29) and get_option('elf-tls')
- pre_args += '-DUSE_ELF_TLS'
- use_elf_tls = true
- endif
-diff --git a/meson_options.txt b/meson_options.txt
-index 2d39d13..72006eb 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -368,6 +368,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',
diff --git a/meta/recipes-graphics/mesa/files/0004-Revert-mesa-Enable-asm-unconditionally-now-that-gen_.patch b/meta/recipes-graphics/mesa/files/0004-Revert-mesa-Enable-asm-unconditionally-now-that-gen_.patch
deleted file mode 100644
index 833742359f..0000000000
--- a/meta/recipes-graphics/mesa/files/0004-Revert-mesa-Enable-asm-unconditionally-now-that-gen_.patch
+++ /dev/null
@@ -1,147 +0,0 @@
-From 43d9e40db7357f27e91002b2bb7688b6775ebb43 Mon Sep 17 00:00:00 2001
-From: Alistair Francis <alistair@alistair23.me>
-Date: Thu, 14 Nov 2019 09:06:02 -0800
-Subject: [PATCH] Revert "mesa: Enable asm unconditionally, now that
- gen_matypes is gone."
-
-This reverts commit 20294dceebc23236e33b22578245f7e6f41b6997.
-
-Upstream-Status: Inappropriate [configuration]
-Signed-off-by: Alistair Francis <alistair@alistair23.me>
-
----
- meson.build | 94 ++++++++++++++++++++++++++++++-----------------
- meson_options.txt | 6 +++
- 2 files changed, 67 insertions(+), 33 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index e7dc599..e2fc934 100644
---- a/meson.build
-+++ b/meson.build
-@@ -52,6 +52,7 @@ pre_args = [
- with_vulkan_icd_dir = get_option('vulkan-icd-dir')
- with_tests = get_option('build-tests')
- with_aco_tests = get_option('build-aco-tests')
-+with_asm = get_option('asm')
- with_glx_read_only_text = get_option('glx-read-only-text')
- with_glx_direct = get_option('glx-direct')
- with_osmesa = get_option('osmesa')
-@@ -1154,41 +1155,68 @@ dep_ws2_32 = cc.find_library('ws2_32', required : with_platform_windows)
-
- # TODO: shared/static? Is this even worth doing?
-
-+# When cross compiling we generally need to turn off the use of assembly,
-+# because mesa's assembly relies on building an executable for the host system,
-+# and running it to get information about struct sizes. There is at least one
-+# case of cross compiling where we can use asm, and that's x86_64 -> x86 when
-+# host OS == build OS, since in that case the build machine can run the host's
-+# binaries.
-+if with_asm and meson.is_cross_build()
-+ if build_machine.system() != host_machine.system()
-+ # TODO: It may be possible to do this with an exe_wrapper (like wine).
-+ message('Cross compiling from one OS to another, disabling assembly.')
-+ with_asm = false
-+ elif not (build_machine.cpu_family().startswith('x86') and host_machine.cpu_family() == 'x86')
-+ # FIXME: Gentoo always sets -m32 for x86_64 -> x86 builds, resulting in an
-+ # x86 -> x86 cross compile. We use startswith rather than == to handle this
-+ # case.
-+ # TODO: There may be other cases where the 64 bit version of the
-+ # architecture can run 32 bit binaries (aarch64 and armv7 for example)
-+ message('''
-+ Cross compiling to different architectures, and the host cannot run
-+ the build machine's binaries. Disabling assembly.
-+ ''')
-+ with_asm = false
-+ endif
-+endif
-+
- with_asm_arch = ''
--if host_machine.cpu_family() == 'x86'
-- if system_has_kms_drm or host_machine.system() == 'gnu'
-- with_asm_arch = 'x86'
-- pre_args += ['-DUSE_X86_ASM', '-DUSE_MMX_ASM', '-DUSE_3DNOW_ASM',
-- '-DUSE_SSE_ASM']
--
-- if with_glx_read_only_text
-- pre_args += ['-DGLX_X86_READONLY_TEXT']
-+if with_asm
-+ if host_machine.cpu_family() == 'x86'
-+ if system_has_kms_drm or host_machine.system() == 'gnu'
-+ with_asm_arch = 'x86'
-+ pre_args += ['-DUSE_X86_ASM', '-DUSE_MMX_ASM', '-DUSE_3DNOW_ASM',
-+ '-DUSE_SSE_ASM']
-+
-+ if with_glx_read_only_text
-+ pre_args += ['-DGLX_X86_READONLY_TEXT']
-+ endif
-+ endif
-+ elif host_machine.cpu_family() == 'x86_64'
-+ if system_has_kms_drm
-+ with_asm_arch = 'x86_64'
-+ pre_args += ['-DUSE_X86_64_ASM']
-+ endif
-+ elif host_machine.cpu_family() == 'arm'
-+ if system_has_kms_drm
-+ with_asm_arch = 'arm'
-+ pre_args += ['-DUSE_ARM_ASM']
-+ endif
-+ elif host_machine.cpu_family() == 'aarch64'
-+ if system_has_kms_drm
-+ with_asm_arch = 'aarch64'
-+ pre_args += ['-DUSE_AARCH64_ASM']
-+ endif
-+ elif host_machine.cpu_family() == 'sparc64'
-+ if system_has_kms_drm
-+ with_asm_arch = 'sparc'
-+ pre_args += ['-DUSE_SPARC_ASM']
-+ endif
-+ elif host_machine.cpu_family().startswith('ppc64') and host_machine.endian() == 'little'
-+ if system_has_kms_drm
-+ with_asm_arch = 'ppc64le'
-+ pre_args += ['-DUSE_PPC64LE_ASM']
- endif
-- endif
--elif host_machine.cpu_family() == 'x86_64'
-- if system_has_kms_drm
-- with_asm_arch = 'x86_64'
-- pre_args += ['-DUSE_X86_64_ASM']
-- endif
--elif host_machine.cpu_family() == 'arm'
-- if system_has_kms_drm
-- with_asm_arch = 'arm'
-- pre_args += ['-DUSE_ARM_ASM']
-- endif
--elif host_machine.cpu_family() == 'aarch64'
-- if system_has_kms_drm
-- with_asm_arch = 'aarch64'
-- pre_args += ['-DUSE_AARCH64_ASM']
-- endif
--elif host_machine.cpu_family() == 'sparc64'
-- if system_has_kms_drm
-- with_asm_arch = 'sparc'
-- pre_args += ['-DUSE_SPARC_ASM']
-- endif
--elif host_machine.cpu_family().startswith('ppc64') and host_machine.endian() == 'little'
-- if system_has_kms_drm
-- with_asm_arch = 'ppc64le'
-- pre_args += ['-DUSE_PPC64LE_ASM']
- endif
- endif
-
-diff --git a/meson_options.txt b/meson_options.txt
-index 147cccb..562b059 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -254,6 +254,12 @@ option(
- value : false,
- description : 'Enable GLVND support.'
- )
-+option(
-+ 'asm',
-+ type : 'boolean',
-+ value : true,
-+ description : 'Build assembly code if possible'
-+)
- option(
- 'glx-read-only-text',
- type : 'boolean',
diff --git a/meta/recipes-graphics/mesa/files/0005-vc4-use-intmax_t-for-formatted-output-of-timespec-me.patch b/meta/recipes-graphics/mesa/files/0005-vc4-use-intmax_t-for-formatted-output-of-timespec-me.patch
deleted file mode 100644
index dacb1ea1c8..0000000000
--- a/meta/recipes-graphics/mesa/files/0005-vc4-use-intmax_t-for-formatted-output-of-timespec-me.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 281a636353666bfdd373c62591e744087e750e89 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 4 Dec 2019 14:15:28 -0800
-Subject: [PATCH] vc4: use intmax_t for formatted output of timespec members
-
-32bit architectures which have 64bit time_t does not fit the assumption
-of time_t being same as system long int
-
-Fixes
-error: format specifies type 'long' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat]
- time.tv_sec);
- ^~~~~~~~~~~
-
-Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2966]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
----
- src/gallium/drivers/v3d/v3d_bufmgr.c | 4 ++--
- src/gallium/drivers/vc4/vc4_bufmgr.c | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/gallium/drivers/v3d/v3d_bufmgr.c b/src/gallium/drivers/v3d/v3d_bufmgr.c
-index 31a0803..cc2e2af 100644
---- a/src/gallium/drivers/v3d/v3d_bufmgr.c
-+++ b/src/gallium/drivers/v3d/v3d_bufmgr.c
-@@ -80,8 +80,8 @@ v3d_bo_dump_stats(struct v3d_screen *screen)
-
- struct timespec time;
- clock_gettime(CLOCK_MONOTONIC, &time);
-- fprintf(stderr, " now: %ld\n",
-- (long)time.tv_sec);
-+ fprintf(stderr, " now: %jd\n",
-+ (intmax_t)time.tv_sec);
- }
- }
-
-diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.c b/src/gallium/drivers/vc4/vc4_bufmgr.c
-index a786e8e..975d49e 100644
---- a/src/gallium/drivers/vc4/vc4_bufmgr.c
-+++ b/src/gallium/drivers/vc4/vc4_bufmgr.c
-@@ -99,8 +99,8 @@ vc4_bo_dump_stats(struct vc4_screen *screen)
-
- struct timespec time;
- clock_gettime(CLOCK_MONOTONIC, &time);
-- fprintf(stderr, " now: %ld\n",
-- (long)time.tv_sec);
-+ fprintf(stderr, " now: %jd\n",
-+ (intmax_t)time.tv_sec);
- }
- }
-