summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa/mesa.inc
diff options
context:
space:
mode:
authorMarkus Volk <f_l_k@t-online.de>2023-09-07 10:33:20 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-09 12:04:55 +0100
commitdd7fdb4dee079e7b3d8f1567c5d6576dc2170ab1 (patch)
treeb0cfff24f03d862cc7ecc831d5f7dd0c6bde5498 /meta/recipes-graphics/mesa/mesa.inc
parent29362665c8ff388da389717d21f27c064cdda653 (diff)
downloadpoky-dd7fdb4dee079e7b3d8f1567c5d6576dc2170ab1.tar.gz
mesa: add intel raytracing support to opencl build
Recently mesa added a patch that allows to cross-compile Intel Vulkan ray tracing support. - Backport this patch - Build and install intel_clc for mesa-native - Add a dependency on mesa-native to provide intel_clc for target build - Add a dependency on python3-ply-native as needed to build intel-clc - Automatically build Intel Vulkan ray tracing support if the opencl packageconfig was added (From OE-Core rev: 25fbe4d1dcfa329f0229eb3ed384b8b84583bd45) Signed-off-by: Markus Volk <f_l_k@t-online.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/mesa/mesa.inc')
-rw-r--r--meta/recipes-graphics/mesa/mesa.inc15
1 files changed, 13 insertions, 2 deletions
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 79a1d975bf..83535eb472 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -18,6 +18,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
18 file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ 18 file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \
19 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ 19 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
20 file://0001-gallium-Fix-build-with-llvm-17.patch \ 20 file://0001-gallium-Fix-build-with-llvm-17.patch \
21 file://0001-intel-Allow-using-intel_clc-from-the-system.patch \
21 " 22 "
22 23
23SRC_URI[sha256sum] = "2f6d7381bc10fbd2d6263ad1022785b8b511046c1a904162f8f7da18eea8aed9" 24SRC_URI[sha256sum] = "2f6d7381bc10fbd2d6263ad1022785b8b511046c1a904162f8f7da18eea8aed9"
@@ -35,6 +36,7 @@ do_install:append() {
35} 36}
36 37
37DEPENDS = "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"
39DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-native', '', d)}"
38EXTRANATIVEPATH += "chrpath-native" 40EXTRANATIVEPATH += "chrpath-native"
39PROVIDES = " \ 41PROVIDES = " \
40 ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ 42 ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
@@ -72,6 +74,9 @@ EXTRA_OEMESON = " \
72 -Dplatforms='${@",".join("${PLATFORMS}".split())}' \ 74 -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
73" 75"
74 76
77EXTRA_OEMESON:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}"
78EXTRA_OEMESON:append:class-native = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled', '', d)}"
79
75def strip_comma(s): 80def strip_comma(s):
76 return s.strip(',') 81 return s.strip(',')
77 82
@@ -137,7 +142,7 @@ PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
137 142
138# "opencl" requires libclc from meta-clang and spirv-tools from OE-Core 143# "opencl" requires libclc from meta-clang and spirv-tools from OE-Core
139OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}" 144OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}"
140PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools" 145PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native"
141 146
142PACKAGECONFIG[broadcom] = "" 147PACKAGECONFIG[broadcom] = ""
143PACKAGECONFIG[etnaviv] = "" 148PACKAGECONFIG[etnaviv] = ""
@@ -181,7 +186,6 @@ PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}
181PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm llvm-native elfutils" 186PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm llvm-native elfutils"
182PACKAGECONFIG[xa] = "-Dgallium-xa=enabled, -Dgallium-xa=disabled" 187PACKAGECONFIG[xa] = "-Dgallium-xa=enabled, -Dgallium-xa=disabled"
183PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial" 188PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial"
184
185PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau" 189PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau"
186 190
187PACKAGECONFIG[lima] = "" 191PACKAGECONFIG[lima] = ""
@@ -248,6 +252,13 @@ do_install:append () {
248 rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc 252 rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc
249} 253}
250 254
255do_install:append:class-native () {
256 if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'true', 'false', d)}; then
257 install -d ${D}${bindir}
258 install -m0755 ${B}/src/intel/compiler/intel_clc ${D}${bindir}
259 fi
260}
261
251# For the packages that make up the OpenGL interfaces, inject variables so that 262# For the packages that make up the OpenGL interfaces, inject variables so that
252# they don't get Debian-renamed (which would remove the -mesa suffix), and 263# they don't get Debian-renamed (which would remove the -mesa suffix), and
253# RPROVIDEs/RCONFLICTs on the generic libgl name. 264# RPROVIDEs/RCONFLICTs on the generic libgl name.