Re: [yocto] [meta-rockchip][PATCH 4/7] recipes-graphics: Add support for mali-userspace
Hi Jacob, This is a good first version, but I think there are some things that could be added to make it better. For example, it should have a COMPATIBLE_MACHINE statement, and it should detect whether the target is using hard-float. Also the name "mali-userspace_t76x.bb" isn't a good choice, the part after the underscore should indicate the version, but t76x indicates the target mali implementation. I think the sunxi people have done a good job with their mali recipes: https://github.com/linux-sunxi/meta-sunxi/tree/master/recipes-graphics/libgles. Would you be interested in creating a v2 modeled after their work? Best regards, Trevor On Thu, Feb 9, 2017 at 2:23 AM, Jacob Chen wrote: > Hi, > > > > Trevor Woerner wrote on 2017年01月28日 09:44: >> >> On Fri, Jan 27, 2017 at 9:41 AM, Romain Perier >> wrote: >>> >>> Hi all, >>> >>> Correct me if I am wrong, but these are generic mali userpace binaries ? >>> meta-rockchip is a bsp meta layer, it should only contains files and >>> recipes >>> to make rockchip board working or things specific to the rockchip board. >>> For >>> me these recipes are completly generic and might be re-used for another >>> platform with another SoC. >>> >>> I don't want this in meta-rockchip. There is no a layer called meta-mali >>> or >>> something ? >>> >>> @Trevor: Feel free to comment, the point of view of the second maintainer >>> is >>> always welcome >> >> :-) >> >> >> I was just about to point out that there is no meta-mali, and that >> most BSP layers do include their own recipes for mali (meta-sunxi, >> meta-96boards, meta-xilinx) but, googling around, there is in fact a >> meta-mali provided my ARM itself: >> https://github.com/ARM-software/meta-mali . So I guess we could go >> either way. Although I haven't looked at what's specifically provided >> in meta-mali to know if it would be useful or not. >> > > I think GPU is a part of SOC. Other bsp meta layer also contain gpu userpace > binaries. > And, mali userpace binaries are not very generic, there are different in > hardware versions, software versions and backends. > e.g: > rk3288's GPU is T76x-r0p0 but rk3288w's GPU is T76x-r1p0, so they have > to use different binaries. > > > -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] [meta-rockchip][PATCH 4/7] recipes-graphics: Add support for mali-userspace
Hi, Trevor Woerner wrote on 2017年01月28日 09:44: On Fri, Jan 27, 2017 at 9:41 AM, Romain Perier wrote: Hi all, Correct me if I am wrong, but these are generic mali userpace binaries ? meta-rockchip is a bsp meta layer, it should only contains files and recipes to make rockchip board working or things specific to the rockchip board. For me these recipes are completly generic and might be re-used for another platform with another SoC. I don't want this in meta-rockchip. There is no a layer called meta-mali or something ? @Trevor: Feel free to comment, the point of view of the second maintainer is always welcome :-) I was just about to point out that there is no meta-mali, and that most BSP layers do include their own recipes for mali (meta-sunxi, meta-96boards, meta-xilinx) but, googling around, there is in fact a meta-mali provided my ARM itself: https://github.com/ARM-software/meta-mali . So I guess we could go either way. Although I haven't looked at what's specifically provided in meta-mali to know if it would be useful or not. I think GPU is a part of SOC. Other bsp meta layer also contain gpu userpace binaries. And, mali userpace binaries are not very generic, there are different in hardware versions, software versions and backends. e.g: rk3288's GPU is T76x-r0p0 but rk3288w's GPU is T76x-r1p0, so they have to use different binaries. -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] [meta-rockchip][PATCH 4/7] recipes-graphics: Add support for mali-userspace
On Fri, Jan 27, 2017 at 9:41 AM, Romain Perier wrote: > Hi all, > > Correct me if I am wrong, but these are generic mali userpace binaries ? > meta-rockchip is a bsp meta layer, it should only contains files and recipes > to make rockchip board working or things specific to the rockchip board. For > me these recipes are completly generic and might be re-used for another > platform with another SoC. > > I don't want this in meta-rockchip. There is no a layer called meta-mali or > something ? > > @Trevor: Feel free to comment, the point of view of the second maintainer is > always welcome :-) I was just about to point out that there is no meta-mali, and that most BSP layers do include their own recipes for mali (meta-sunxi, meta-96boards, meta-xilinx) but, googling around, there is in fact a meta-mali provided my ARM itself: https://github.com/ARM-software/meta-mali . So I guess we could go either way. Although I haven't looked at what's specifically provided in meta-mali to know if it would be useful or not. -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] [meta-rockchip][PATCH 4/7] recipes-graphics: Add support for mali-userspace
Hi all, Correct me if I am wrong, but these are generic mali userpace binaries ? meta-rockchip is a bsp meta layer, it should only contains files and recipes to make rockchip board working or things specific to the rockchip board. For me these recipes are completly generic and might be re-used for another platform with another SoC. I don't want this in meta-rockchip. There is no a layer called meta-mali or something ? @Trevor: Feel free to comment, the point of view of the second maintainer is always welcome Thanks, Romain 2017-01-19 15:04 GMT+01:00 Jacob Chen : > Add support for mali userspace which are binaries that can be run > with weston and X11. > > Signed-off-by: Jacob Chen > --- > recipes-graphics/mali-userspace/mali-userspace.inc | 57 > ++ > .../mali-userspace/mali-userspace_t76x.bb | 18 +++ > recipes-graphics/mesa/mesa_%.bbappend | 9 > 3 files changed, 84 insertions(+) > create mode 100644 recipes-graphics/mali-userspace/mali-userspace.inc > create mode 100644 recipes-graphics/mali-userspace/mali-userspace_t76x.bb > create mode 100644 recipes-graphics/mesa/mesa_%.bbappend > > diff --git a/recipes-graphics/mali-userspace/mali-userspace.inc > b/recipes-graphics/mali-userspace/mali-userspace.inc > new file mode 100644 > index 000..d40f583 > --- /dev/null > +++ b/recipes-graphics/mali-userspace/mali-userspace.inc > @@ -0,0 +1,57 @@ > +SUMMARY = "Userspace mali driver for Midgard-T76x" > +DESCRIPTION = "Userspace mali driver for Midgard-T76x" > +LICENSE = "CLOSED" > +SECTION = "libs" > + > +DEPENDS = "libdrm" > +DEPENDS += "${@bb.utils.contains("DISTRO_FEATURES", "wayland", " mesa", > " ", d)}" > + > +PROVIDES += "virtual/egl virtual/libgles1 virtual/libgles2 > virtual/libopencl libgbm" > +PROVIDES += "${@bb.utils.contains("DISTRO_FEATURES", "wayland", " > virtual/libwayland-egl", " ", d)}" > + > +S = "${WORKDIR}" > + > +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)}" > + > +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}/x11/libmali.so ${D}/${libdir} > + elif [ "${USE_WL}" = "yes" ]; then > + install ${S}/wayland/libmali.so ${D}/${libdir} > + fi > + > + ln -sf libmali.so ${D}/${libdir}/libEGL.so > + ln -sf libmali.so ${D}/${libdir}/libGLESv1_CM.so > + ln -sf libmali.so ${D}/${libdir}/libGLESv2.so > + ln -sf libmali.so ${D}/${libdir}/libOpenCL.so > + ln -sf libmali.so ${D}/${libdir}/libgbm.so > + > + 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" > +RPROVIDES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 > libgbm" > +RCONFLICTS_${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" > diff --git a/recipes-graphics/mali-userspace/mali-userspace_t76x.bb > b/recipes-graphics/mali-userspace/mali-userspace_t76x.bb > new file mode 100644 > index 000..3281ac0 > --- /dev/null > +++ b/recipes-graphics/mali-userspace/mali-userspace_t76x.bb > @@ -0,0 +1,18 @@ > +require mali-userspace.inc > + > +TYPE = "midgard" > +SW_VER = "r13p0" > +HW_VER = "r0p0" > + > +LIB_PATH = "arm-linux-gnueabihf" > + > +MALI_X11 = "libmali-${TYPE}-${SW_VER}-${HW_VER}.so" > +MALI_WAYLAND = "libmali-${TYPE}-${SW_VER}-${HW_VER}-wayland.so" > + > +do_install_prepend () { > + mkdir -p x11 > + cp git/lib/${LIB_PATH}/${MALI_X11} x11/libmali.so > + > + mkdir -p wayland > + cp git/lib/${LIB_PATH}/${MALI_WAYLAND} wayland/libmali.so > +} > diff --git a/recipes-graphics/mesa/mesa_%.bbappend > b/recipes-graphics/mesa/mesa_%.bbappend > new file mode 100644 > index 000..d9cab75 > --- /dev/null > +++ b/recipes-graphics/mesa/mesa_%.bbappend > @@ -0,0 +1,9 @@ > +PROVIDES_remove = "virtual/libgles1 virtual/libgles2 virtual/egl > virtual/libwayland-egl" > + > +do_install_append () { > +rm -f ${D}/${libdir}/libEGL* > +rm -f ${D}/${libdir}/libGLESv1_CM.* > +rm -f ${D}/${libdir}/libGLESv2.* > +rm -f ${D}/${libdir}/libgbm* > +rm -f ${D}/${libdir}/libwayland-egl* > +} > -- > 2.7.4 > >
[yocto] [meta-rockchip][PATCH 4/7] recipes-graphics: Add support for mali-userspace
Add support for mali userspace which are binaries that can be run with weston and X11. Signed-off-by: Jacob Chen --- recipes-graphics/mali-userspace/mali-userspace.inc | 57 ++ .../mali-userspace/mali-userspace_t76x.bb | 18 +++ recipes-graphics/mesa/mesa_%.bbappend | 9 3 files changed, 84 insertions(+) create mode 100644 recipes-graphics/mali-userspace/mali-userspace.inc create mode 100644 recipes-graphics/mali-userspace/mali-userspace_t76x.bb create mode 100644 recipes-graphics/mesa/mesa_%.bbappend diff --git a/recipes-graphics/mali-userspace/mali-userspace.inc b/recipes-graphics/mali-userspace/mali-userspace.inc new file mode 100644 index 000..d40f583 --- /dev/null +++ b/recipes-graphics/mali-userspace/mali-userspace.inc @@ -0,0 +1,57 @@ +SUMMARY = "Userspace mali driver for Midgard-T76x" +DESCRIPTION = "Userspace mali driver for Midgard-T76x" +LICENSE = "CLOSED" +SECTION = "libs" + +DEPENDS = "libdrm" +DEPENDS += "${@bb.utils.contains("DISTRO_FEATURES", "wayland", " mesa", " ", d)}" + +PROVIDES += "virtual/egl virtual/libgles1 virtual/libgles2 virtual/libopencl libgbm" +PROVIDES += "${@bb.utils.contains("DISTRO_FEATURES", "wayland", " virtual/libwayland-egl", " ", d)}" + +S = "${WORKDIR}" + +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)}" + +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}/x11/libmali.so ${D}/${libdir} + elif [ "${USE_WL}" = "yes" ]; then + install ${S}/wayland/libmali.so ${D}/${libdir} + fi + + ln -sf libmali.so ${D}/${libdir}/libEGL.so + ln -sf libmali.so ${D}/${libdir}/libGLESv1_CM.so + ln -sf libmali.so ${D}/${libdir}/libGLESv2.so + ln -sf libmali.so ${D}/${libdir}/libOpenCL.so + ln -sf libmali.so ${D}/${libdir}/libgbm.so + + 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" +RPROVIDES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" +RCONFLICTS_${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" diff --git a/recipes-graphics/mali-userspace/mali-userspace_t76x.bb b/recipes-graphics/mali-userspace/mali-userspace_t76x.bb new file mode 100644 index 000..3281ac0 --- /dev/null +++ b/recipes-graphics/mali-userspace/mali-userspace_t76x.bb @@ -0,0 +1,18 @@ +require mali-userspace.inc + +TYPE = "midgard" +SW_VER = "r13p0" +HW_VER = "r0p0" + +LIB_PATH = "arm-linux-gnueabihf" + +MALI_X11 = "libmali-${TYPE}-${SW_VER}-${HW_VER}.so" +MALI_WAYLAND = "libmali-${TYPE}-${SW_VER}-${HW_VER}-wayland.so" + +do_install_prepend () { + mkdir -p x11 + cp git/lib/${LIB_PATH}/${MALI_X11} x11/libmali.so + + mkdir -p wayland + cp git/lib/${LIB_PATH}/${MALI_WAYLAND} wayland/libmali.so +} diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 000..d9cab75 --- /dev/null +++ b/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1,9 @@ +PROVIDES_remove = "virtual/libgles1 virtual/libgles2 virtual/egl virtual/libwayland-egl" + +do_install_append () { +rm -f ${D}/${libdir}/libEGL* +rm -f ${D}/${libdir}/libGLESv1_CM.* +rm -f ${D}/${libdir}/libGLESv2.* +rm -f ${D}/${libdir}/libgbm* +rm -f ${D}/${libdir}/libwayland-egl* +} -- 2.7.4 -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto