summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2025-04-10 05:54:49 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-04-11 11:44:22 +0100
commite34a6ed07b42e4b1c4a9e21badc3e66bf747b7b0 (patch)
treecea302fbc3c37147bf6caab788fb5c57564592f8
parent18ca038b7e03ac57565c9d5d3d9f6844fea92415 (diff)
downloadpoky-e34a6ed07b42e4b1c4a9e21badc3e66bf747b7b0.tar.gz
mesa: upgrade 24.0.7 -> 25.0.2
Upgrade the Mesa package, dropping applied and refreshing outstanding patches. The dri3 config option is now gone, dependencies are merged into X11 deps. The swrast gallium driver has been split into softpipe and llvmpipe drivers. Reworked OpenCL support to use mesa_clc compiler. License-Update: license text cleared and clarified. (From OE-Core rev: f9eb0468e45ee5a6a3b3195ef5e78c328c4347c9) Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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-amd-Include-missing-llvm-IR-header-Module.h.patch41
-rw-r--r--meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch58
-rw-r--r--meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch46
-rw-r--r--meta/recipes-graphics/mesa/files/0001-meson-disable-SIMD-blake-optimisations-on-x32-host.patch28
-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/mesa.inc91
7 files changed, 117 insertions, 242 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
deleted file mode 100644
index 1711e22585..0000000000
--- a/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From 051f41beda540f0ae77b341db01a6de83c9e938a Mon Sep 17 00:00:00 2001
2From: Markus Volk <f_l_k@t-online.de>
3Date: Fri, 8 Mar 2024 15:53:11 +0100
4Subject: [PATCH] Revert "meson: do not pull in clc for clover"
5
6This reverts commit 815a6647eb1383e9dc704ffcc266d85f3b13338a.
7Upstream-Status: Inappropriate [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27783/diffs?commit_id=a976f2c9f0c07f9e06cc9affd9124b45bc60c2bd]
8
9Once 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.
10For now reverting this commit allows to still use clover with opencl-spirv, which would otherwise be broken starting from mesa 24.0.2.
11
12After it was merged, this patch needs to be removed and rusticl support will be required
13
14Signed-off-by: Markus Volk <f_l_k@t-online.de>
15---
16 meson.build | 3 ++-
17 src/compiler/meson.build | 2 +-
18 2 files changed, 3 insertions(+), 2 deletions(-)
19
20diff --git a/meson.build b/meson.build
21index 2db6185..741b5d1 100644
22--- a/meson.build
23+++ b/meson.build
24@@ -813,6 +813,7 @@ if _opencl != 'disabled'
25 error('The Clover OpenCL state tracker requires rtti')
26 endif
27
28+ with_clc = true
29 with_gallium_opencl = true
30 with_opencl_icd = _opencl == 'icd'
31 else
32@@ -837,7 +838,7 @@ if with_gallium_rusticl
33 endif
34
35 dep_clc = null_dep
36-if with_gallium_opencl or with_clc
37+if with_clc
38 dep_clc = dependency('libclc')
39 endif
40
41diff --git a/src/compiler/meson.build b/src/compiler/meson.build
42index 8d73544..1dae56d 100644
43--- a/src/compiler/meson.build
44+++ b/src/compiler/meson.build
45@@ -79,7 +79,7 @@ subdir('nir')
46
47 subdir('spirv')
48
49-if with_clc
50+if with_opencl_spirv
51 subdir('clc')
52 endif
53 if with_gallium
diff --git a/meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch b/meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch
deleted file mode 100644
index 82ad88a079..0000000000
--- a/meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From 777d69cf15b80ab1f109a4936d6e4801c4b0e0f3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 1 Jul 2024 23:09:29 -0700
4Subject: [PATCH] amd: Include missing llvm IR header Module.h
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9With LLVM-19, Module.h header is not being pulled, which results in
10compile errors e.g.
11
12src/amd/llvm/ac_llvm_helper.cpp:102:10: error: no matching function for call to ‘unwrap(LLVMOpaqueModule*&)’
13 102 | unwrap(module)->setTargetTriple(TM->getTargetTriple().getTriple());
14 | ~~~~~~^~~~~~~~
15In file included from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/Type.h:18,
16 from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/DerivedTypes.h:23,
17 from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/InstrTypes.h:26,
18 from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/Analysis/TargetLibraryInfo.h:14,
19 from ../mesa-24.0.7/src/amd/llvm/ac_llvm_helper.cpp:8:
20
21Its getting the definition from llvm/IR/Type.h instead of Module.h and caused
22confusion to compiler
23
24Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29993]
25Signed-off-by: Khem Raj <raj.khem@gmail.com>
26---
27 src/amd/llvm/ac_llvm_helper.cpp | 1 +
28 1 file changed, 1 insertion(+)
29
30diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp
31index 5d065279ad1..af4a50f8409 100644
32--- a/src/amd/llvm/ac_llvm_helper.cpp
33+++ b/src/amd/llvm/ac_llvm_helper.cpp
34@@ -8,6 +8,7 @@
35 #include <llvm/Analysis/TargetLibraryInfo.h>
36 #include <llvm/IR/IRBuilder.h>
37 #include <llvm/IR/LegacyPassManager.h>
38+#include <llvm/IR/Module.h>
39 #include <llvm/IR/Verifier.h>
40 #include <llvm/Target/TargetMachine.h>
41 #include <llvm/MC/MCSubtargetInfo.h>
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
deleted file mode 100644
index ab16152090..0000000000
--- a/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 4bd15a419e892da843489c374c58c5b29c40b5d6 Mon Sep 17 00:00:00 2001
2From: Romain Naour <romain.naour@smile.fr>
3Date: Tue, 6 Feb 2024 09:47:09 +0100
4Subject: [PATCH 1/2] drisw: fix build without dri3
5
6commit 1887368df41 ("glx/sw: check for modifier support in the kopper path")
7added dri3_priv.h header and dri3_check_multibuffer() function in drisw that
8can be build without dri3.
9
10 i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in function `driswCreateScreenDriver':
11 drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined reference to `dri3_check_multibuffer'
12 collect2: error: ld returned 1 exit status
13
14Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using
15dri3_check_multibuffer().
16
17Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path")
18
19Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478]
20Signed-off-by: Romain Naour <romain.naour@smile.fr>
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22---
23 src/glx/drisw_glx.c | 4 ++++
24 1 file changed, 4 insertions(+)
25
26diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
27index 3d3f752..4b19e2d 100644
28--- a/src/glx/drisw_glx.c
29+++ b/src/glx/drisw_glx.c
30@@ -32,7 +32,9 @@
31 #include <dlfcn.h>
32 #include "dri_common.h"
33 #include "drisw_priv.h"
34+#ifdef HAVE_DRI3
35 #include "dri3_priv.h"
36+#endif
37 #include <X11/extensions/shmproto.h>
38 #include <assert.h>
39 #include <vulkan/vulkan_core.h>
40@@ -995,6 +997,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv,
41 goto handle_error;
42 }
43
44+#ifdef HAVE_DRI3
45 if (pdpyp->zink) {
46 bool err;
47 psc->has_multibuffer = dri3_check_multibuffer(priv->dpy, &err);
48@@ -1005,6 +1008,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv,
49 goto handle_error;
50 }
51 }
52+#endif
53
54 glx_config_destroy_list(psc->base.configs);
55 psc->base.configs = configs;
56--
572.44.0
58
diff --git a/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch b/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch
index 5975ab4472..953a724dc0 100644
--- a/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch
+++ b/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch
@@ -22,18 +22,29 @@ diff --git a/src/freedreno/afuc/meson.build b/src/freedreno/afuc/meson.build
22index bb7cebf5a748..351cc31ef2de 100644 22index bb7cebf5a748..351cc31ef2de 100644
23--- a/src/freedreno/afuc/meson.build 23--- a/src/freedreno/afuc/meson.build
24+++ b/src/freedreno/afuc/meson.build 24+++ b/src/freedreno/afuc/meson.build
25@@ -56,6 +56,7 @@ if with_tests 25@@ -56,10 +56,12 @@ if with_tests
26 asm_fw = custom_target('afuc_test.fw', 26 asm_fw = custom_target('afuc_test.fw',
27 output: 'afuc_test.fw', 27 output: 'afuc_test.fw',
28 command: [asm, '-g', '6', files('../.gitlab-ci/traces/afuc_test.asm'), '@OUTPUT@'], 28 command: [asm, files('../.gitlab-ci/traces/afuc_test.asm'), '@OUTPUT@'],
29+ env: {'RNN_PATH': rnn_src_path},
30 )
31 asm_fw_a7xx = custom_target('afuc_test_a7xx.fw',
32 output: 'afuc_test_a7xx.fw',
33 command: [asm, files('../.gitlab-ci/traces/afuc_test_a7xx.asm'), '@OUTPUT@'],
29+ env: {'RNN_PATH': rnn_src_path}, 34+ env: {'RNN_PATH': rnn_src_path},
30 ) 35 )
31 test('afuc-asm', 36 test('afuc-asm',
32 diff, 37 diff,
33@@ -120,6 +122,7 @@ if cc.sizeof('size_t') > 4 38@@ -120,11 +122,13 @@ if cc.sizeof('size_t') > 4
34 disasm_fw = custom_target('afuc_test.asm', 39 disasm_fw = custom_target('afuc_test.asm',
35 output: 'afuc_test.asm', 40 output: 'afuc_test.asm',
36 command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test.fw'), '-g', '630'], 41 command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test.fw')],
42+ env: {'RNN_PATH': rnn_src_path},
43 capture: true
44 )
45 disasm_fw_a7xx = custom_target('afuc_test_a7xx.asm',
46 output: 'afuc_test_a7xx.asm',
47 command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test_a7xx.fw')],
37+ env: {'RNN_PATH': rnn_src_path}, 48+ env: {'RNN_PATH': rnn_src_path},
38 capture: true 49 capture: true
39 ) 50 )
@@ -71,8 +82,29 @@ index 98e49b8fcf0e..145e72597eb9 100644
71-rnn_path = rnn_src_path + ':' + get_option('prefix') + '/' + rnn_install_path 82-rnn_path = rnn_src_path + ':' + get_option('prefix') + '/' + rnn_install_path
72+rnn_path = get_option('prefix') + '/' + rnn_install_path 83+rnn_path = get_option('prefix') + '/' + rnn_install_path
73 84
74 dep_lua = dependency('lua54', 'lua53', 'lua52', 'lua', required: false, 85 dep_libarchive = dependency('libarchive', allow_fallback: true, required: false)
75 allow_fallback: true, version: '>=5.2') 86 dep_libxml2 = dependency('libxml-2.0', allow_fallback: true, required: false)
76-- 87diff --git a/src/freedreno/registers/gen_header.py b/src/freedreno/registers/gen_header.py
88--- a/src/freedreno/registers/gen_header.py
89+++ b/src/freedreno/registers/gen_header.py
90@@ -885,13 +885,14 @@ The rules-ng-ng source files this header
91 """)
92 maxlen = 0
93 for filepath in p.xml_files:
94- maxlen = max(maxlen, len(filepath))
95+ maxlen = max(maxlen, len(os.path.basename(filepath)))
96 for filepath in p.xml_files:
97- pad = " " * (maxlen - len(filepath))
98+ filename = os.path.basename(filepath)
99+ pad = " " * (maxlen - len(filename))
100 filesize = str(os.path.getsize(filepath))
101 filesize = " " * (7 - len(filesize)) + filesize
102 filetime = time.ctime(os.path.getmtime(filepath))
103- print("- " + filepath + pad + " (" + filesize + " bytes, from " + filetime + ")")
104+ print("- " + filename + pad + " (" + filesize + " bytes, from " + filetime + ")")
105 if p.copyright_year:
106 current_year = str(datetime.date.today().year)
107 print()
108---
772.39.2 1092.39.2
78 110
diff --git a/meta/recipes-graphics/mesa/files/0001-meson-disable-SIMD-blake-optimisations-on-x32-host.patch b/meta/recipes-graphics/mesa/files/0001-meson-disable-SIMD-blake-optimisations-on-x32-host.patch
new file mode 100644
index 0000000000..bebe30037a
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-meson-disable-SIMD-blake-optimisations-on-x32-host.patch
@@ -0,0 +1,28 @@
1From f3c34b8da2662643089b33be8b93e56a4da8703d Mon Sep 17 00:00:00 2001
2From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
3Date: Wed, 2 Apr 2025 15:30:20 +0300
4Subject: [PATCH] meson: disable SIMD blake optimisations on x32 host
5
6On X.org startup libgallium crashes on x32 hosts inside
7blake3_hash_many_sse41(), most likely because of the different pointer
8size. Disable SIMD blake implementation if x32 is detected.
9
10Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
11Upstream-Status: Pending [will be submitted upstream after internal clearance]
12---
13 src/util/blake3/meson.build | 2 ++
14 1 file changed, 2 insertions(+)
15
16diff --git a/src/util/blake3/meson.build b/src/util/blake3/meson.build
17index 6b53daab6b32..ce6dd85ac1ea 100644
18--- a/src/util/blake3/meson.build
19+++ b/src/util/blake3/meson.build
20@@ -24,6 +24,8 @@ if cpu_family == 'x86_64'
21 else
22 files_blake3 += ['blake3_sse2_x86-64_windows_gnu.S', 'blake3_sse41_x86-64_windows_gnu.S', 'blake3_avx2_x86-64_windows_gnu.S', 'blake3_avx512_x86-64_windows_gnu.S']
23 endif
24+ elif meson.get_compiler('c').sizeof('void *') == 4
25+ blake3_defs += blake3_x86_no_simd_defs
26 else
27 files_blake3 += ['blake3_sse2_x86-64_unix.S', 'blake3_sse41_x86-64_unix.S', 'blake3_avx2_x86-64_unix.S', 'blake3_avx512_x86-64_unix.S']
28 endif
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
deleted file mode 100644
index 036a0b4945..0000000000
--- a/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From 62495ebb977866c52d5bed8499a547c49f0d9bc1 Mon Sep 17 00:00:00 2001
2From: Romain Naour <romain.naour@smile.fr>
3Date: Tue, 6 Feb 2024 09:47:10 +0100
4Subject: [PATCH 2/2] glxext: don't try zink if not enabled in mesa
5
6Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers")
7added an automatic zink fallback even when the zink gallium is not
8enabled at build time.
9
10It leads to unexpected error log while loading drisw driver and
11zink is not installed on the rootfs:
12
13 MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so
14
15Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers")
16
17Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478]
18Signed-off-by: Romain Naour <romain.naour@smile.fr>
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
20---
21 src/glx/glxext.c | 2 ++
22 1 file changed, 2 insertions(+)
23
24diff --git a/src/glx/glxext.c b/src/glx/glxext.c
25index 05c825a..7a06aa9 100644
26--- a/src/glx/glxext.c
27+++ b/src/glx/glxext.c
28@@ -908,9 +908,11 @@ __glXInitialize(Display * dpy)
29 #endif /* HAVE_DRI3 */
30 if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false))
31 dpyPriv->dri2Display = dri2CreateDisplay(dpy);
32+#if defined(HAVE_ZINK)
33 if (!dpyPriv->dri3Display && !dpyPriv->dri2Display)
34 try_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) &&
35 !getenv("GALLIUM_DRIVER");
36+#endif /* HAVE_ZINK */
37 }
38 #endif /* GLX_USE_DRM */
39 if (glx_direct)
40--
412.44.0
42
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index f6a91a7002..9edce6b228 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -10,21 +10,18 @@ HOMEPAGE = "http://mesa3d.org"
10BUGTRACKER = "https://bugs.freedesktop.org" 10BUGTRACKER = "https://bugs.freedesktop.org"
11SECTION = "x11" 11SECTION = "x11"
12LICENSE = "MIT" 12LICENSE = "MIT"
13LIC_FILES_CHKSUM = "file://docs/license.rst;md5=63779ec98d78d823a9dc533a0735ef10" 13LIC_FILES_CHKSUM = "file://docs/license.rst;md5=ffe678546d4337b732cfd12262e6af11"
14 14
15PE = "2" 15PE = "2"
16 16
17SRC_URI = "https://archive.mesa3d.org/mesa-${PV}.tar.xz \ 17SRC_URI = "https://archive.mesa3d.org/mesa-${PV}.tar.xz \
18 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ 18 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
19 file://0001-drisw-fix-build-without-dri3.patch \ 19 file://0001-meson-disable-SIMD-blake-optimisations-on-x32-host.patch \
20 file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \
21 file://0001-Revert-meson-do-not-pull-in-clc-for-clover.patch \
22 file://0001-amd-Include-missing-llvm-IR-header-Module.h.patch \
23 file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\ 20 file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\
24" 21"
25 22
26SRC_URI[sha256sum] = "7454425f1ed4a6f1b5b107e1672b30c88b22ea0efea000ae2c7d96db93f6c26a" 23SRC_URI[sha256sum] = "adf904d083b308df95898600ffed435f4b5c600d95fb6ec6d4c45638627fdc97"
27PV = "24.0.7" 24PV = "25.0.2"
28 25
29UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)" 26UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
30 27
@@ -38,8 +35,7 @@ do_install:append() {
38 fi 35 fi
39} 36}
40 37
41DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native" 38DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native python3-pyyaml-native"
42DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-native', '', d)}"
43EXTRANATIVEPATH += "chrpath-native" 39EXTRANATIVEPATH += "chrpath-native"
44PROVIDES = " \ 40PROVIDES = " \
45 ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ 41 ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
@@ -77,44 +73,47 @@ EXTRA_OEMESON = " \
77 -Dplatforms='${@",".join("${PLATFORMS}".split())}' \ 73 -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
78" 74"
79 75
80EXTRA_OEMESON:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}"
81EXTRA_OEMESON:append:class-native = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled', '', d)}"
82
83def strip_comma(s): 76def strip_comma(s):
84 return s.strip(',') 77 return s.strip(',')
85 78
79
86PACKAGECONFIG = " \ 80PACKAGECONFIG = " \
87 gallium \ 81 gallium \
88 video-codecs \ 82 video-codecs \
89 ${@bb.utils.filter('DISTRO_FEATURES', 'x11 vulkan wayland', d)} \ 83 ${@bb.utils.filter('DISTRO_FEATURES', 'x11 vulkan wayland', d)} \
90 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm virgl', '', d)} \ 84 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm virgl', '', d)} \
91 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'dri3', '', d)} \
92 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \
93 ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'zink', '', d)} \ 85 ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'zink', '', d)} \
94" 86"
95 87
96PACKAGECONFIG:append:class-native = " gallium-llvm r600" 88PACKAGECONFIG:append:x86 = " libclc gallium-llvm"
89PACKAGECONFIG:append:x86-64 = " libclc gallium-llvm"
90PACKAGECONFIG:append:i686 = " libclc gallium-llvm"
91PACKAGECONFIG:append:class-native = " libclc gallium-llvm r600"
97 92
98# "gbm" requires "opengl" 93# "gbm" requires "opengl"
99PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled" 94PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled"
100 95
101X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr" 96X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr xorgproto libxshmfence"
102# "x11" requires "opengl" 97# "x11" requires "opengl"
103PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}" 98PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}"
104PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols" 99PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols"
105 100
106PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence" 101VULKAN_DRIVERS_AMD = ""
102VULKAN_DRIVERS_AMD:x86 = ",amd"
103VULKAN_DRIVERS_AMD:x86-64 = ",amd"
104# i686 is a 32 bit override for mesa-native
105VULKAN_DRIVERS_AMD:i686 = ",amd"
106
107VULKAN_DRIVERS_INTEL = "${@bb.utils.contains('PACKAGECONFIG', 'libclc', ',intel', '', d)}"
108VULKAN_DRIVERS_SWRAST = ",swrast"
109# Crashes on x32
110VULKAN_DRIVERS_SWRAST:x86-x32 = ""
111VULKAN_DRIVERS_LLVM = "${VULKAN_DRIVERS_SWRAST}${VULKAN_DRIVERS_AMD}${VULKAN_DRIVERS_INTEL}"
107 112
108# Vulkan drivers need dri3 enabled
109# amd could be enabled as well but requires gallium-llvm with llvm >= 3.9
110VULKAN_DRIVERS = "" 113VULKAN_DRIVERS = ""
111VULKAN_DRIVERS:append:x86 = ",intel,amd"
112VULKAN_DRIVERS:append:x86-64 = ",intel,amd"
113# i686 is a 32 bit override for mesa-native
114VULKAN_DRIVERS:append:i686 = ",intel,amd"
115VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" 114VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
116VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}" 115VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}"
117VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',swrast', '', d)}" 116VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', '${VULKAN_DRIVERS_LLVM}', '', d)}"
118VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'imagination', ',imagination-experimental', '', d)}" 117VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'imagination', ',imagination-experimental', '', d)}"
119PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers" 118PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers"
120 119
@@ -137,7 +136,7 @@ PACKAGECONFIG[freedreno-fdperf] = ",,libconfig"
137PACKAGECONFIG[tools] = "-Dtools=${@strip_comma('${TOOLS}')}, -Dtools='', ${TOOLS_DEPS}" 136PACKAGECONFIG[tools] = "-Dtools=${@strip_comma('${TOOLS}')}, -Dtools='', ${TOOLS_DEPS}"
138 137
139PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false" 138PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
140PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false, libglvnd" 139PACKAGECONFIG[glvnd] = "-Dglvnd=enabled, -Dglvnd=disabled, libglvnd"
141 140
142# "gles" requires "opengl" 141# "gles" requires "opengl"
143PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled" 142PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled"
@@ -145,9 +144,9 @@ PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2
145# "egl" requires "opengl" 144# "egl" requires "opengl"
146PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled" 145PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
147 146
148# "opencl" requires libclc from meta-clang and spirv-tools from OE-Core 147# "opencl" also requires libclc and gallium-llvm to be present in PKGCONFIG!
149OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}" 148# Be sure to enable them both for the target and for the native build.
150PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native" 149PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd,-Dgallium-opencl=disabled,"
151 150
152PACKAGECONFIG[broadcom] = "" 151PACKAGECONFIG[broadcom] = ""
153PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native" 152PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native"
@@ -157,13 +156,13 @@ PACKAGECONFIG[vc4] = ""
157PACKAGECONFIG[v3d] = "" 156PACKAGECONFIG[v3d] = ""
158PACKAGECONFIG[zink] = "" 157PACKAGECONFIG[zink] = ""
159 158
160GALLIUMDRIVERS = "swrast" 159GALLIUMDRIVERS = "softpipe"
161# gallium swrast was found to crash Xorg on startup in x32 qemu 160# gallium swrast was found to crash Xorg on startup in x32 qemu
162GALLIUMDRIVERS:x86-x32 = "" 161GALLIUMDRIVERS:x86-x32 = ""
163GALLIUMDRIVERS:append:x86 = ",i915,iris,crocus" 162GALLIUMDRIVERS:append:x86 = ",i915,crocus"
164GALLIUMDRIVERS:append:x86-64 = ",i915,iris,crocus" 163GALLIUMDRIVERS:append:x86-64 = ",i915,crocus"
165# i686 is a 32 bit override for mesa-native 164# i686 is a 32 bit override for mesa-native
166GALLIUMDRIVERS:append:i686 = ",i915,iris,crocus" 165GALLIUMDRIVERS:append:i686 = ",i915,crocus"
167 166
168GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" 167GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
169GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" 168GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
@@ -173,8 +172,12 @@ GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', ''
173GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}" 172GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}"
174 173
175# radeonsi requires LLVM 174# radeonsi requires LLVM
175GALLIUMDRIVERS_IRIS = "${@bb.utils.contains('PACKAGECONFIG', 'libclc', ',iris', '', d)}"
176GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}" 176GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}"
177GALLIUMDRIVERS_LLVM = ",r300,nouveau${GALLIUMDRIVERS_RADEONSI}" 177GALLIUMDRIVERS_LLVMPIPE = ",llvmpipe"
178# llvmpipe crashes on x32
179GALLIUMDRIVERS_LLVMPIPE:x86-x32 = ""
180GALLIUMDRIVERS_LLVM = ",r300,nouveau${GALLIUMDRIVERS_LLVMPIPE}${GALLIUMDRIVERS_IRIS}${GALLIUMDRIVERS_RADEONSI}"
178GALLIUMDRIVERS_LLVM:append:x86 = ",svga" 181GALLIUMDRIVERS_LLVM:append:x86 = ",svga"
179GALLIUMDRIVERS_LLVM:append:x86-64 = ",svga" 182GALLIUMDRIVERS_LLVM:append:x86-64 = ",svga"
180# i686 is a 32 bit override for mesa-native 183# i686 is a 32 bit override for mesa-native
@@ -187,8 +190,16 @@ GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', '
187GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}" 190GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}"
188GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}" 191GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}"
189 192
193MESA_CLC = "system"
194MESA_CLC:class-native = "enabled"
195INSTALL_MESA_CLC = "false"
196INSTALL_MESA_CLC:class-native = "true"
197MESA_NATIVE = "mesa-native"
198MESA_NATIVE:class-native = ""
199
190PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm" 200PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm"
191PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm llvm-native elfutils" 201PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm llvm-native elfutils"
202PACKAGECONFIG[libclc] = "-Dmesa-clc=${MESA_CLC} -Dinstall-mesa-clc=${INSTALL_MESA_CLC},,libclc spirv-tools spirv-llvm-translator ${MESA_NATIVE}"
192PACKAGECONFIG[xa] = "-Dgallium-xa=enabled, -Dgallium-xa=disabled" 203PACKAGECONFIG[xa] = "-Dgallium-xa=enabled, -Dgallium-xa=disabled"
193PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial" 204PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial"
194PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau" 205PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau"
@@ -242,6 +253,7 @@ RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'lib
242 253
243PACKAGES =+ "libegl-mesa libegl-mesa-dev \ 254PACKAGES =+ "libegl-mesa libegl-mesa-dev \
244 libosmesa libosmesa-dev \ 255 libosmesa libosmesa-dev \
256 libgallium \
245 libgl-mesa libgl-mesa-dev \ 257 libgl-mesa libgl-mesa-dev \
246 libglx-mesa libglx-mesa-dev \ 258 libglx-mesa libglx-mesa-dev \
247 libglapi libglapi-dev \ 259 libglapi libglapi-dev \
@@ -267,13 +279,6 @@ do_install:append () {
267 rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc 279 rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc
268} 280}
269 281
270do_install:append:class-native () {
271 if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'true', 'false', d)}; then
272 install -d ${D}${bindir}
273 install -m0755 ${B}/src/intel/compiler/intel_clc ${D}${bindir}
274 fi
275}
276
277# For the packages that make up the OpenGL interfaces, inject variables so that 282# For the packages that make up the OpenGL interfaces, inject variables so that
278# they don't get Debian-renamed (which would remove the -mesa suffix), and 283# they don't get Debian-renamed (which would remove the -mesa suffix), and
279# RPROVIDEs/RCONFLICTs on the generic libgl name. 284# RPROVIDEs/RCONFLICTs on the generic libgl name.
@@ -344,7 +349,8 @@ FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d"
344FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${libdir}/libpowervr_rogue.so ${datadir}/vulkan" 349FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${libdir}/libpowervr_rogue.so ${datadir}/vulkan"
345FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*" 350FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*"
346FILES:libegl-mesa = "${libdir}/libEGL*.so.* ${datadir}/glvnd/egl_vendor.d" 351FILES:libegl-mesa = "${libdir}/libEGL*.so.* ${datadir}/glvnd/egl_vendor.d"
347FILES:libgbm = "${libdir}/libgbm.so.*" 352FILES:libgbm = "${libdir}/libgbm.so.* ${libdir}/gbm/*_gbm.so"
353FILES:libgallium = "${libdir}/libgallium-*.so"
348FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*" 354FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
349FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*" 355FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
350FILES:libgl-mesa = "${libdir}/libGL.so.*" 356FILES:libgl-mesa = "${libdir}/libGL.so.*"
@@ -372,6 +378,9 @@ FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
372FILES:${PN}-tools = "${bindir} ${datadir}" 378FILES:${PN}-tools = "${bindir} ${datadir}"
373ALLOW_EMPTY:${PN}-tools = "1" 379ALLOW_EMPTY:${PN}-tools = "1"
374 380
381# All DRI drivers are symlinks to libdril_dri.so
382INSANE_SKIP:${PN}-megadriver += "dev-so"
383
375# Fix upgrade path from mesa to mesa-megadriver 384# Fix upgrade path from mesa to mesa-megadriver
376RREPLACES:mesa-megadriver = "mesa" 385RREPLACES:mesa-megadriver = "mesa"
377RCONFLICTS:mesa-megadriver = "mesa" 386RCONFLICTS:mesa-megadriver = "mesa"