diff options
Diffstat (limited to 'meta/recipes-graphics/mesa')
17 files changed, 277 insertions, 552 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch b/meta/recipes-graphics/mesa/files/0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch deleted file mode 100644 index dac2de4e62..0000000000 --- a/meta/recipes-graphics/mesa/files/0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch +++ /dev/null @@ -1,158 +0,0 @@ -From 7796c2c56c960ac55e49246f0349ac52539ada55 Mon Sep 17 00:00:00 2001 -From: Leandro Ribeiro <leandro.ribeiro@collabora.com> -Date: Sun, 10 Apr 2022 22:54:36 -0300 -Subject: [PATCH] Revert "egl/wayland: deprecate drm_handle_format() and - drm_handle_capabilities()" - -Commit af1ee8e010441f8f2ed8c77065b159652a4ac9fe dropped support to -wl_drm, as we thought that most compositors from active projects were -already supporting zwp_linux_dmabuf_v1. - -But that's not true, so revert this commit in order to give these -projects a longer transition period. - -Note that we didn't add back the support to GEM name API, and that was -on purpose. - -Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com> -Reviewed-by: Simon Ser <contact@emersion.fr> -Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15822> - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> -Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/commit/c60fea8c228ae3f32e20d6b65c473d9f04871d20] ---- - src/egl/drivers/dri2/egl_dri2.h | 1 + - src/egl/drivers/dri2/platform_wayland.c | 59 +++++++++++++++++++------ - 2 files changed, 47 insertions(+), 13 deletions(-) - -diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h -index c466ff83c53..eecb32a53fd 100644 ---- a/src/egl/drivers/dri2/egl_dri2.h -+++ b/src/egl/drivers/dri2/egl_dri2.h -@@ -283,6 +283,7 @@ struct dri2_egl_display - struct zwp_linux_dmabuf_feedback_v1 *wl_dmabuf_feedback; - struct dmabuf_feedback_format_table format_table; - bool authenticated; -+ uint32_t capabilities; - char *device_name; - #endif - -diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c -index 5ff83cce08a..843434376a7 100644 ---- a/src/egl/drivers/dri2/platform_wayland.c -+++ b/src/egl/drivers/dri2/platform_wayland.c -@@ -1343,7 +1343,7 @@ create_wl_buffer(struct dri2_egl_display *dri2_dpy, - struct dri2_egl_surface *dri2_surf, - __DRIimage *image) - { -- struct wl_buffer *ret; -+ struct wl_buffer *ret = NULL; - EGLBoolean query; - int width, height, fourcc, num_planes; - uint64_t modifier = DRM_FORMAT_MOD_INVALID; -@@ -1447,11 +1447,28 @@ create_wl_buffer(struct dri2_egl_display *dri2_dpy, - ret = zwp_linux_buffer_params_v1_create_immed(params, width, height, - fourcc, 0); - zwp_linux_buffer_params_v1_destroy(params); -+ } else { -+ struct wl_drm *wl_drm = -+ dri2_surf ? dri2_surf->wl_drm_wrapper : dri2_dpy->wl_drm; -+ int fd = -1, stride; -+ -+ if (num_planes > 1) -+ return NULL; -+ -+ query = dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FD, &fd); -+ query &= dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &stride); -+ if (!query) { -+ if (fd >= 0) -+ close(fd); -+ return NULL; -+ } - -- return ret; -+ ret = wl_drm_create_prime_buffer(wl_drm, fd, width, height, fourcc, 0, -+ stride, 0, 0, 0, 0); -+ close(fd); - } - -- return NULL; -+ return ret; - } - - static EGLBoolean -@@ -1698,16 +1715,21 @@ drm_handle_device(void *data, struct wl_drm *drm, const char *device) - static void - drm_handle_format(void *data, struct wl_drm *drm, uint32_t format) - { -- /* deprecated, as compositors already support the dma-buf protocol extension -- * and so we can rely on dmabuf_handle_modifier() to receive formats and -- * modifiers */ -+ struct dri2_egl_display *dri2_dpy = data; -+ int visual_idx = dri2_wl_visual_idx_from_fourcc(format); -+ -+ if (visual_idx == -1) -+ return; -+ -+ BITSET_SET(dri2_dpy->formats.formats_bitmap, visual_idx); - } - - static void - drm_handle_capabilities(void *data, struct wl_drm *drm, uint32_t value) - { -- /* deprecated, as compositors already support the dma-buf protocol extension -- * and so we can rely on it to create wl_buffer's */ -+ struct dri2_egl_display *dri2_dpy = data; -+ -+ dri2_dpy->capabilities = value; - } - - static void -@@ -2075,13 +2097,12 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp) - wl_registry_add_listener(dri2_dpy->wl_registry, - ®istry_listener_drm, dri2_dpy); - -- /* The compositor must expose the dma-buf interface. */ -- if (roundtrip(dri2_dpy) < 0 || dri2_dpy->wl_dmabuf == NULL) -+ if (roundtrip(dri2_dpy) < 0) - goto cleanup; - - /* Get default dma-buf feedback */ -- if (zwp_linux_dmabuf_v1_get_version(dri2_dpy->wl_dmabuf) >= -- ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION) { -+ if (dri2_dpy->wl_dmabuf && zwp_linux_dmabuf_v1_get_version(dri2_dpy->wl_dmabuf) >= -+ ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION) { - dmabuf_feedback_format_table_init(&dri2_dpy->format_table); - dri2_dpy->wl_dmabuf_feedback = - zwp_linux_dmabuf_v1_get_default_feedback(dri2_dpy->wl_dmabuf); -@@ -2089,7 +2110,6 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp) - &dmabuf_feedback_listener, dri2_dpy); - } - -- /* Receive events from the interfaces */ - if (roundtrip(dri2_dpy) < 0) - goto cleanup; - -@@ -2176,6 +2196,19 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp) - - dri2_wl_setup_swap_interval(disp); - -+ if (dri2_dpy->wl_drm) { -+ /* To use Prime, we must have _DRI_IMAGE v7 at least. createImageFromFds -+ * support indicates that Prime export/import is supported by the driver. -+ * We deprecated the support to GEM names API, so we bail out if the -+ * driver does not suport Prime. */ -+ if (!(dri2_dpy->capabilities & WL_DRM_CAPABILITY_PRIME) || -+ (dri2_dpy->image->base.version < 7) || -+ (dri2_dpy->image->createImageFromFds == NULL)) { -+ _eglLog(_EGL_WARNING, "wayland-egl: display does not support prime"); -+ goto cleanup; -+ } -+ } -+ - if (dri2_dpy->is_different_gpu && - (dri2_dpy->image->base.version < 9 || - dri2_dpy->image->blitImage == NULL)) { --- -2.35.1 - 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-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 3b0bfa323b..0000000000 --- a/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 253b042d2bf10e9abfa9cc508e0782aefd834145 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(+) - -diff --git a/src/util/futex.h b/src/util/futex.h -index 43097f4..941b0ec 100644 ---- 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 index b08e4d86c2..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,11 +1,10 @@ -From d34bdbd80e5a1f309d2ba280cdc66ff0ee0e5c43 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 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/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 aea23d0ec2..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 f9c597a2c517eb85c23cbeeb2e95c55794c74cda 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 bca6b1f..70d06c0 100644 +index 133fd9a..817861e 100644 --- a/meson.build +++ b/meson.build -@@ -172,7 +172,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.length() != 0 -@@ -1074,7 +1074,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', 'haiku'].contains(host_machine.system()) -+if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku'].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/0001-nir-nir_opt_move-fix-ALWAYS_INLINE-compiler-error.patch b/meta/recipes-graphics/mesa/files/0001-nir-nir_opt_move-fix-ALWAYS_INLINE-compiler-error.patch deleted file mode 100644 index 48fc1e37ff..0000000000 --- a/meta/recipes-graphics/mesa/files/0001-nir-nir_opt_move-fix-ALWAYS_INLINE-compiler-error.patch +++ /dev/null @@ -1,65 +0,0 @@ -Backport merge request to fix mesa compile error when debug build -enabled. - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17439] - -Signed-off-by: Kai Kang <kai.kang@windriver.com> - -From c69c6e7a35205557de73734ad4a1f411c8f99926 Mon Sep 17 00:00:00 2001 -From: t bettler <thomas.bettler@gmail.com> -Date: Sat, 9 Jul 2022 09:28:51 +0000 -Subject: [PATCH] nir/nir_opt_move: fix ALWAYS_INLINE compiler error -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -fix call to ‘always_inline’ ‘src_is_ssa’ - -Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6825 -Fixes: f1d20ec67c3f186886b97de94f74484650f8fda1 ("nir/nir_opt_move: handle non-SSA defs ") ---- - src/compiler/nir/nir_inline_helpers.h | 10 ++++++++-- - src/compiler/nir/nir_opt_move.c | 2 +- - 2 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/src/compiler/nir/nir_inline_helpers.h b/src/compiler/nir/nir_inline_helpers.h -index 125dd8a537c..ec33f0509f7 100644 ---- a/src/compiler/nir/nir_inline_helpers.h -+++ b/src/compiler/nir/nir_inline_helpers.h -@@ -73,8 +73,8 @@ nir_foreach_dest(nir_instr *instr, nir_foreach_dest_cb cb, void *state) - return _nir_foreach_dest(instr, cb, state); - } - --static inline bool --nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state) -+static ALWAYS_INLINE bool -+_nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state) - { - switch (instr->type) { - case nir_instr_type_alu: { -@@ -162,3 +162,9 @@ nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state) - dest_state.cb = cb; - return _nir_foreach_dest(instr, _nir_visit_dest_indirect, &dest_state); - } -+ -+static inline bool -+nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state) -+{ -+ return _nir_foreach_src(instr, cb, state); -+} -diff --git a/src/compiler/nir/nir_opt_move.c b/src/compiler/nir/nir_opt_move.c -index 81bcde5c436..051c3cc6295 100644 ---- a/src/compiler/nir/nir_opt_move.c -+++ b/src/compiler/nir/nir_opt_move.c -@@ -60,7 +60,7 @@ src_is_ssa(nir_src *src, void *state) - static ALWAYS_INLINE bool - instr_reads_register(nir_instr *instr) - { -- return !nir_foreach_src(instr, src_is_ssa, NULL); -+ return !_nir_foreach_src(instr, src_is_ssa, NULL); - } - - static bool --- -2.34.1 - diff --git a/meta/recipes-graphics/mesa/files/0001-swrast_kms-use-swkmsDRI2Extension-instead-of-driDRI2.patch b/meta/recipes-graphics/mesa/files/0001-swrast_kms-use-swkmsDRI2Extension-instead-of-driDRI2.patch deleted file mode 100644 index db25e16f4a..0000000000 --- a/meta/recipes-graphics/mesa/files/0001-swrast_kms-use-swkmsDRI2Extension-instead-of-driDRI2.patch +++ /dev/null @@ -1,113 +0,0 @@ -From feb4ec510b1328fdd9aa77305d3273d1f9c7e124 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex@linutronix.de> -Date: Thu, 9 Jun 2022 11:42:05 +0200 -Subject: [PATCH] swrast_kms: use swkmsDRI2Extension instead of - driDRI2Extension - -This set of changes: -https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649 - -caused a regression in Xorg when using swrast_kms: - (EE) AIGLX error: Calling driver entry point failed - -This commit changes the swrast_kms driver to use a dedicated screen init function -(which I believe was overlooked); I also took the opportunity to rename the -associated plumbling to have swrast-specific names. - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16942] -Signed-off-by: Alexander Kanavin <alex@linutronix.de> ---- - src/gallium/frontends/dri/dri2.c | 16 ++++++++-------- - src/gallium/frontends/dri/dri_screen.h | 4 ++-- - src/gallium/frontends/dri/dri_util.c | 2 +- - src/gallium/targets/dri/target.c | 2 +- - 4 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c -index 63ac9d5..de33789 100644 ---- a/src/gallium/frontends/dri/dri2.c -+++ b/src/gallium/frontends/dri/dri2.c -@@ -2508,7 +2508,7 @@ release_pipe: - * Returns the struct gl_config supported by this driver. - */ - static const __DRIconfig ** --dri_kms_init_screen(__DRIscreen * sPriv) -+dri_swrast_kms_init_screen(__DRIscreen * sPriv) - { - #if defined(GALLIUM_SOFTPIPE) - const __DRIconfig **configs; -@@ -2613,8 +2613,8 @@ static const struct __DRIDriverVtableExtensionRec galliumdrm_vtable = { - * hook. The latter is used to explicitly initialise the kms_swrast driver - * rather than selecting the approapriate driver as suggested by the loader. - */ --const struct __DriverAPIRec dri_kms_driver_api = { -- .InitScreen = dri_kms_init_screen, -+const struct __DriverAPIRec dri_swrast_kms_driver_api = { -+ .InitScreen = dri_swrast_kms_init_screen, - .DestroyScreen = dri_destroy_screen, - .CreateBuffer = dri2_create_buffer, - .DestroyBuffer = dri_destroy_buffer, -@@ -2633,17 +2633,17 @@ const __DRIextension *galliumdrm_driver_extensions[] = { - NULL - }; - --static const struct __DRIDriverVtableExtensionRec dri_kms_vtable = { -+static const struct __DRIDriverVtableExtensionRec dri_swrast_kms_vtable = { - .base = { __DRI_DRIVER_VTABLE, 1 }, -- .vtable = &dri_kms_driver_api, -+ .vtable = &dri_swrast_kms_driver_api, - }; - --const __DRIextension *dri_kms_driver_extensions[] = { -+const __DRIextension *dri_swrast_kms_driver_extensions[] = { - &driCoreExtension.base, - &driImageDriverExtension.base, -- &driDRI2Extension.base, -+ &swkmsDRI2Extension.base, - &gallium_config_options.base, -- &dri_kms_vtable.base, -+ &dri_swrast_kms_vtable.base, - NULL - }; - -diff --git a/src/gallium/frontends/dri/dri_screen.h b/src/gallium/frontends/dri/dri_screen.h -index 0ee2feb..0bb8817 100644 ---- a/src/gallium/frontends/dri/dri_screen.h -+++ b/src/gallium/frontends/dri/dri_screen.h -@@ -168,8 +168,8 @@ dri_destroy_screen_helper(struct dri_screen * screen); - void - dri_destroy_screen(__DRIscreen * sPriv); - --extern const struct __DriverAPIRec dri_kms_driver_api; --extern const __DRIextension *dri_kms_driver_extensions[]; -+extern const struct __DriverAPIRec dri_swrast_kms_driver_api; -+extern const __DRIextension *dri_swrast_kms_driver_extensions[]; - extern const struct __DriverAPIRec galliumdrm_driver_api; - extern const __DRIextension *galliumdrm_driver_extensions[]; - extern const struct __DriverAPIRec galliumsw_driver_api; -diff --git a/src/gallium/frontends/dri/dri_util.c b/src/gallium/frontends/dri/dri_util.c -index 8d60526..03614e1 100644 ---- a/src/gallium/frontends/dri/dri_util.c -+++ b/src/gallium/frontends/dri/dri_util.c -@@ -187,7 +187,7 @@ swkmsCreateNewScreen(int scrn, int fd, - const __DRIconfig ***driver_configs, void *data) - { - return driCreateNewScreen2(scrn, fd, extensions, -- dri_kms_driver_extensions, -+ dri_swrast_kms_driver_extensions, - driver_configs, data); - } - -diff --git a/src/gallium/targets/dri/target.c b/src/gallium/targets/dri/target.c -index 9b78351..e02b03b 100644 ---- a/src/gallium/targets/dri/target.c -+++ b/src/gallium/targets/dri/target.c -@@ -25,7 +25,7 @@ const __DRIextension **__driDriverGetExtensions_kms_swrast(void); - - PUBLIC const __DRIextension **__driDriverGetExtensions_kms_swrast(void) - { -- return dri_kms_driver_extensions; -+ return dri_swrast_kms_driver_extensions; - } - - #endif 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 deleted file mode 100644 index 5c6165c281..0000000000 --- a/meta/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch +++ /dev/null @@ -1,47 +0,0 @@ -From fdb2face4eeac3c20eedcca7520f4e7014225fb4 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 36c5e52..f0a0097 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 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 <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". 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 af11baee86..0000000000 --- a/meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch +++ /dev/null @@ -1,61 +0,0 @@ -From bf41fa026ae3d378e62fd83d03a6f5933b52ca04 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 - -Upstream-Status: Inappropriate [configuration] ---- - meson.build | 7 +++++-- - meson_options.txt | 6 ++++++ - 2 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index 70d06c0..1441611 100644 ---- a/meson.build -+++ b/meson.build -@@ -490,8 +490,11 @@ foreach platform : _platforms - pre_args += '-DHAVE_@0@_PLATFORM'.format(platform.to_upper()) - endforeach - --use_elf_tls = true --pre_args += '-DUSE_ELF_TLS' -+use_elf_tls = false -+if get_option('elf-tls') -+ use_elf_tls = true -+ pre_args += '-DUSE_ELF_TLS' -+endif - - if with_platform_android and get_option('platform-sdk-version') >= 29 - # By default the NDK compiler, at least, emits emutls references instead of -diff --git a/meson_options.txt b/meson_options.txt -index 1f6ef38..99cc5cb 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -440,6 +440,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('egl-lib-suffix', - type : 'string', - value : '', diff --git a/meta/recipes-graphics/mesa/libglu_9.0.2.bb b/meta/recipes-graphics/mesa/libglu_9.0.3.bb index 0d27dd116b..8151727c52 100644 --- a/meta/recipes-graphics/mesa/libglu_9.0.2.bb +++ b/meta/recipes-graphics/mesa/libglu_9.0.3.bb @@ -11,15 +11,18 @@ LIC_FILES_CHKSUM = "file://include/GL/glu.h;endline=29;md5=6b79c570f644363b35645 # Epoch as this used to be part of mesa PE = "2" -SRC_URI = "https://mesa.freedesktop.org/archive/glu/glu-${PV}.tar.gz" +SRC_URI = "https://mesa.freedesktop.org/archive/glu/glu-${PV}.tar.xz \ + " -SRC_URI[sha256sum] = "24effdfb952453cc00e275e1c82ca9787506aba0282145fff054498e60e19a65" +SRC_URI[sha256sum] = "bd43fe12f374b1192eb15fe20e45ff456b9bc26ab57f0eee919f96ca0f8a330f" S = "${WORKDIR}/glu-${PV}" DEPENDS = "virtual/libgl" -inherit autotools pkgconfig features_check +inherit meson pkgconfig features_check + +EXTRA_OEMESON = "-Dgl_provider=gl" # Requires libGL.so which is provided by mesa when x11 in DISTRO_FEATURES REQUIRED_DISTRO_FEATURES = "x11 opengl" diff --git a/meta/recipes-graphics/mesa/mesa-demos_8.5.0.bb b/meta/recipes-graphics/mesa/mesa-demos_8.5.0.bb index 6e9b95e1e2..12f41d75a5 100644 --- a/meta/recipes-graphics/mesa/mesa-demos_8.5.0.bb +++ b/meta/recipes-graphics/mesa/mesa-demos_8.5.0.bb @@ -30,7 +30,7 @@ PACKAGECONFIG[gles1] = "-Dgles1=enabled,-Dgles1=disabled,virtual/libgles1" PACKAGECONFIG[gles2] = "-Dgles2=enabled,-Dgles2=disabled,virtual/libgles2" PACKAGECONFIG[glut] = "-Dwith-glut=${STAGING_EXECPREFIXDIR},,freeglut" PACKAGECONFIG[osmesa] = "-Dosmesa=enabled,-Dosmesa=disabled," -PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,virtual/libgl wayland wayland-native" +PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,virtual/libgl wayland wayland-native wayland-protocols" PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 libglu" do_install:append() { diff --git a/meta/recipes-graphics/mesa/mesa-gl_22.1.5.bb b/meta/recipes-graphics/mesa/mesa-gl_22.1.5.bb deleted file mode 100644 index f2bc8f6b5b..0000000000 --- a/meta/recipes-graphics/mesa/mesa-gl_22.1.5.bb +++ /dev/null @@ -1,13 +0,0 @@ -require mesa.inc - -SUMMARY += " (OpenGL only, no EGL/GLES)" - -PROVIDES = "virtual/libgl virtual/mesa" - -S = "${WORKDIR}/mesa-${PV}" - -# At least one DRI rendering engine is required to build mesa. -# When no X11 is available, use osmesa for the rendering engine. -PACKAGECONFIG ??= "opengl ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa gallium', d)}" -PACKAGECONFIG:class-target = "opengl ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa gallium', d)}" - diff --git a/meta/recipes-graphics/mesa/mesa-gl_24.0.5.bb b/meta/recipes-graphics/mesa/mesa-gl_24.0.5.bb new file mode 100644 index 0000000000..ca160f1bfc --- /dev/null +++ b/meta/recipes-graphics/mesa/mesa-gl_24.0.5.bb @@ -0,0 +1,15 @@ +require mesa.inc + +SUMMARY += " (OpenGL only, no EGL/GLES)" + +PROVIDES = "virtual/libgl virtual/mesa" + +S = "${WORKDIR}/mesa-${PV}" + +TARGET_CFLAGS = "-I${STAGING_INCDIR}/drm" + +# At least one DRI rendering engine is required to build mesa. +# When no X11 is available, use osmesa for the rendering engine. +PACKAGECONFIG ??= "opengl gallium ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa', d)}" +PACKAGECONFIG:class-target = "opengl gallium ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa', d)}" + diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index fccf14a7d1..77e9c80fcb 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -10,37 +10,38 @@ HOMEPAGE = "http://mesa3d.org" BUGTRACKER = "https://bugs.freedesktop.org" SECTION = "x11" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://docs/license.rst;md5=9a383ee9f65a4e939d6630e9b067ff58" +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=63779ec98d78d823a9dc533a0735ef10" PE = "2" SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ - file://0002-meson.build-make-TLS-ELF-optional.patch \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ - file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \ - file://0001-util-format-Check-for-NEON-before-using-it.patch \ - file://0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch \ - file://0001-swrast_kms-use-swkmsDRI2Extension-instead-of-driDRI2.patch \ - file://0001-nir-nir_opt_move-fix-ALWAYS_INLINE-compiler-error.patch \ - " + file://0001-drisw-fix-build-without-dri3.patch \ + file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \ + file://0001-Revert-meson-do-not-pull-in-clc-for-clover.patch \ +" -SRC_URI[sha256sum] = "6fd60d38efdd25317948c61494b5117e01d42da695278728b1faef9f5f9a47ba" +SRC_URI[sha256sum] = "38cc245ca8faa3c69da6d2687f8906377001f63365348a62cc6f7fafb1e8c018" UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)" #because we cannot rely on the fact that all apps will use pkgconfig, #make eglplatform.h independent of MESA_EGL_NO_X11_HEADER do_install:append() { - if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then - sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h - fi + # sed can't find EGL/eglplatform.h as it doesn't get installed when glvnd enabled. + # So, check if EGL/eglplatform.h exists before running sed. + if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)} && [ -f ${D}${includedir}/EGL/eglplatform.h ]; then + sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h + fi } DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native" +DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-native', '', d)}" EXTRANATIVEPATH += "chrpath-native" PROVIDES = " \ ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'glvnd', 'virtual/libglx', '', d)} \ ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \ ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \ ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \ @@ -51,16 +52,10 @@ inherit meson pkgconfig python3native gettext features_check BBCLASSEXTEND = "native nativesdk" -ANY_OF_DISTRO_FEATURES:class-target = "opengl vulkan" +ANY_OF_DISTRO_FEATURES = "opengl vulkan" PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}" -export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-config" -export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}" -export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" - -MESA_LLVM_RELEASE ?= "${LLVMVERSION}" - # set the MESA_BUILD_TYPE to either 'release' (default) or 'debug' # by default the upstream mesa sources build a debug release # here we assume the user will want a release build by default @@ -80,26 +75,30 @@ EXTRA_OEMESON = " \ -Dplatforms='${@",".join("${PLATFORMS}".split())}' \ " +EXTRA_OEMESON:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}" +EXTRA_OEMESON:append:class-native = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled', '', d)}" + def strip_comma(s): return s.strip(',') PACKAGECONFIG = " \ gallium \ + video-codecs \ ${@bb.utils.filter('DISTRO_FEATURES', 'x11 vulkan wayland', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm virgl', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'dri3', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \ - ${@bb.utils.contains('TCLIBC', 'glibc', 'elf-tls', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'zink', '', d)} \ " +PACKAGECONFIG:append:class-native = "gallium-llvm r600" + # "gbm" requires "opengl" PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled" X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr" # "x11" requires "opengl" PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}" -PACKAGECONFIG[elf-tls] = "-Delf-tls=true, -Delf-tls=false" -PACKAGECONFIG[xvmc] = "-Dgallium-xvmc=enabled,-Dgallium-xvmc=disabled,libxvmc" PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols" PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence" @@ -107,13 +106,36 @@ PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence" # Vulkan drivers need dri3 enabled # amd could be enabled as well but requires gallium-llvm with llvm >= 3.9 VULKAN_DRIVERS = "" -VULKAN_DRIVERS:append:x86:class-target = ",intel" -VULKAN_DRIVERS:append:x86-64:class-target = ",intel" +VULKAN_DRIVERS:append:x86 = ",intel,amd" +VULKAN_DRIVERS:append:x86-64 = ",intel,amd" +# i686 is a 32 bit override for mesa-native +VULKAN_DRIVERS:append:i686 = ",intel,amd" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}" -PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers=''," +VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',swrast', '', d)}" +VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'imagination', ',imagination-experimental', '', d)}" +PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers" + +# mesa development and testing tools support, per driver +TOOLS = "" +TOOLS_DEPS = "" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'imagination', ',imagination', '', d)}" + +# dependencies for tools. +TOOLS_DEPS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ' ncurses libxml2 ', '', d)}" + +# the fdperf tool requires libconfig (a part of meta-oe) so it needs special +# treatment in addition to the usual 'freedreno tools'. +PACKAGECONFIG[freedreno-fdperf] = ",,libconfig" + +PACKAGECONFIG[tools] = "-Dtools=${@strip_comma('${TOOLS}')}, -Dtools='', ${TOOLS_DEPS}" PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false" +PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false, libglvnd" # "gles" requires "opengl" PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled" @@ -122,7 +144,8 @@ PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2 PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled" # "opencl" requires libclc from meta-clang and spirv-tools from OE-Core -PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools" +OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}" +PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native" PACKAGECONFIG[broadcom] = "" PACKAGECONFIG[etnaviv] = "" @@ -130,52 +153,65 @@ PACKAGECONFIG[freedreno] = "" PACKAGECONFIG[kmsro] = "" PACKAGECONFIG[vc4] = "" PACKAGECONFIG[v3d] = "" +PACKAGECONFIG[zink] = "" GALLIUMDRIVERS = "swrast" # gallium swrast was found to crash Xorg on startup in x32 qemu GALLIUMDRIVERS:x86-x32 = "" -GALLIUMDRIVERS:append:x86:class-target = ",i915,iris,crocus" -GALLIUMDRIVERS:append:x86-64:class-target = ",i915,iris,crocus" +GALLIUMDRIVERS:append:x86 = ",i915,iris,crocus" +GALLIUMDRIVERS:append:x86-64 = ",i915,iris,crocus" +# i686 is a 32 bit override for mesa-native +GALLIUMDRIVERS:append:i686 = ",i915,iris,crocus" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}" +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}" # radeonsi requires LLVM GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}" -GALLIUMDRIVERS_LLVM = "r300,nouveau${GALLIUMDRIVERS_RADEONSI}" -GALLIUMDRIVERS_LLVM:append:x86:class-target = ",svga" -GALLIUMDRIVERS_LLVM:append:x86-64:class-target = ",svga" +GALLIUMDRIVERS_LLVM = ",r300,nouveau${GALLIUMDRIVERS_RADEONSI}" +GALLIUMDRIVERS_LLVM:append:x86 = ",svga" +GALLIUMDRIVERS_LLVM:append:x86-64 = ",svga" +# i686 is a 32 bit override for mesa-native +GALLIUMDRIVERS_LLVM:append:i686 = ",svga" PACKAGECONFIG[r600] = "" PACKAGECONFIG[virgl] = "" -GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', '${GALLIUMDRIVERS_LLVM}', '', d)}" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}" GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}" PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm" -PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm${MESA_LLVM_RELEASE} llvm-native \ - elfutils" +PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm llvm-native elfutils" PACKAGECONFIG[xa] = "-Dgallium-xa=enabled, -Dgallium-xa=disabled" PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial" - PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau" +PACKAGECONFIG[imagination] = "-Dimagination-srv=true,-Dimagination-srv=false" + PACKAGECONFIG[lima] = "" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}" PACKAGECONFIG[panfrost] = "" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" +PACKAGECONFIG[vulkan-beta] = "-Dvulkan-beta=true,-Dvulkan-beta=false" + PACKAGECONFIG[osmesa] = "-Dosmesa=true,-Dosmesa=false" +PACKAGECONFIG[perfetto] = "-Dperfetto=true,-Dperfetto=false,libperfetto" + PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind" PACKAGECONFIG[lmsensors] = "-Dlmsensors=enabled,-Dlmsensors=disabled,lmsensors" +VIDEO_CODECS ?= "${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'all', 'all_free', d)}" +PACKAGECONFIG[video-codecs] = "-Dvideo-codecs=${VIDEO_CODECS}, -Dvideo-codecs=''" + # llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2) FULL_OPTIMIZATION:append = " -fno-omit-frame-pointer" @@ -197,6 +233,7 @@ RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'lib PACKAGES =+ "libegl-mesa libegl-mesa-dev \ libosmesa libosmesa-dev \ libgl-mesa libgl-mesa-dev \ + libglx-mesa libglx-mesa-dev \ libglapi libglapi-dev \ libgbm libgbm-dev \ libgles1-mesa libgles1-mesa-dev \ @@ -205,7 +242,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \ libopencl-mesa libopencl-mesa-dev \ libxatracker libxatracker-dev \ mesa-megadriver mesa-vulkan-drivers \ - mesa-vdpau-drivers \ + mesa-vdpau-drivers mesa-tools \ " do_install:append () { @@ -215,14 +252,18 @@ do_install:append () { rm -f ${D}${libdir}/gallium-pipe/*.la rm -f ${D}${libdir}/gbm/*.la - # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used - chrpath --delete ${D}${libdir}/dri/*_dri.so || true - # libwayland-egl has been moved to wayland 1.15+ rm -f ${D}${libdir}/libwayland-egl* rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc } +do_install:append:class-native () { + if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'true', 'false', d)}; then + install -d ${D}${bindir} + install -m0755 ${B}/src/intel/compiler/intel_clc ${D}${bindir} + fi +} + # For the packages that make up the OpenGL interfaces, inject variables so that # they don't get Debian-renamed (which would remove the -mesa suffix), and # RPROVIDEs/RCONFLICTs on the generic libgl name. @@ -233,6 +274,7 @@ python __anonymous() { suffix = "-native" for p in (("egl", "libegl", "libegl1"), ("opengl", "libgl", "libgl1"), + ("glvnd", "libglx",), ("gles", "libgles1", "libglesv1-cm1"), ("gles", "libgles2", "libglesv2-2"), ("gles", "libgles3",), @@ -283,28 +325,30 @@ python mesa_populate_packages() { do_split_packages(d, pipe_drivers_root, r'^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='') } -PACKAGESPLITFUNCS:prepend = "mesa_populate_packages " +PACKAGESPLITFUNCS =+ "mesa_populate_packages" PACKAGES_DYNAMIC += "^mesa-driver-.*" PACKAGES_DYNAMIC:class-native = "^mesa-driver-.*-native" FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d" -FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan" +FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${libdir}/libpowervr_rogue.so ${datadir}/vulkan" FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*" -FILES:libegl-mesa = "${libdir}/libEGL.so.*" +FILES:libegl-mesa = "${libdir}/libEGL*.so.* ${datadir}/glvnd/egl_vendor.d" FILES:libgbm = "${libdir}/libgbm.so.*" FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*" FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*" FILES:libgl-mesa = "${libdir}/libGL.so.*" -FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${sysconfdir}/OpenCL/vendors/mesa.icd" +FILES:libglx-mesa = "${libdir}/libGLX*.so.*" +FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd" FILES:libglapi = "${libdir}/libglapi.so.*" FILES:libosmesa = "${libdir}/libOSMesa.so.*" FILES:libxatracker = "${libdir}/libxatracker.so.*" FILES:${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan ${libdir}/vdpau/*.so" -FILES:libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" +FILES:libegl-mesa-dev = "${libdir}/libEGL*.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" FILES:libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h" FILES:libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc" +FILES:libglx-mesa-dev = "${libdir}/libGLX*.*" FILES:libglapi-dev = "${libdir}/libglapi.*" FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc" FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc" @@ -314,6 +358,9 @@ FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir} FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \ ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \ ${libdir}/pkgconfig/xatracker.pc" +# catch all to get all the tools and data +FILES:${PN}-tools = "${bindir} ${datadir}" +ALLOW_EMPTY:${PN}-tools = "1" # Fix upgrade path from mesa to mesa-megadriver RREPLACES:mesa-megadriver = "mesa" diff --git a/meta/recipes-graphics/mesa/mesa_22.1.5.bb b/meta/recipes-graphics/mesa/mesa_24.0.5.bb index 96e8aa38d6..96e8aa38d6 100644 --- a/meta/recipes-graphics/mesa/mesa_22.1.5.bb +++ b/meta/recipes-graphics/mesa/mesa_24.0.5.bb |