Skip to content

Commit

Permalink
Create new providers for EGL and DRM Libs
Browse files Browse the repository at this point in the history
The target to have these providers is to be able to choose
them instead of mesa open source drivers.
so that we can build against them, not mesa open source drivers.
  • Loading branch information
Bassem Mohsen committed Aug 25, 2017
1 parent 6a67249 commit 1a6473e
Show file tree
Hide file tree
Showing 13 changed files with 582 additions and 21 deletions.
22 changes: 1 addition & 21 deletions recipes-bsp/tegra-binaries/tegra-libraries_28.1.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@ do_install() {
install -m 0644 $f ${D}${libdir}/libv4l/plugins/
done
install -d ${D}${libdir}
for f in ${DRVROOT}/tegra/lib*; do
install -m 0644 $f ${D}${libdir}
done
for f in ${DRVROOT}/tegra-egl/lib*; do
install -m 0644 $f ${D}${libdir}
done
ln -sf libcuda.so.1.1 ${D}${libdir}/libcuda.so
ln -sf libcuda.so.1.1 ${D}${libdir}/libcuda.so.1
ln -sf libGL.so.1 ${D}${libdir}/libGL.so
ln -sf libEGL.so.1 ${D}${libdir}/libEGL.so
ln -sf libGLESv1_CM.so.1 ${D}${libdir}/libGLESv1_CM.so
ln -sf libGLESv2.so.2 ${D}${libdir}/libGLESv2.so
ln -sf libnvbuf_utils.so.1.0.0 ${D}${libdir}/libnvbuf_utils.so.1
ln -sf libnvbuf_utils.so.1.0.0 ${D}${libdir}/libnvbuf_utils.so
mv ${D}${libdir}/libdrm.so.2 ${D}${libdir}/libdrm-tegra.so.2
patchelf --set-soname libdrm-tegra.so.2 ${D}${libdir}/libdrm-tegra.so.2
ln -sf libdrm-tegra.so.2 ${D}${libdir}/libdrm-tegra.so
# nvcamera_daemon only looks in this special subdir, so symlink it
install -d ${D}${nonarch_libdir}/aarch64-linux-gnu
ln -snf ${libdir} ${D}${nonarch_libdir}/aarch64-linux-gnu/tegra-egl
Expand All @@ -54,12 +37,10 @@ do_install() {
install -m644 ${B}/usr/share/egl/egl_external_platform.d/* ${D}${datadir}/egl/egl_external_platform.d/
}

PACKAGES = "${PN}-libv4l-plugins ${PN}-argus libdrm-tegra libdrm-tegra-dev ${PN}"
PACKAGES = "${PN}-libv4l-plugins ${PN}-argus ${PN}"

FILES_${PN}-libv4l-plugins = "${libdir}/libv4l"
FILES_${PN}-argus = "${libdir}/libargus* ${sbindir}/argus_daemon"
FILES_libdrm-tegra = "${libdir}/libdrm-tegra${SOLIBS}"
FILES_libdrm-tegra-dev = "${libdir}/libdrm-tegra${SOLIBSDEV}"
FILES_${PN} = "${libdir} ${sbindir} ${nonarch_libdir} ${localstatedir} ${sysconfdir} ${datadir}/egl"
RDEPENDS_${PN} = "libasound"
RDEPENDS_${PN}-argus = "${PN}"
Expand All @@ -75,7 +56,6 @@ SYSTEMD_SERVICE_${PN}-argus = "argus-daemon.service"
INSANE_SKIP_${PN}-libv4l-plugins = "dev-so textrel ldflags build-deps"
INSANE_SKIP_${PN} = "dev-so textrel ldflags build-deps"
INSANE_SKIP_${PN}-argus = "dev-so ldflags"
INSANE_SKIP_libdrm-tegra = "ldflags"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
339 changes: 339 additions & 0 deletions recipes-bsp/tegra-drm/files/COPYING

Large diffs are not rendered by default.

Binary file added recipes-bsp/tegra-drm/files/drm-headers.tar.gz
Binary file not shown.
10 changes: 10 additions & 0 deletions recipes-bsp/tegra-drm/files/libdrm.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=OEPREFIX
exec_prefix=OEEXECPREFIX
libdir=OELIBDIR
includedir=OEINCDIR

Name: libdrm
Description: Nvidia pre-compiled libdrm
Version: 2.4.41
Libs: -L${libdir} -ldrm
Cflags: -I${includedir} -I${includedir}/libdrm
Binary file added recipes-bsp/tegra-drm/files/libdrm.so.2
Binary file not shown.
79 changes: 79 additions & 0 deletions recipes-bsp/tegra-drm/tegra-drm_28.1.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

DESCRIPTION = "Nvidia libdrm library in binary form"

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"

INSANE_SKIP_${PN} = "already-stripped \
dev-so \
dev-deps \
build-deps \
installed-vs-shipped \
ldflags \
"

DRM_PACKAGES = " \
virtual/libdrm \
libdrm \
libdrm-dev \
libdrm-drivers \
libdrm-doc \
libdrm-staticdev \
libdrm-dbg \
libdrm-locale \
drm \
"

PROVIDES = "${DRM_PACKAGES}"
RPROVIDES_${PN} = "${DRM_PACKAGES}"
CONFLICTS_${PN} = "${DRM_PACKAGES}"
REPLACES_${PN} = "${DRM_PACKAGES}"

PACKAGES = "${PN}"

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

S = "${WORKDIR}"

SRC_URI = "file://drm-headers.tar.gz \
file://COPYING \
file://libdrm.so.2 \
file://libdrm.pc.in \
"

do_install() {
# install lib
install -d -m 0755 ${D}/${libdir}
install -m 0775 ${WORKDIR}/libdrm.so.2 ${D}/${libdir}/
ln -sf libdrm.so.2 ${D}/${libdir}/libdrm.so

# install headers
install -d -m 0755 ${D}/${includedir}
install -m 0775 ${WORKDIR}/drm-headers/include/*.h ${D}/${includedir}

# install pc file
install -D ${WORKDIR}/libdrm.pc.in ${D}${libdir}/pkgconfig/libdrm.pc
sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/libdrm.pc
sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/libdrm.pc
sed -i s:OEINCDIR:${includedir}:g ${D}${libdir}/pkgconfig/libdrm.pc
sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/libdrm.pc
}

FILES_${PN} = "${libdir}/*.so* \
${includedir}/ \
"

FILES_${PN}-dev = "${libdir}/pkgconfig/"
25 changes: 25 additions & 0 deletions recipes-bsp/tegra-egl/files/0001-Force-wayland-to-be-enabled.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 15b100764eab162483fd18d367e9dd750976f17e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonatan=20P=C3=A5lsson?= <jonatan.palsson@pelagicore.com>
Date: Mon, 29 Feb 2016 15:16:05 +0100
Subject: [PATCH] Force wayland to be enabled

---
include/EGL/eglplatform.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
index 2bb4dd1..406f35e 100644
--- a/include/EGL/eglplatform.h
+++ b/include/EGL/eglplatform.h
@@ -1,6 +1,8 @@
#ifndef __eglplatform_h_
#define __eglplatform_h_

+#define WAYLAND 1
+
/*
** Copyright (c) 2007-2013 The Khronos Group Inc.
**
--
2.7.0

11 changes: 11 additions & 0 deletions recipes-bsp/tegra-egl/files/egl.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib/aarch64-linux-gnu/tegra-egl
includedir=${prefix}/include

Name: egl
Description: NVIDIA EGL library
Version: 11.1.2
Libs: -L${libdir} -lEGL
Libs.private: -lm -lpthread -ldl
Cflags: -I${includedir}
10 changes: 10 additions & 0 deletions recipes-bsp/tegra-egl/files/glesv2.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib/aarch64-linux-gnu/tegra-egl
includedir=${prefix}/include

Name: glesv2
Description: NVIDIA GLESv2 library
Version: 11.1.2
Libs: -L${libdir} -lGLESv2
Cflags: -I${includedir}
Binary file added recipes-bsp/tegra-egl/files/include.tar.gz
Binary file not shown.
Binary file added recipes-bsp/tegra-egl/files/lib-target.tar.gz
Binary file not shown.
10 changes: 10 additions & 0 deletions recipes-bsp/tegra-egl/files/wayland-egl.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=/usr
exec_prefix=/usr
libdir=${prefix}/lib/aarch64-linux-gnu/tegra-egl
includedir=/usr/include

Name: wayland-egl
Description: NVIDIA wayland-egl library
Version: 9.1.6
Libs: -L${libdir} -lwayland-egl
Cflags: -I${includedir}
97 changes: 97 additions & 0 deletions recipes-bsp/tegra-egl/tegra-egl_28.1.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

DESCRIPTION = "Nvidia drivers for graphics and multimedia libraries"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://lib-target/COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://include/COPYING;md5=751419260aa954499f7abaabaa882bbe"

INSANE_SKIP_${PN} = "already-stripped \
dev-so dev-deps \
build-deps textrel \
installed-vs-shipped"
ERROR_QA_remove = "ldflags"

SRC_URI = "file://lib-target.tar.gz \
file://include.tar.gz \
file://egl.pc \
file://glesv2.pc \
file://wayland-egl.pc \
file://nvidia-tegra-egl.conf \
"

SRC_URI_append = " ${@bb.utils.contains("DISTRO_FEATURES", "wayland", " file://0001-Force-wayland-to-be-enabled.patch ", "",d)}"

S = "${WORKDIR}"

GRAPHICS_PACKAGES = " \
virtual/libgles2 \
virtual/egl \
"

PROVIDES = "${GRAPHICS_PACKAGES}"
RPROVIDES_${PN} = "${GRAPHICS_PACKAGES}"
CONFLICTS_${PN} = "${GRAPHICS_PACKAGES}"
REPLACES_${PN} = "${GRAPHICS_PACKAGES}"

RPROVIDES_${PN} += " libGLESv2.so()(64bit) libEGL.so()(64bit) libcuda.so()(64bit)"
PROVIDES_append = " virtual/egl virtual/libgles2 "

PACKAGES = "${PN}"

DEPENDS = "wayland tegra-drm"

NV_DRV_VER = "${PN}"

do_install() {
# libs
install -d -m 0755 ${D}/${libdir}
install -m 0775 ./lib-target/*.so* ${D}/${libdir}

# headers
install -d ${D}/${includedir}/GLES2 ${D}/${includedir}/GLES3 ${D}/${includedir}/EGL ${D}/${includedir}/KHR
install -m 0775 include/*.h ${D}/${includedir}
install -m 0775 include/EGL/*.h ${D}/${includedir}/EGL
install -m 0775 include/GLES2/*.h ${D}/${includedir}/GLES2
install -m 0775 include/GLES3/*.h ${D}/${includedir}/GLES3
install -m 0775 include/KHR/*.h ${D}/${includedir}/KHR

# links
ln -sf libcuda.so.1 ${D}/${libdir}/libcuda.so
ln -sf libnvidia-glsi.so.${NV_DRV_VER} ${D}/${libdir}/libnvidia-glsi.so
#ln -sf libnvidia-rmapi-tegra.so.${NV_DRV_VER} ${D}/${libdir}/libnvidia-rmapi-tegra.so
ln -sf libnvidia-eglcore.so.${NV_DRV_VER} ${D}/${libdir}/libnvidia-eglcore.so
ln -sf libnvidia-glcore.so.${NV_DRV_VER} ${D}/${libdir}/libnvidia-glcore.so
#ln -sf libnvidia-glcore-cg.so.${NV_DRV_VER} ${D}/${libdir}/libnvidia-glcore-cg.so
#ln -sf libnvidia-glcore-ocg.so.${NV_DRV_VER} ${D}/${libdir}/libnvidia-glcore-ocg.so
ln -sf libGLESv2.so.2 ${D}/${libdir}/libGLESv2.so
ln -sf libGLESv2_nvidia.so.2 ${D}/${libdir}/libGLESv2_nvidia.so
#ln -sf libwayland-egl.so.1.0.0 ${D}/${libdir}/libwayland-egl.so.1
#ln -sf libwayland-egl.so.1.0.0 ${D}/${libdir}/libwayland-egl.so
ln -sf libEGL.so.1 ${D}/${libdir}/libEGL.so
ln -sf libwayland-egl.so.1 ${D}/${libdir}/libwayland-egl.so

# pkg-config
install -d ${D}/${libdir}/pkgconfig/
install -m 0775 *.pc ${D}/${libdir}/pkgconfig/
}

FILES_${PN} = "\
${libdir}/* \
"

FILES_${PN}-dev = "\
${includedir}/* \
${libdir}/pkgconfig/* \
"

0 comments on commit 1a6473e

Please sign in to comment.