Skip to content

Commit 87a9849

Browse files
authored
recipes-graphics: Add recipe for qcom-adreno (#1041)
Introduce a new recipe for qcom-adreno that fetches Qualcomm Adreno User Mode libraries from Qartifactory and builds qcom-adreno package to enable Adreno GPU support on top of KGSL. These libraries include a set of user-mode drivers that support OpenGLES, Vulkan, and OpenCL APIs. GPU component in the DRM driver is disabled once skip_gpu module parameter is passed. However, support for this parameter in the DRM driver is currently under development and not yet available.
2 parents fad8b64 + fdbde5d commit 87a9849

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

recipes-bsp/packagegroups/packagegroup-qcom-ci.bb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ RDEPENDS:${PN}:append:aarch64 = " \
2121
iris-video-dlkm \
2222
kgsl-dlkm \
2323
qcom-fastcv-binaries \
24+
packagegroup-qcom-graphics \
2425
"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SUMMARY = "QCOM Graphics package group"
2+
3+
PACKAGE_ARCH = "${MACHINE_ARCH}"
4+
5+
inherit packagegroup
6+
7+
RDEPENDS:${PN} = " \
8+
${@bb.utils.contains('DISTRO_FEATURES', 'glvnd', 'qcom-adreno-egl', '', d)} \
9+
${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'qcom-adreno-vulkan', '', d)} \
10+
${@bb.utils.contains('DISTRO_FEATURES', 'opencl', 'qcom-adreno-cl', '', d)} \
11+
"
12+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
SUMMARY = "Qualcomm Adreno Graphics User Mode libraries"
2+
3+
DESCRIPTION = "Collection of prebuilt User Mode libraries to support OpenGL ES, Vulkan, and OpenCL APIs for Qualcomm Adreno GPUs."
4+
5+
LICENSE = "CLOSED"
6+
7+
# no top-level dir in the archive, unpack to subdir to prevent UNPACKDIR pollution
8+
SRC_URI = "https://qartifactory-edge.qualcomm.com/artifactory/qsc_releases/software/chip/component/gfx-adreno.le.0.0/250908/prebuilt_yocto/${BPN}_${PV}_armv8-2a.tar.gz;subdir=${BPN}-${PV}"
9+
10+
SRC_URI[sha256sum] = "02974d294597994a255f7aca6d6d61422fb44f11bd4cf6064e183c3888ea9def"
11+
12+
# These are listed here in order to identify RDEPENDS
13+
DEPENDS += " glib-2.0 libdmabufheap libdrm virtual/libgbm msm-gbm-backend \
14+
${@bb.utils.contains('DISTRO_FEATURES', 'glvnd', 'libglvnd', '', d)} \
15+
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \
16+
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxcb libx11 xcb-util-image', '', d)}"
17+
18+
inherit features_check
19+
20+
ANY_OF_DISTRO_FEATURES = "glvnd vulkan opencl"
21+
22+
PACKAGE_BEFORE_PN += " ${PN}-common ${PN}-gles1 ${PN}-gles2 ${PN}-egl ${PN}-vulkan ${PN}-cl"
23+
24+
RPROVIDES:${PN}-egl += "virtual-egl-icd"
25+
RPROVIDES:${PN}-cl += "virtual-opencl-icd"
26+
RPROVIDES:${PN}-vulkan += "virtual-vulkan-icd"
27+
28+
RDEPENDS:${PN}-common += " kgsl-dlkm"
29+
RDEPENDS:${PN}-egl += " ${PN}-common ${PN}-gles1 ${PN}-gles2"
30+
RDEPENDS:${PN}-vulkan += " ${PN}-common"
31+
RDEPENDS:${PN}-cl += " ${PN}-common"
32+
33+
do_install () {
34+
install -d ${D}/${libdir}
35+
cp -r ${S}/usr/lib/* ${D}/${libdir}/
36+
37+
if not ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
38+
rm ${D}/${libdir}/libeglSubDriverX11.so*
39+
fi
40+
41+
if not ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'true', 'false', d)}; then
42+
rm ${D}/${libdir}/libeglSubDriverWayland.so*
43+
fi
44+
45+
install -d ${D}${datadir}/glvnd/egl_vendor.d
46+
cp ${S}/usr/share/glvnd/egl_vendor.d/EGL_adreno.json ${D}${datadir}/glvnd/egl_vendor.d/
47+
48+
install -d ${D}${datadir}/vulkan/icd.d
49+
cp ${S}/usr/share/vulkan/icd.d/adrenovk.json ${D}${datadir}/vulkan/icd.d/
50+
51+
install -d ${D}${sysconfdir}/OpenCL/vendors
52+
cp ${S}/etc/OpenCL/vendors/adrenocl.icd ${D}${sysconfdir}/OpenCL/vendors/
53+
54+
install -d ${D}${sysconfdir}/modprobe.d
55+
cp ${S}/etc/modprobe.d/qcom-adreno.conf ${D}/${sysconfdir}/modprobe.d/qcom-adreno.conf
56+
}
57+
58+
FILES:${PN}-common = "${libdir}/libllvm-*.so.* \
59+
${libdir}/libgsl.so.1 \
60+
${libdir}/libadreno_utils.so.1 \
61+
${libdir}/libq3dtools_*.so.* \
62+
${sysconfdir}/modprobe.d/qcom-adreno.conf \
63+
${sysconfdir}/profile.d/qcom-adreno_env.sh"
64+
FILES:${PN}-egl = "${libdir}/libEGL_adreno.so.1 \
65+
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '${libdir}/libeglSubDriverWayland.so.*', '', d)} \
66+
${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${libdir}/libeglSubDriverX11.so.*', '', d)} \
67+
${datadir}/glvnd/egl_vendor.d/EGL_adreno.json"
68+
FILES:${PN}-gles2 = "${libdir}/libGLESv2*.so.*"
69+
FILES:${PN}-gles1 = "${libdir}/libGLESv1*.so.*"
70+
FILES:${PN}-vulkan = "${libdir}/libvulkan_*.so.* \
71+
${datadir}/vulkan/icd.d/adrenovk.json"
72+
FILES:${PN}-cl = "${libdir}/libOpenCL_*.so.* \
73+
${libdir}/libCB.so.1 \
74+
${sysconfdir}/OpenCL/vendors/adrenocl.icd"
75+
FILES:${PN} = ""
76+
77+
# Prebuilt libraries are already stripped
78+
INSANE_SKIP:${PN} = "already-stripped"

0 commit comments

Comments
 (0)