All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Chen <jacob-chen@iotwrt.com>
To: yocto@yoctoproject.org
Cc: Jacob Chen <jacob-chen@iotwrt.com>
Subject: [meta-rockchip][PATCH v2] recipes-graphics: Add recipe for rockchip-mali
Date: Tue, 14 Mar 2017 11:08:05 +0800	[thread overview]
Message-ID: <1489460885-28663-1-git-send-email-jacob-chen@iotwrt.com> (raw)

* add this recipe to download rockchip mali drivers
* support X11,gbm-only,wayland backend on rk3036,rk3288,rk3399
* provide egl,gles,gbm,opencl library
* depend on mesa to provide dev-package

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
---
 recipes-graphics/libgles/rockchip-mali_git.bb | 89 +++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)
 create mode 100644 recipes-graphics/libgles/rockchip-mali_git.bb

diff --git a/recipes-graphics/libgles/rockchip-mali_git.bb b/recipes-graphics/libgles/rockchip-mali_git.bb
new file mode 100644
index 0000000..02ba5e1
--- /dev/null
+++ b/recipes-graphics/libgles/rockchip-mali_git.bb
@@ -0,0 +1,89 @@
+DESCRIPTION = "GLES libraries for Rockchip SoCs for a family of Mali GPU"
+SECTION = "libs"
+LICENSE = "BINARY"
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=564e729dd65db6f65f911ce0cd340cf9"
+NO_GENERIC_LICENSE[BINARY] = "LICENSE.TXT"
+
+COMPATIBLE_MACHINE = "(rk3036|rk3288|rk3399)"
+
+# There's only hardfp version available
+python __anonymous() {
+    tunes = d.getVar("TUNE_FEATURES", True)
+    if not tunes:
+        return
+    if "callconvention-hard" not in tunes:
+        pkgn = d.getVar("PN", True)
+        pkgv = d.getVar("PV", True)
+        raise bb.parse.SkipPackage("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv))
+}
+
+DEPENDS = "libdrm mesa"
+
+PROVIDES += "virtual/egl virtual/libgles1 virtual/libgles2 virtual/libopencl libgbm"
+PROVIDES += "${@bb.utils.contains("DISTRO_FEATURES", "wayland", " virtual/libwayland-egl", " ", d)}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://github.com/rockchip-linux/libmali.git;branch=rockchip;"
+SRCREV_pn-${PN} = "${AUTOREV}"
+
+INSANE_SKIP_${PN} = "already-stripped ldflags dev-so"
+
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+
+USE_X11 = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "yes", "no", d)}"
+USE_WL = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}"
+
+MALI_X11_rk3288 = "arm-linux-gnueabihf/libmali-midgard-r9p0-r0p0.so"
+MALI_WAYLAND_rk3288 = "arm-linux-gnueabihf/libmali-midgard-r13p0-r0p0-wayland.so "
+MALI_GBM_rk3288 = "arm-linux-gnueabihf/libmali-midgard-r13p0-r0p0-gbm.so "
+
+MALI_X11_rk3036 = "arm-linux-gnueabihf/libmali-utgard-r6p0.so"
+MALI_WAYLAND_rk3036 = "arm-linux-gnueabihf/libmali-utgard-r7p0-wayland.so"
+MALI_GBM_rk3036 = "arm-linux-gnueabihf/libmali-utgard-r7p0-gbm.so"
+
+MALI_X11_rk3399 = "aarch64-linux-gnu/libmali-midgard-4th-r9p0.so"
+MALI_WAYLAND_rk3399 = "aarch64-linux-gnu/libmali-midgard-4th-r9p0-wayland.so"
+MALI_GBM_rk3399 = "aarch64-linux-gnu/libmali-midgard-4th-r9p0-gbm.so"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install () {
+	# Create MALI manifest
+	install -m 755 -d ${D}/${libdir}
+	if [ "${USE_X11}" = "yes" ]; then
+		install ${S}/lib/${MALI_X11} ${D}/${libdir}/libmali.so
+	elif [ "${USE_WL}" = "yes" ]; then
+		install ${S}/lib/${MALI_WAYLAND} ${D}/${libdir}/libmali.so
+	else
+		install ${S}/lib/${MALI_GBM} ${D}/${libdir}/libmali.so
+	fi
+
+	ln -sf libmali.so ${D}/${libdir}/libEGL.so
+	ln -sf libmali.so ${D}/${libdir}/libEGL.so.1
+	ln -sf libmali.so ${D}/${libdir}/libGLESv1_CM.so
+	ln -sf libmali.so ${D}/${libdir}/libGLESv1_CM.so.1
+	ln -sf libmali.so ${D}/${libdir}/libGLESv2.so
+	ln -sf libmali.so ${D}/${libdir}/libGLESv2.so.2
+	ln -sf libmali.so ${D}/${libdir}/libOpenCL.so
+	ln -sf libmali.so ${D}/${libdir}/libOpenCL.so.1
+	ln -sf libmali.so ${D}/${libdir}/libgbm.so
+	ln -sf libmali.so ${D}/${libdir}/libgbm.so.1
+
+	if [ "${USE_WL}" = "yes" ]; then
+		ln -sf libmali.so ${D}/${libdir}/libwayland-egl.so
+	fi
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} += "${libdir}/*.so"
+
+RREPLACES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm"
+RCONFLICTS_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm"
+RPROVIDES_${PN} += "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm"
+
+# Workaround: libmali.so provided by rk having no SONAME field in it
+# so add it to fix rdepends problems
+RPROVIDES_${PN} += "libwayland-egl.so libgbm.so libGLESv1_CM.so libGLESv2.so libEGL.so libOpenCL.so"
-- 
2.7.4



                 reply	other threads:[~2017-03-14  3:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489460885-28663-1-git-send-email-jacob-chen@iotwrt.com \
    --to=jacob-chen@iotwrt.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.