* [Buildroot] [RFC 0/3] ARM Mali Graphics Drivers
@ 2013-07-14 5:10 Spenser Gilliland
2013-07-14 5:10 ` [Buildroot] [RFC 1/3] a10disp: new package Spenser Gilliland
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Spenser Gilliland @ 2013-07-14 5:10 UTC (permalink / raw)
To: buildroot
This is an RFC for the addition of the ARM Mali graphics driver for Allwinner
based systems.
WARNING: This patch series has not been runtime tested.
TODO:
- Fix build bug on test program.
- Runtime testing.
Spenser Gilliland (3):
a10disp: new package
sunxi-mali: new package
opengl: add sunxi-mali as possible egl/gles provider
package/Config.in | 3 ++
package/a10disp/Config.in | 11 +++++
package/a10disp/a10disp.mk | 21 ++++++++
package/opengl/libegl/libegl.mk | 4 ++
package/opengl/libgles/libgles.mk | 4 ++
package/sunxi-mali-prop/Config.in | 2 +
package/sunxi-mali-prop/sunxi-mali-prop.mk | 10 ++++
package/sunxi-mali/Config.in | 65 ++++++++++++++++++++++++
package/sunxi-mali/S80mali | 56 +++++++++++++++++++++
package/sunxi-mali/egl.pc | 12 +++++
package/sunxi-mali/glesv2.pc | 12 +++++
package/sunxi-mali/sunxi-mali.mk | 79 ++++++++++++++++++++++++++++++
12 files changed, 279 insertions(+)
create mode 100644 package/a10disp/Config.in
create mode 100644 package/a10disp/a10disp.mk
create mode 100644 package/sunxi-mali-prop/Config.in
create mode 100644 package/sunxi-mali-prop/sunxi-mali-prop.mk
create mode 100644 package/sunxi-mali/Config.in
create mode 100644 package/sunxi-mali/S80mali
create mode 100644 package/sunxi-mali/egl.pc
create mode 100644 package/sunxi-mali/glesv2.pc
create mode 100644 package/sunxi-mali/sunxi-mali.mk
--
1.8.1.2
^ permalink raw reply [flat|nested] 16+ messages in thread* [Buildroot] [RFC 1/3] a10disp: new package 2013-07-14 5:10 [Buildroot] [RFC 0/3] ARM Mali Graphics Drivers Spenser Gilliland @ 2013-07-14 5:10 ` Spenser Gilliland 2013-07-16 8:21 ` Thomas Petazzoni 2013-07-14 5:10 ` [Buildroot] [RFC 2/3] sunxi-mali: " Spenser Gilliland 2013-07-14 5:10 ` [Buildroot] [RFC 3/3] opengl: add sunxi-mali as possible egl/gles provider Spenser Gilliland 2 siblings, 1 reply; 16+ messages in thread From: Spenser Gilliland @ 2013-07-14 5:10 UTC (permalink / raw) To: buildroot Signed-off-by: Spenser Gilliland <spenser@gillilanding.com> --- package/Config.in | 1 + package/a10disp/Config.in | 11 +++++++++++ package/a10disp/a10disp.mk | 21 +++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 package/a10disp/Config.in create mode 100644 package/a10disp/a10disp.mk diff --git a/package/Config.in b/package/Config.in index 7c24dab..f565dd4 100644 --- a/package/Config.in +++ b/package/Config.in @@ -227,6 +227,7 @@ source "package/ux500-firmware/Config.in" source "package/zd1211-firmware/Config.in" endmenu source "package/freescale-imx/Config.in" +source "package/a10disp/Config.in" source "package/acpid/Config.in" source "package/cdrkit/Config.in" source "package/dbus/Config.in" diff --git a/package/a10disp/Config.in b/package/a10disp/Config.in new file mode 100644 index 0000000..60ba44c --- /dev/null +++ b/package/a10disp/Config.in @@ -0,0 +1,11 @@ +config BR2_PACKAGE_A10DISP + bool "a10disp" + depends on BR2_LINUX_KERNEL && BR2_arm + help + Program to change the display mode of Allwinner devices running + linux-sunxi. + + http://github.com/hglm/a10disp + +comment "a10disp requires the linux kernel" + depends on !(BR2_LINUX_KERNEL) && BR2_arm diff --git a/package/a10disp/a10disp.mk b/package/a10disp/a10disp.mk new file mode 100644 index 0000000..bac515a --- /dev/null +++ b/package/a10disp/a10disp.mk @@ -0,0 +1,21 @@ +################################################################################ +# +# a10disp +# +################################################################################ + +A10DISP_VERSION = a899cc6dcf +A10DISP_SITE = http://github.com/hglm/a10disp/tarball/$(A10DISP_VERSION) + +A10DISP_DEPENDENCIES = linux + +define A10DISP_BUILD_CMDS + cp -f $(LINUX_DIR)/include/video/sunxi_disp_ioctl.h $(@D)/ + cd $(@D) && $(TARGET_CC) -Wall -O a10disp.c -o a10disp +endef + +define A10DISP_INSTALL_TARGET_CMDS + $(INSTALL) -m 0755 $(@D)/a10disp $(TARGET_DIR)/usr/bin/ +endef + +$(eval $(generic-package)) -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 1/3] a10disp: new package 2013-07-14 5:10 ` [Buildroot] [RFC 1/3] a10disp: new package Spenser Gilliland @ 2013-07-16 8:21 ` Thomas Petazzoni 2013-07-16 15:46 ` Spenser Gilliland 0 siblings, 1 reply; 16+ messages in thread From: Thomas Petazzoni @ 2013-07-16 8:21 UTC (permalink / raw) To: buildroot Dear Spenser Gilliland, Great to see the beginning of the work on Allwinner devices! On Sun, 14 Jul 2013 00:10:30 -0500, Spenser Gilliland wrote: > diff --git a/package/a10disp/Config.in b/package/a10disp/Config.in > new file mode 100644 > index 0000000..60ba44c > --- /dev/null > +++ b/package/a10disp/Config.in > @@ -0,0 +1,11 @@ > +config BR2_PACKAGE_A10DISP > + bool "a10disp" > + depends on BR2_LINUX_KERNEL && BR2_arm > + help > + Program to change the display mode of Allwinner devices running > + linux-sunxi. I'd make this a little bit more explicit: Program to change the display mode on Allwinner ARM SOCs running the linux-sunxi kernel (and not the mainline kernel). > + > + http://github.com/hglm/a10disp > + > +comment "a10disp requires the linux kernel" > + depends on !(BR2_LINUX_KERNEL) && BR2_arm Parenthesis not needed. > diff --git a/package/a10disp/a10disp.mk b/package/a10disp/a10disp.mk > new file mode 100644 > index 0000000..bac515a > --- /dev/null > +++ b/package/a10disp/a10disp.mk > @@ -0,0 +1,21 @@ > +################################################################################ > +# > +# a10disp > +# > +################################################################################ > + > +A10DISP_VERSION = a899cc6dcf > +A10DISP_SITE = http://github.com/hglm/a10disp/tarball/$(A10DISP_VERSION) > + > +A10DISP_DEPENDENCIES = linux > + > +define A10DISP_BUILD_CMDS > + cp -f $(LINUX_DIR)/include/video/sunxi_disp_ioctl.h $(@D)/ > + cd $(@D) && $(TARGET_CC) -Wall -O a10disp.c -o a10disp Tabs preferred for indentation here. Also, hardcoding the -Wall and -O flags is not really great. Instead, can we do something like: cp -f $(LINUX_DIR)/include/video/sunxi_disp_ioctl.h $(@D)/ $(TARGET_CC) $(TARGET_CFLAGS) -o $(@D)/a10disp $(@D)/a10disp.c > +endef > + > +define A10DISP_INSTALL_TARGET_CMDS > + $(INSTALL) -m 0755 $(@D)/a10disp $(TARGET_DIR)/usr/bin/ $(INSTALL) -D -m 0755 $(@D)/a10disp $(TARGET_DIR)/usr/bin/a10disp Thanks! Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 1/3] a10disp: new package 2013-07-16 8:21 ` Thomas Petazzoni @ 2013-07-16 15:46 ` Spenser Gilliland 0 siblings, 0 replies; 16+ messages in thread From: Spenser Gilliland @ 2013-07-16 15:46 UTC (permalink / raw) To: buildroot Thomas, > Dear Spenser Gilliland, > > Great to see the beginning of the work on Allwinner devices! > I'd make this a little bit more explicit: > > Program to change the display mode on Allwinner ARM SOCs > running the linux-sunxi kernel (and not the mainline kernel). Will fix. >> + >> + http://github.com/hglm/a10disp >> + >> +comment "a10disp requires the linux kernel" >> + depends on !(BR2_LINUX_KERNEL) && BR2_arm > > Parenthesis not needed. Will fix. >> diff --git a/package/a10disp/a10disp.mk b/package/a10disp/a10disp.mk >> new file mode 100644 >> index 0000000..bac515a >> --- /dev/null >> +++ b/package/a10disp/a10disp.mk >> @@ -0,0 +1,21 @@ >> +################################################################################ >> +# >> +# a10disp >> +# >> +################################################################################ >> + >> +A10DISP_VERSION = a899cc6dcf >> +A10DISP_SITE = http://github.com/hglm/a10disp/tarball/$(A10DISP_VERSION) >> + >> +A10DISP_DEPENDENCIES = linux >> + >> +define A10DISP_BUILD_CMDS >> + cp -f $(LINUX_DIR)/include/video/sunxi_disp_ioctl.h $(@D)/ >> + cd $(@D) && $(TARGET_CC) -Wall -O a10disp.c -o a10disp > > Tabs preferred for indentation here. Also, hardcoding the -Wall and -O > flags is not really great. Instead, can we do something like: Sometimes I think vim is randomly choosing indentation for me. Will fix. > cp -f $(LINUX_DIR)/include/video/sunxi_disp_ioctl.h $(@D)/ > $(TARGET_CC) $(TARGET_CFLAGS) -o $(@D)/a10disp $(@D)/a10disp.c > >> +endef >> + >> +define A10DISP_INSTALL_TARGET_CMDS >> + $(INSTALL) -m 0755 $(@D)/a10disp $(TARGET_DIR)/usr/bin/ > > $(INSTALL) -D -m 0755 $(@D)/a10disp $(TARGET_DIR)/usr/bin/a10disp Will fix. Thanks, Spenser ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-14 5:10 [Buildroot] [RFC 0/3] ARM Mali Graphics Drivers Spenser Gilliland 2013-07-14 5:10 ` [Buildroot] [RFC 1/3] a10disp: new package Spenser Gilliland @ 2013-07-14 5:10 ` Spenser Gilliland 2013-07-16 8:55 ` Thomas Petazzoni 2013-07-16 20:14 ` Yann E. MORIN 2013-07-14 5:10 ` [Buildroot] [RFC 3/3] opengl: add sunxi-mali as possible egl/gles provider Spenser Gilliland 2 siblings, 2 replies; 16+ messages in thread From: Spenser Gilliland @ 2013-07-14 5:10 UTC (permalink / raw) To: buildroot Signed-off-by: Spenser Gilliland <spenser@gillilanding.com> --- package/Config.in | 2 + package/sunxi-mali-prop/Config.in | 2 + package/sunxi-mali-prop/sunxi-mali-prop.mk | 10 ++++ package/sunxi-mali/Config.in | 65 ++++++++++++++++++++++++ package/sunxi-mali/S80mali | 56 +++++++++++++++++++++ package/sunxi-mali/egl.pc | 12 +++++ package/sunxi-mali/glesv2.pc | 12 +++++ package/sunxi-mali/sunxi-mali.mk | 79 ++++++++++++++++++++++++++++++ 8 files changed, 238 insertions(+) create mode 100644 package/sunxi-mali-prop/Config.in create mode 100644 package/sunxi-mali-prop/sunxi-mali-prop.mk create mode 100644 package/sunxi-mali/Config.in create mode 100644 package/sunxi-mali/S80mali create mode 100644 package/sunxi-mali/egl.pc create mode 100644 package/sunxi-mali/glesv2.pc create mode 100644 package/sunxi-mali/sunxi-mali.mk diff --git a/package/Config.in b/package/Config.in index f565dd4..9ee7c90 100644 --- a/package/Config.in +++ b/package/Config.in @@ -292,6 +292,8 @@ source "package/smartmontools/Config.in" source "package/snowball-hdmiservice/Config.in" source "package/sredird/Config.in" source "package/statserial/Config.in" +source "package/sunxi-mali/Config.in" +source "package/sunxi-mali-prop/Config.in" source "package/sysstat/Config.in" source "package/ti-utils/Config.in" source "package/uboot-tools/Config.in" diff --git a/package/sunxi-mali-prop/Config.in b/package/sunxi-mali-prop/Config.in new file mode 100644 index 0000000..26511a7 --- /dev/null +++ b/package/sunxi-mali-prop/Config.in @@ -0,0 +1,2 @@ +config BR2_PACKAGE_SUNXI_MALI_PROP + bool diff --git a/package/sunxi-mali-prop/sunxi-mali-prop.mk b/package/sunxi-mali-prop/sunxi-mali-prop.mk new file mode 100644 index 0000000..f745731 --- /dev/null +++ b/package/sunxi-mali-prop/sunxi-mali-prop.mk @@ -0,0 +1,10 @@ +################################################################################ +# +# sunxi-mali +# +################################################################################ + +SUNXI_MALI_PROP_VERSION = e4ced47 +SUNXI_MALI_PROP_SITE = http://github.com/linux-sunxi/sunxi-mali-proprietary/tarball/$(SUNXI_MALI_PROP_VERSION) + +$(eval $(generic-package)) diff --git a/package/sunxi-mali/Config.in b/package/sunxi-mali/Config.in new file mode 100644 index 0000000..d1ad173 --- /dev/null +++ b/package/sunxi-mali/Config.in @@ -0,0 +1,65 @@ +config BR2_PACKAGE_SUNXI_MALI + bool "sunxi-mali" + select BR2_PACKAGE_HAS_OPENGL_EGL + select BR2_PACKAGE_HAS_OPENGL_ES + depends on BR2_TOOLCHAIN_USES_GLIBC && BR2_arm + help + Install the ARM Mali drivers for sunxi based systems. + + http://github.com/linux-sunxi/sunxi-mali + +if BR2_PACKAGE_SUNXI_MALI + +config BR2_PACKAGE_SUNXI_MALI_DBG + bool "install malitest and maliver tools" + help + Install 3D triangle demo malitest application and the maliver application + which describes the kernel module version. + +config BR2_PACKAGE_SUNXI_MALI_HARDFP + bool "use hard float binaries" + help + Install hard float binaries (required if using a hard float toolchain) + +choice + prompt "type of EGL binaries to install" + default BR2_PACKAGE_SUNXI_FB + help + Which EGL_TYPE binaries should be installed? + +config BR2_PACKAGE_SUNXI_MALI_FB + bool "framebuffer" + help + Install framebuffer compatible binaries + +# TODO: Add X11 support +#config BR2_PACKAGE_SUNXI_MALI_X11 +# bool "X11" +# help +# Install X11 compatible binaries + +endchoice + +choice + prompt "Version" + default BR2_PACKAGE_SUNXI_MALI_R3P1 + help + Select the version of the Sunxi Mali binaries to install. + +config BR2_PACKAGE_SUNXI_MALI_R2P4 + bool "r2p4" + +config BR2_PACKAGE_SUNXI_MALI_R3P0 + bool "r3p0" + +config BR2_PACKAGE_SUNXI_MALI_R3P1 + depends on BR2_PACKAGE_SUNXI_MALI_HARDFP + bool "r3p1" + +endchoice + +endif + +comment "sunxi-mali requires an eglibc/glibc based toolchain" + depends on !(BR2_TOOLCHAIN_USES_GLIBC) && BR2_arm + diff --git a/package/sunxi-mali/S80mali b/package/sunxi-mali/S80mali new file mode 100644 index 0000000..22976b6 --- /dev/null +++ b/package/sunxi-mali/S80mali @@ -0,0 +1,56 @@ +#!/bin/sh -e + +install_driver() { + DRIVER=$1 + OPTS=$2 + + modprobe $DRIVER $OPTS + maj=$(awk "$$2==\"${DRIVER}\" { print $$1; }" /proc/devices) + + if [ -e /dev/${DRIVER} ]; then + rm -f /dev/${DRIVER} + fi + + mknod /dev/${DRIVER} c $maj 0 + chmod 666 /dev/${DRIVER} +} + +start() { + echo "mali: starting driver" + + BITSPERPIXEL="$(fbset | awk '/geom/ {print $6}')" + YRES="$(fbset | awk '/geom/ {print $3}')" + # Set RGBA ordering to something the drivers like + if [ "$BITSPERPIXEL" = "32" ] ; then + fbset -rgba 8/16,8/8,8/0,8/24 + fi + # Try to enable triple buffering when there's enough VRAM + fbset -vyres $(( YRES*3 )) + + install_driver mali + install_driver ump +} + +stop() { + echo "mali: stopping driver" + + rmmod ump + rmmod mali +} + +case "$1" in +start) + start +;; +stop) + stop +;; +restart) + stop + start +;; +*) + echo "mali: Please use start, stop, or restart." + exit 1 +;; +esac diff --git a/package/sunxi-mali/egl.pc b/package/sunxi-mali/egl.pc new file mode 100644 index 0000000..56e3990 --- /dev/null +++ b/package/sunxi-mali/egl.pc @@ -0,0 +1,12 @@ +prefix=/usr/ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: egl +Description: ARM Mali implementation of EGL +Version: 1.4 +Requires: +Libs: -L${libdir} -lEGL -lGLESv2 -lUMP +Cflags: -I{includedir}/EGL/ -I${includedir} + diff --git a/package/sunxi-mali/glesv2.pc b/package/sunxi-mali/glesv2.pc new file mode 100644 index 0000000..4e112ee --- /dev/null +++ b/package/sunxi-mali/glesv2.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: glesv2 +Description: ARM Mali implementation of OpenGL ESv2 +Version: 2.0 +Requires: +Libs: -L${libdir} -lGLESv2 -lGLES_CM -lUMP +Cflags: -I${includedir}/GLES2 + diff --git a/package/sunxi-mali/sunxi-mali.mk b/package/sunxi-mali/sunxi-mali.mk new file mode 100644 index 0000000..693e454 --- /dev/null +++ b/package/sunxi-mali/sunxi-mali.mk @@ -0,0 +1,79 @@ +################################################################################ +# +# sunxi-mali +# +################################################################################ + +SUNXI_MALI_VERSION = c2491fe952 +SUNXI_MALI_SITE = http://github.com/linux-sunxi/sunxi-mali/tarball/$(SUNXI_MALI_VERSION) + +SUNXI_MALI_DEPENDENCIES = sunxi-mali-prop +SUNXI_MALI_INSTALL_STAGING = YES + +define SUNXI_MALI_CONFIGURE_CMDS + rm -rf $(@D)/lib/mali + cp -rf $(SUNXI_MALI_PROP_DIR) $(@D)/lib/mali +endef + +SUNXI_MALI_MAKE_ENV = \ + CC=$(TARGET_CC) \ + CFLAGS="$(TARGET_CFLAGS)" \ + $(TARGET_MAKE_ENV) + + +ifeq ($(BR2_PACKAGE_SUNXI_MALI_HARDFP),y) +SUNXI_MALI_MAKE_OPTS += ABI=armhf +else +SUNXI_MALI_MAKE_OPTS += ABI=armel +endif + +ifeq ($(BR2_PACKAGE_SUNXI_MALI_FB),y) +SUNXI_MALI_MAKE_OPTS += EGL_TYPE=framebuffer +else +SUNXI_MALI_MAKE_OPTS += EGL_TYPE=x11 +endif + +ifeq ($(BR2_PACKAGE_SUNXI_MALI_R2P4),y) +SUNXI_MALI_MAKE_OPTS += VERSION=r2p4 +endif +ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P0),y) +SUNXI_MALI_MAKE_OPTS += VERISON=r3p0 +endif +ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P1),y) +SUNXI_MALI_MAKE_OPTS += VERSION=r3p1 +endif + +define SUNXI_MALI_BUILD_CMDS + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) all + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), + cd $(@D)/version && \ + $(TARGET_CC) $(SUNXI_MALI_CFLAGS) -o version version.c; \ + ) +endef + +define SUNXI_MALI_INSTALL_STAGING_CMDS + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) \ + $(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), + # test must be built after install because it depends on headers that are + # generated during the install above. + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) test + ) + $(INSTALL) -D -m 0644 package/sunxi-mali/egl.pc $(STAGING_DIR)/usr/lib/pkgconfig/ + $(INSTALL) -D -m 0644 package/sunxi-mali/glesv2.pc $(STAGING_DIR)/usr/lib/pkgconfig/ +endef + +define SUNXI_MALI_INSTALL_TARGET_CMDS + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D)/lib \ + $(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), + $(INSTALL) -m 755 $(@D)/version/version $(TARGET_DIR)/usr/bin/maliver; \ + $(INSTALL) -m 755 $(@D)/test/test $(TARGET_DIR)/usr/bin/malitest + ) +endef + +define SUNXI_MALI_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/sunxi-mali/S80mali $(TARGET_DIR)/etc/init.d/ +endef + +$(eval $(generic-package)) -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-14 5:10 ` [Buildroot] [RFC 2/3] sunxi-mali: " Spenser Gilliland @ 2013-07-16 8:55 ` Thomas Petazzoni 2013-07-16 16:46 ` Spenser Gilliland 2013-07-16 20:14 ` Yann E. MORIN 1 sibling, 1 reply; 16+ messages in thread From: Thomas Petazzoni @ 2013-07-16 8:55 UTC (permalink / raw) To: buildroot Dear Spenser Gilliland, On Sun, 14 Jul 2013 00:10:31 -0500, Spenser Gilliland wrote: > > Signed-off-by: Spenser Gilliland <spenser@gillilanding.com> > --- > package/Config.in | 2 + > package/sunxi-mali-prop/Config.in | 2 + > package/sunxi-mali-prop/sunxi-mali-prop.mk | 10 ++++ It'd be great to have some explanations about what is this sunxi-mali-prop compared to sunxi-mali. At least in the commit log, maybe even somewhere in the source code (but I'm not sure where). > package/sunxi-mali/Config.in | 65 ++++++++++++++++++++++++ > package/sunxi-mali/S80mali | 56 +++++++++++++++++++++ > package/sunxi-mali/egl.pc | 12 +++++ > package/sunxi-mali/glesv2.pc | 12 +++++ > package/sunxi-mali/sunxi-mali.mk | 79 ++++++++++++++++++++++++++++++ > 8 files changed, 238 insertions(+) > create mode 100644 package/sunxi-mali-prop/Config.in > create mode 100644 package/sunxi-mali-prop/sunxi-mali-prop.mk > create mode 100644 package/sunxi-mali/Config.in > create mode 100644 package/sunxi-mali/S80mali > create mode 100644 package/sunxi-mali/egl.pc > create mode 100644 package/sunxi-mali/glesv2.pc > create mode 100644 package/sunxi-mali/sunxi-mali.mk > > diff --git a/package/Config.in b/package/Config.in > index f565dd4..9ee7c90 100644 > --- a/package/Config.in > +++ b/package/Config.in > @@ -292,6 +292,8 @@ source "package/smartmontools/Config.in" > source "package/snowball-hdmiservice/Config.in" > source "package/sredird/Config.in" > source "package/statserial/Config.in" > +source "package/sunxi-mali/Config.in" > +source "package/sunxi-mali-prop/Config.in" > source "package/sysstat/Config.in" > source "package/ti-utils/Config.in" > source "package/uboot-tools/Config.in" > diff --git a/package/sunxi-mali-prop/Config.in b/package/sunxi-mali-prop/Config.in > new file mode 100644 > index 0000000..26511a7 > --- /dev/null > +++ b/package/sunxi-mali-prop/Config.in > @@ -0,0 +1,2 @@ > +config BR2_PACKAGE_SUNXI_MALI_PROP > + bool Maybe you need to select this from sunxi-mali/Config.in ? > diff --git a/package/sunxi-mali-prop/sunxi-mali-prop.mk b/package/sunxi-mali-prop/sunxi-mali-prop.mk > new file mode 100644 > index 0000000..f745731 > --- /dev/null > +++ b/package/sunxi-mali-prop/sunxi-mali-prop.mk > @@ -0,0 +1,10 @@ > +################################################################################ > +# > +# sunxi-mali sunxi-mali-prop > +# > +################################################################################ > + > +SUNXI_MALI_PROP_VERSION = e4ced47 > +SUNXI_MALI_PROP_SITE = http://github.com/linux-sunxi/sunxi-mali-proprietary/tarball/$(SUNXI_MALI_PROP_VERSION) > + > +$(eval $(generic-package)) > diff --git a/package/sunxi-mali/Config.in b/package/sunxi-mali/Config.in > new file mode 100644 > index 0000000..d1ad173 > --- /dev/null > +++ b/package/sunxi-mali/Config.in > @@ -0,0 +1,65 @@ > +config BR2_PACKAGE_SUNXI_MALI > + bool "sunxi-mali" > + select BR2_PACKAGE_HAS_OPENGL_EGL > + select BR2_PACKAGE_HAS_OPENGL_ES > + depends on BR2_TOOLCHAIN_USES_GLIBC && BR2_arm As suggested above: select BR2_PACKAGE_SUNXI_MALI_PROP. Just curious: there is no kernel modules? > + help > + Install the ARM Mali drivers for sunxi based systems. > + > + http://github.com/linux-sunxi/sunxi-mali > + > +if BR2_PACKAGE_SUNXI_MALI > + > +config BR2_PACKAGE_SUNXI_MALI_DBG > + bool "install malitest and maliver tools" > + help > + Install 3D triangle demo malitest application and the maliver application > + which describes the kernel module version. > + > +config BR2_PACKAGE_SUNXI_MALI_HARDFP > + bool "use hard float binaries" > + help > + Install hard float binaries (required if using a hard float toolchain) Hopefully with my EABIhf series this can be refactored, but ok for now. > + > +choice > + prompt "type of EGL binaries to install" > + default BR2_PACKAGE_SUNXI_FB > + help > + Which EGL_TYPE binaries should be installed? > + > +config BR2_PACKAGE_SUNXI_MALI_FB > + bool "framebuffer" > + help > + Install framebuffer compatible binaries > + > +# TODO: Add X11 support > +#config BR2_PACKAGE_SUNXI_MALI_X11 > +# bool "X11" > +# help > +# Install X11 compatible binaries Does this requires a specific Mali X11 driver? Is it something you intend to package in this first version of sunxi-mali, or something you intend to do later (in which case you could remove this choice for now). > +endchoice > + > +choice > + prompt "Version" > + default BR2_PACKAGE_SUNXI_MALI_R3P1 > + help > + Select the version of the Sunxi Mali binaries to install. > + > +config BR2_PACKAGE_SUNXI_MALI_R2P4 > + bool "r2p4" > + > +config BR2_PACKAGE_SUNXI_MALI_R3P0 > + bool "r3p0" > + > +config BR2_PACKAGE_SUNXI_MALI_R3P1 > + depends on BR2_PACKAGE_SUNXI_MALI_HARDFP > + bool "r3p1" I wouldn't know how to chose between the three possibilities here, some more help would be nice. Also, maybe add a comment for the r3p1 being not available on !EABIhf systems. > +endchoice > + > +endif > + > +comment "sunxi-mali requires an eglibc/glibc based toolchain" > + depends on !(BR2_TOOLCHAIN_USES_GLIBC) && BR2_arm Parenthesis unneeded. > diff --git a/package/sunxi-mali/S80mali b/package/sunxi-mali/S80mali > new file mode 100644 > index 0000000..22976b6 > --- /dev/null > +++ b/package/sunxi-mali/S80mali > @@ -0,0 +1,56 @@ > +#!/bin/sh -e > + > +install_driver() { > + DRIVER=$1 > + OPTS=$2 > + > + modprobe $DRIVER $OPTS > + maj=$(awk "$$2==\"${DRIVER}\" { print $$1; }" /proc/devices) > + > + if [ -e /dev/${DRIVER} ]; then > + rm -f /dev/${DRIVER} > + fi > + > + mknod /dev/${DRIVER} c $maj 0 > + chmod 666 /dev/${DRIVER} 600. > +} > + > +start() { > + echo "mali: starting driver" > + > + BITSPERPIXEL="$(fbset | awk '/geom/ {print $6}')" > + YRES="$(fbset | awk '/geom/ {print $3}')" > + # Set RGBA ordering to something the drivers like > + if [ "$BITSPERPIXEL" = "32" ] ; then > + fbset -rgba 8/16,8/8,8/0,8/24 > + fi > + # Try to enable triple buffering when there's enough VRAM > + fbset -vyres $(( YRES*3 )) > + > + install_driver mali > + install_driver ump > +} > + > +stop() { > + echo "mali: stopping driver" > + > + rmmod ump > + rmmod mali > +} > + > +case "$1" in > +start) > + start > +;; > +stop) > + stop > +;; > +restart) > + stop > + start > +;; > +*) > + echo "mali: Please use start, stop, or restart." > + exit 1 > +;; > +esac > diff --git a/package/sunxi-mali/egl.pc b/package/sunxi-mali/egl.pc > new file mode 100644 > index 0000000..56e3990 > --- /dev/null > +++ b/package/sunxi-mali/egl.pc > @@ -0,0 +1,12 @@ > +prefix=/usr/ > +exec_prefix=${prefix} > +libdir=${exec_prefix}/lib > +includedir=${prefix}/include > + > +Name: egl > +Description: ARM Mali implementation of EGL > +Version: 1.4 > +Requires: > +Libs: -L${libdir} -lEGL -lGLESv2 -lUMP > +Cflags: -I{includedir}/EGL/ -I${includedir} > + > diff --git a/package/sunxi-mali/glesv2.pc b/package/sunxi-mali/glesv2.pc > new file mode 100644 > index 0000000..4e112ee > --- /dev/null > +++ b/package/sunxi-mali/glesv2.pc > @@ -0,0 +1,12 @@ > +prefix=/usr > +exec_prefix=${prefix} > +libdir=${exec_prefix}/lib > +includedir=${prefix}/include > + > +Name: glesv2 > +Description: ARM Mali implementation of OpenGL ESv2 > +Version: 2.0 > +Requires: > +Libs: -L${libdir} -lGLESv2 -lGLES_CM -lUMP > +Cflags: -I${includedir}/GLES2 > + > diff --git a/package/sunxi-mali/sunxi-mali.mk b/package/sunxi-mali/sunxi-mali.mk > new file mode 100644 > index 0000000..693e454 > --- /dev/null > +++ b/package/sunxi-mali/sunxi-mali.mk > @@ -0,0 +1,79 @@ > +################################################################################ > +# > +# sunxi-mali > +# > +################################################################################ > + > +SUNXI_MALI_VERSION = c2491fe952 > +SUNXI_MALI_SITE = http://github.com/linux-sunxi/sunxi-mali/tarball/$(SUNXI_MALI_VERSION) > + > +SUNXI_MALI_DEPENDENCIES = sunxi-mali-prop > +SUNXI_MALI_INSTALL_STAGING = YES > + > +define SUNXI_MALI_CONFIGURE_CMDS > + rm -rf $(@D)/lib/mali > + cp -rf $(SUNXI_MALI_PROP_DIR) $(@D)/lib/mali So you're replacing the original lib/mali directory with the data from the sunxi-mali-prop package. This is probably the good place to explain why this is needed. Also, I would put this in a post-extract hook rather than in the configure commands. > +endef > + > +SUNXI_MALI_MAKE_ENV = \ > + CC=$(TARGET_CC) \ > + CFLAGS="$(TARGET_CFLAGS)" \ These are generally passed as arguments of make rather than in the environment. It doesn't work in your case? > + $(TARGET_MAKE_ENV) > + > + > +ifeq ($(BR2_PACKAGE_SUNXI_MALI_HARDFP),y) > +SUNXI_MALI_MAKE_OPTS += ABI=armhf > +else > +SUNXI_MALI_MAKE_OPTS += ABI=armel > +endif > + > +ifeq ($(BR2_PACKAGE_SUNXI_MALI_FB),y) > +SUNXI_MALI_MAKE_OPTS += EGL_TYPE=framebuffer > +else > +SUNXI_MALI_MAKE_OPTS += EGL_TYPE=x11 > +endif > + > +ifeq ($(BR2_PACKAGE_SUNXI_MALI_R2P4),y) > +SUNXI_MALI_MAKE_OPTS += VERSION=r2p4 > +endif > +ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P0),y) > +SUNXI_MALI_MAKE_OPTS += VERISON=r3p0 > +endif > +ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P1),y) > +SUNXI_MALI_MAKE_OPTS += VERSION=r3p1 > +endif > + > +define SUNXI_MALI_BUILD_CMDS > + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) all > + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), > + cd $(@D)/version && \ > + $(TARGET_CC) $(SUNXI_MALI_CFLAGS) -o version version.c; \ SUNXI_MALI_CFLAGS isn't defined anywhere from what I can see. Also, I believe that you could build this C file unconditionally, it's not going to take a huge amount of time: $(TARGET_CC) $(TARGET_CFLAGS) -o $(@D)/version/version $(@D)/version/version.c > + ) > +endef > + > +define SUNXI_MALI_INSTALL_STAGING_CMDS > + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) \ > + $(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install > + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), > + # test must be built after install because it depends on headers that are > + # generated during the install above. Yurk :-( > + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) test > + ) > + $(INSTALL) -D -m 0644 package/sunxi-mali/egl.pc $(STAGING_DIR)/usr/lib/pkgconfig/ > + $(INSTALL) -D -m 0644 package/sunxi-mali/glesv2.pc $(STAGING_DIR)/usr/lib/pkgconfig/ The destination path must indicate the complete filename when using -D. > +endef > + > +define SUNXI_MALI_INSTALL_TARGET_CMDS > + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D)/lib \ > + $(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install > + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), > + $(INSTALL) -m 755 $(@D)/version/version $(TARGET_DIR)/usr/bin/maliver; \ > + $(INSTALL) -m 755 $(@D)/test/test $(TARGET_DIR)/usr/bin/malitest > + ) > +endef > + > +define SUNXI_MALI_INSTALL_INIT_SYSV > + $(INSTALL) -D -m 0755 package/sunxi-mali/S80mali $(TARGET_DIR)/etc/init.d/ > +endef > + > +$(eval $(generic-package)) Otherwise looks good. Seems like the sunxi-mali stuff is a little bit less horrible than the ti-gfx thing :-) Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-16 8:55 ` Thomas Petazzoni @ 2013-07-16 16:46 ` Spenser Gilliland 2013-07-16 19:08 ` Thomas Petazzoni 0 siblings, 1 reply; 16+ messages in thread From: Spenser Gilliland @ 2013-07-16 16:46 UTC (permalink / raw) To: buildroot Thomas, > It'd be great to have some explanations about what is this > sunxi-mali-prop compared to sunxi-mali. At least in the commit log, > maybe even somewhere in the source code (but I'm not sure where). Basically, sunxi-mali-prop is a git submodule of sunxi-mali. It is copied into the lib/mali directory to emulate this configuration. (doesn't work as a symlink unfortunately) >> +config BR2_PACKAGE_SUNXI_MALI_PROP >> + bool > > Maybe you need to select this from sunxi-mali/Config.in ? Will fix. >> diff --git a/package/sunxi-mali-prop/sunxi-mali-prop.mk b/package/sunxi-mali-prop/sunxi-mali-prop.mk >> new file mode 100644 >> index 0000000..f745731 >> --- /dev/null >> +++ b/package/sunxi-mali-prop/sunxi-mali-prop.mk >> @@ -0,0 +1,10 @@ >> +################################################################################ >> +# >> +# sunxi-mali > > sunxi-mali-prop Will fix. >> +# >> +################################################################################ >> + >> +SUNXI_MALI_PROP_VERSION = e4ced47 >> +SUNXI_MALI_PROP_SITE = http://github.com/linux-sunxi/sunxi-mali-proprietary/tarball/$(SUNXI_MALI_PROP_VERSION) >> + >> +$(eval $(generic-package)) >> diff --git a/package/sunxi-mali/Config.in b/package/sunxi-mali/Config.in >> new file mode 100644 >> index 0000000..d1ad173 >> --- /dev/null >> +++ b/package/sunxi-mali/Config.in >> @@ -0,0 +1,65 @@ >> +config BR2_PACKAGE_SUNXI_MALI >> + bool "sunxi-mali" >> + select BR2_PACKAGE_HAS_OPENGL_EGL >> + select BR2_PACKAGE_HAS_OPENGL_ES >> + depends on BR2_TOOLCHAIN_USES_GLIBC && BR2_arm > > As suggested above: select BR2_PACKAGE_SUNXI_MALI_PROP. Will fix. > Just curious: there is no kernel modules? Well, yes and no. There is the possibility to build the external module. However, it is included by default in the sunxi-linux kernel. See https://github.com/linux-sunxi/mali-400-kernel-drivers for the external module. >> + help >> + Install the ARM Mali drivers for sunxi based systems. >> + >> + http://github.com/linux-sunxi/sunxi-mali >> + >> +if BR2_PACKAGE_SUNXI_MALI >> + >> +config BR2_PACKAGE_SUNXI_MALI_DBG >> + bool "install malitest and maliver tools" >> + help >> + Install 3D triangle demo malitest application and the maliver application >> + which describes the kernel module version. >> + >> +config BR2_PACKAGE_SUNXI_MALI_HARDFP >> + bool "use hard float binaries" >> + help >> + Install hard float binaries (required if using a hard float toolchain) > > Hopefully with my EABIhf series this can be refactored, but ok for now. Will fix. >> + >> +choice >> + prompt "type of EGL binaries to install" >> + default BR2_PACKAGE_SUNXI_FB >> + help >> + Which EGL_TYPE binaries should be installed? >> + >> +config BR2_PACKAGE_SUNXI_MALI_FB >> + bool "framebuffer" >> + help >> + Install framebuffer compatible binaries >> + >> +# TODO: Add X11 support >> +#config BR2_PACKAGE_SUNXI_MALI_X11 >> +# bool "X11" >> +# help >> +# Install X11 compatible binaries > > Does this requires a specific Mali X11 driver? Is it something you > intend to package in this first version of sunxi-mali, or something you > intend to do later (in which case you could remove this choice for now). There is an x11 driver here https://github.com/linux-sunxi/xf86-video-mali . However, I was planning to add this in a later patch series. So, I'll just delete it for now. >> +endchoice >> + >> +choice >> + prompt "Version" >> + default BR2_PACKAGE_SUNXI_MALI_R3P1 >> + help >> + Select the version of the Sunxi Mali binaries to install. >> + >> +config BR2_PACKAGE_SUNXI_MALI_R2P4 >> + bool "r2p4" >> + >> +config BR2_PACKAGE_SUNXI_MALI_R3P0 >> + bool "r3p0" >> + >> +config BR2_PACKAGE_SUNXI_MALI_R3P1 >> + depends on BR2_PACKAGE_SUNXI_MALI_HARDFP >> + bool "r3p1" > > I wouldn't know how to chose between the three possibilities here, some > more help would be nice. Also, maybe add a comment for the r3p1 being > not available on !EABIhf systems. I'm having trouble finding a description of what cores use which version of the libs. The best method is to install and use the maliver application to determine the appropriate version. I'll add info about this to the help text. Also, I will add the !EABIHF comment. > >> +endchoice >> + >> +endif >> + >> +comment "sunxi-mali requires an eglibc/glibc based toolchain" >> + depends on !(BR2_TOOLCHAIN_USES_GLIBC) && BR2_arm > > Parenthesis unneeded. Will fix. > >> diff --git a/package/sunxi-mali/S80mali b/package/sunxi-mali/S80mali >> new file mode 100644 >> index 0000000..22976b6 >> --- /dev/null >> +++ b/package/sunxi-mali/S80mali >> @@ -0,0 +1,56 @@ >> +#!/bin/sh -e >> + >> +install_driver() { >> + DRIVER=$1 >> + OPTS=$2 >> + >> + modprobe $DRIVER $OPTS >> + maj=$(awk "$$2==\"${DRIVER}\" { print $$1; }" /proc/devices) >> + >> + if [ -e /dev/${DRIVER} ]; then >> + rm -f /dev/${DRIVER} >> + fi >> + >> + mknod /dev/${DRIVER} c $maj 0 >> + chmod 666 /dev/${DRIVER} > > 600. Will fix. > >> +} >> + >> +start() { >> + echo "mali: starting driver" >> + >> + BITSPERPIXEL="$(fbset | awk '/geom/ {print $6}')" >> + YRES="$(fbset | awk '/geom/ {print $3}')" >> + # Set RGBA ordering to something the drivers like >> + if [ "$BITSPERPIXEL" = "32" ] ; then >> + fbset -rgba 8/16,8/8,8/0,8/24 >> + fi >> + # Try to enable triple buffering when there's enough VRAM >> + fbset -vyres $(( YRES*3 )) >> + >> + install_driver mali >> + install_driver ump >> +} >> + >> +stop() { >> + echo "mali: stopping driver" >> + >> + rmmod ump >> + rmmod mali >> +} >> + >> +case "$1" in >> +start) >> + start >> +;; >> +stop) >> + stop >> +;; >> +restart) >> + stop >> + start >> +;; >> +*) >> + echo "mali: Please use start, stop, or restart." >> + exit 1 >> +;; >> +esac >> diff --git a/package/sunxi-mali/egl.pc b/package/sunxi-mali/egl.pc >> new file mode 100644 >> index 0000000..56e3990 >> --- /dev/null >> +++ b/package/sunxi-mali/egl.pc >> @@ -0,0 +1,12 @@ >> +prefix=/usr/ >> +exec_prefix=${prefix} >> +libdir=${exec_prefix}/lib >> +includedir=${prefix}/include >> + >> +Name: egl >> +Description: ARM Mali implementation of EGL >> +Version: 1.4 >> +Requires: >> +Libs: -L${libdir} -lEGL -lGLESv2 -lUMP >> +Cflags: -I{includedir}/EGL/ -I${includedir} >> + >> diff --git a/package/sunxi-mali/glesv2.pc b/package/sunxi-mali/glesv2.pc >> new file mode 100644 >> index 0000000..4e112ee >> --- /dev/null >> +++ b/package/sunxi-mali/glesv2.pc >> @@ -0,0 +1,12 @@ >> +prefix=/usr >> +exec_prefix=${prefix} >> +libdir=${exec_prefix}/lib >> +includedir=${prefix}/include >> + >> +Name: glesv2 >> +Description: ARM Mali implementation of OpenGL ESv2 >> +Version: 2.0 >> +Requires: >> +Libs: -L${libdir} -lGLESv2 -lGLES_CM -lUMP >> +Cflags: -I${includedir}/GLES2 >> + >> diff --git a/package/sunxi-mali/sunxi-mali.mk b/package/sunxi-mali/sunxi-mali.mk >> new file mode 100644 >> index 0000000..693e454 >> --- /dev/null >> +++ b/package/sunxi-mali/sunxi-mali.mk >> @@ -0,0 +1,79 @@ >> +################################################################################ >> +# >> +# sunxi-mali >> +# >> +################################################################################ >> + >> +SUNXI_MALI_VERSION = c2491fe952 >> +SUNXI_MALI_SITE = http://github.com/linux-sunxi/sunxi-mali/tarball/$(SUNXI_MALI_VERSION) >> + >> +SUNXI_MALI_DEPENDENCIES = sunxi-mali-prop >> +SUNXI_MALI_INSTALL_STAGING = YES >> + >> +define SUNXI_MALI_CONFIGURE_CMDS >> + rm -rf $(@D)/lib/mali >> + cp -rf $(SUNXI_MALI_PROP_DIR) $(@D)/lib/mali > > So you're replacing the original lib/mali directory with the data from > the sunxi-mali-prop package. This is probably the good place to explain > why this is needed. > > Also, I would put this in a post-extract hook rather than in the > configure commands. Will fix. >> +endef >> + >> +SUNXI_MALI_MAKE_ENV = \ >> + CC=$(TARGET_CC) \ >> + CFLAGS="$(TARGET_CFLAGS)" \ > > These are generally passed as arguments of make rather than in the > environment. It doesn't work in your case? No it doesn't. The makefiles use the CFLAGS variable to add various options and setting them as arguments overrides all of this. When placed in the environment, the CFLAGS variable is able to be appended. >> + $(TARGET_MAKE_ENV) >> + >> + >> +ifeq ($(BR2_PACKAGE_SUNXI_MALI_HARDFP),y) >> +SUNXI_MALI_MAKE_OPTS += ABI=armhf >> +else >> +SUNXI_MALI_MAKE_OPTS += ABI=armel >> +endif >> + >> +ifeq ($(BR2_PACKAGE_SUNXI_MALI_FB),y) >> +SUNXI_MALI_MAKE_OPTS += EGL_TYPE=framebuffer >> +else >> +SUNXI_MALI_MAKE_OPTS += EGL_TYPE=x11 >> +endif >> + >> +ifeq ($(BR2_PACKAGE_SUNXI_MALI_R2P4),y) >> +SUNXI_MALI_MAKE_OPTS += VERSION=r2p4 >> +endif >> +ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P0),y) >> +SUNXI_MALI_MAKE_OPTS += VERISON=r3p0 >> +endif >> +ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P1),y) >> +SUNXI_MALI_MAKE_OPTS += VERSION=r3p1 >> +endif >> + >> +define SUNXI_MALI_BUILD_CMDS >> + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) all >> + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), >> + cd $(@D)/version && \ >> + $(TARGET_CC) $(SUNXI_MALI_CFLAGS) -o version version.c; \ > > SUNXI_MALI_CFLAGS isn't defined anywhere from what I can see. Also, I > believe that you could build this C file unconditionally, it's not > going to take a huge amount of time: Will fix. > $(TARGET_CC) $(TARGET_CFLAGS) -o $(@D)/version/version $(@D)/version/version.c > >> + ) >> +endef >> + >> +define SUNXI_MALI_INSTALL_STAGING_CMDS >> + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) \ >> + $(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install >> + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), >> + # test must be built after install because it depends on headers that are >> + # generated during the install above. > > Yurk :-( Agreed! > >> + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) test >> + ) >> + $(INSTALL) -D -m 0644 package/sunxi-mali/egl.pc $(STAGING_DIR)/usr/lib/pkgconfig/ >> + $(INSTALL) -D -m 0644 package/sunxi-mali/glesv2.pc $(STAGING_DIR)/usr/lib/pkgconfig/ > > The destination path must indicate the complete filename when using -D. Will fix. >> +endef >> + >> +define SUNXI_MALI_INSTALL_TARGET_CMDS >> + $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D)/lib \ >> + $(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install >> + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), >> + $(INSTALL) -m 755 $(@D)/version/version $(TARGET_DIR)/usr/bin/maliver; \ >> + $(INSTALL) -m 755 $(@D)/test/test $(TARGET_DIR)/usr/bin/malitest >> + ) >> +endef >> + >> +define SUNXI_MALI_INSTALL_INIT_SYSV >> + $(INSTALL) -D -m 0755 package/sunxi-mali/S80mali $(TARGET_DIR)/etc/init.d/ >> +endef >> + >> +$(eval $(generic-package)) > > Otherwise looks good. Seems like the sunxi-mali stuff is a little bit > less horrible than the ti-gfx thing :-) A lot less horrible. Thanks, Spenser ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-16 16:46 ` Spenser Gilliland @ 2013-07-16 19:08 ` Thomas Petazzoni 2013-07-18 7:21 ` Spenser Gilliland 0 siblings, 1 reply; 16+ messages in thread From: Thomas Petazzoni @ 2013-07-16 19:08 UTC (permalink / raw) To: buildroot Dear Spenser Gilliland, On Tue, 16 Jul 2013 11:46:28 -0500, Spenser Gilliland wrote: > > It'd be great to have some explanations about what is this > > sunxi-mali-prop compared to sunxi-mali. At least in the commit log, > > maybe even somewhere in the source code (but I'm not sure where). > > Basically, sunxi-mali-prop is a git submodule of sunxi-mali. It is > copied into the lib/mali directory to emulate this configuration. > (doesn't work as a symlink unfortunately) Ok. As discussed on IRC, one option would be to extend the download infrastructure to be able to pass the --recursive option to Git. Not sure it's worth the effort for one package though. Maybe what you did with sunxi-mali + sunxi-mali-prop is the simplest option for now. As I noted, it should however be documented. > > >> +config BR2_PACKAGE_SUNXI_MALI_PROP > >> + bool > > > > Maybe you need to select this from sunxi-mali/Config.in ? > > Will fix. Maybe you can put a small comment above this hidden option, like: # This option is hidden because this package is merely used as a way of # downloading a git submodule needed by sunxi-mali. The real package to # enable is therefore sunxi-mali. or something along those lines (as a native speaker, I trust you to find a better english wording than my proposal!). > > Just curious: there is no kernel modules? > > Well, yes and no. There is the possibility to build the external > module. However, it is included by default in the sunxi-linux kernel. > See https://github.com/linux-sunxi/mali-400-kernel-drivers for the > external module. Ok. Since those advanced graphics features are anyway only usable with the sunxi specific kernel at the moment, it doesn't make much sense to package the external kernel modules. However, a short comment in the Config.in help text about the need for those special drivers would be useful. > > Does this requires a specific Mali X11 driver? Is it something you > > intend to package in this first version of sunxi-mali, or something you > > intend to do later (in which case you could remove this choice for now). > > There is an x11 driver here > https://github.com/linux-sunxi/xf86-video-mali . However, I was > planning to add this in a later patch series. So, I'll just delete it > for now. Yes, sounds good. > >> +choice > >> + prompt "Version" > >> + default BR2_PACKAGE_SUNXI_MALI_R3P1 > >> + help > >> + Select the version of the Sunxi Mali binaries to install. > >> + > >> +config BR2_PACKAGE_SUNXI_MALI_R2P4 > >> + bool "r2p4" > >> + > >> +config BR2_PACKAGE_SUNXI_MALI_R3P0 > >> + bool "r3p0" > >> + > >> +config BR2_PACKAGE_SUNXI_MALI_R3P1 > >> + depends on BR2_PACKAGE_SUNXI_MALI_HARDFP > >> + bool "r3p1" > > > > I wouldn't know how to chose between the three possibilities here, some > > more help would be nice. Also, maybe add a comment for the r3p1 being > > not available on !EABIhf systems. > > I'm having trouble finding a description of what cores use which > version of the libs. The best method is to install and use the > maliver application to determine the appropriate version. I'll add > info about this to the help text. Also, I will add the !EABIHF > comment. Have you tried asking on the sunxi IRC channel? I'm not on the channel but I know my colleague Maxime Ripard is there, and it seems to be a fairly active channel. > >> +endef > >> + > >> +SUNXI_MALI_MAKE_ENV = \ > >> + CC=$(TARGET_CC) \ > >> + CFLAGS="$(TARGET_CFLAGS)" \ > > > > These are generally passed as arguments of make rather than in the > > environment. It doesn't work in your case? > > No it doesn't. The makefiles use the CFLAGS variable to add various > options and setting them as arguments overrides all of this. When > placed in the environment, the CFLAGS variable is able to be appended. Ok. Maybe a short comment above then. > > Otherwise looks good. Seems like the sunxi-mali stuff is a little bit > > less horrible than the ti-gfx thing :-) > > A lot less horrible. Great :) Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-16 19:08 ` Thomas Petazzoni @ 2013-07-18 7:21 ` Spenser Gilliland 2013-07-18 8:16 ` Thomas Petazzoni 0 siblings, 1 reply; 16+ messages in thread From: Spenser Gilliland @ 2013-07-18 7:21 UTC (permalink / raw) To: buildroot Thomas, > Ok. As discussed on IRC, one option would be to extend the download > infrastructure to be able to pass the --recursive option to Git. Not > sure it's worth the effort for one package though. Maybe what you did > with sunxi-mali + sunxi-mali-prop is the simplest option for now. As I > noted, it should however be documented. Because git-archive does not easily support creating tarballs of git submodule based projects, I've decided to keep the current structure. >> >> >> +config BR2_PACKAGE_SUNXI_MALI_PROP >> >> + bool >> > >> > Maybe you need to select this from sunxi-mali/Config.in ? >> >> Will fix. > > Maybe you can put a small comment above this hidden option, like: > > # This option is hidden because this package is merely used as a way of > # downloading a git submodule needed by sunxi-mali. The real package to > # enable is therefore sunxi-mali. > > or something along those lines (as a native speaker, I trust you to > find a better english wording than my proposal!). Will fix. >> > Just curious: there is no kernel modules? >> >> Well, yes and no. There is the possibility to build the external >> module. However, it is included by default in the sunxi-linux kernel. >> See https://github.com/linux-sunxi/mali-400-kernel-drivers for the >> external module. > > Ok. Since those advanced graphics features are anyway only usable with > the sunxi specific kernel at the moment, it doesn't make much sense to > package the external kernel modules. > > However, a short comment in the Config.in help text about the need for > those special drivers would be useful. Will fix. >> > Does this requires a specific Mali X11 driver? Is it something you >> > intend to package in this first version of sunxi-mali, or something you >> > intend to do later (in which case you could remove this choice for now). >> >> There is an x11 driver here >> https://github.com/linux-sunxi/xf86-video-mali . However, I was >> planning to add this in a later patch series. So, I'll just delete it >> for now. > > Yes, sounds good. > >> >> +choice >> >> + prompt "Version" >> >> + default BR2_PACKAGE_SUNXI_MALI_R3P1 >> >> + help >> >> + Select the version of the Sunxi Mali binaries to install. >> >> + >> >> +config BR2_PACKAGE_SUNXI_MALI_R2P4 >> >> + bool "r2p4" >> >> + >> >> +config BR2_PACKAGE_SUNXI_MALI_R3P0 >> >> + bool "r3p0" >> >> + >> >> +config BR2_PACKAGE_SUNXI_MALI_R3P1 >> >> + depends on BR2_PACKAGE_SUNXI_MALI_HARDFP >> >> + bool "r3p1" >> > >> > I wouldn't know how to chose between the three possibilities here, some >> > more help would be nice. Also, maybe add a comment for the r3p1 being >> > not available on !EABIhf systems. >> >> I'm having trouble finding a description of what cores use which >> version of the libs. The best method is to install and use the >> maliver application to determine the appropriate version. I'll add >> info about this to the help text. Also, I will add the !EABIHF >> comment. > > Have you tried asking on the sunxi IRC channel? I'm not on the channel > but I know my colleague Maxime Ripard is there, and it seems to be a > fairly active channel. I asked tonight and received the response: the sunxi-kernel repo uses the r3p0 version of the Mali libraries and that the version number corresponds to the version of the kernel module. Therefore, I have set the default to r3p0 and have updated the information in the Config.in. > >> >> +endef >> >> + >> >> +SUNXI_MALI_MAKE_ENV = \ >> >> + CC=$(TARGET_CC) \ >> >> + CFLAGS="$(TARGET_CFLAGS)" \ >> > >> > These are generally passed as arguments of make rather than in the >> > environment. It doesn't work in your case? >> >> No it doesn't. The makefiles use the CFLAGS variable to add various >> options and setting them as arguments overrides all of this. When >> placed in the environment, the CFLAGS variable is able to be appended. > > Ok. Maybe a short comment above then. Will do. > >> > Otherwise looks good. Seems like the sunxi-mali stuff is a little bit >> > less horrible than the ti-gfx thing :-) >> >> A lot less horrible. > > Great :) > > Thomas > -- > Thomas Petazzoni, Free Electrons > Kernel, drivers, real-time and embedded Linux > development, consulting, training and support. > http://free-electrons.com Just as further discussion, I went down the path of transforming the CONFIGURE step into a post extract hook. However, I'm concerned that this may cause a race condition if the post-extract-hook occurs before sunxi-mali-prop is extracted. Perhaps, this needs to be a post configure hook so that the dependency is satisfied. Thanks, Spenser -- Spenser Gilliland Computer Engineer Doctoral Candidate ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-18 7:21 ` Spenser Gilliland @ 2013-07-18 8:16 ` Thomas Petazzoni 0 siblings, 0 replies; 16+ messages in thread From: Thomas Petazzoni @ 2013-07-18 8:16 UTC (permalink / raw) To: buildroot Dear Spenser Gilliland, On Thu, 18 Jul 2013 02:21:44 -0500, Spenser Gilliland wrote: > > Ok. As discussed on IRC, one option would be to extend the download > > infrastructure to be able to pass the --recursive option to Git. Not > > sure it's worth the effort for one package though. Maybe what you did > > with sunxi-mali + sunxi-mali-prop is the simplest option for now. As I > > noted, it should however be documented. > > Because git-archive does not easily support creating tarballs of git > submodule based projects, I've decided to keep the current structure. Right, sounds good to me. > Just as further discussion, I went down the path of transforming the > CONFIGURE step into a post extract hook. However, I'm concerned that > this may cause a race condition if the post-extract-hook occurs before > sunxi-mali-prop is extracted. Perhaps, this needs to be a post > configure hook so that the dependency is satisfied. You are absolutely correct. By the time sunxi-mali is extracted, there is no guarantee at all that sunxi-mali-prop will be extracted, so my suggestion of moving the copying of sunxi-mali-prop stuff into sunxi-mali sources at the extract step clearly doesn't work. Doing it at the configure stage as you did is the only solution, so you were right. Thanks! Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-14 5:10 ` [Buildroot] [RFC 2/3] sunxi-mali: " Spenser Gilliland 2013-07-16 8:55 ` Thomas Petazzoni @ 2013-07-16 20:14 ` Yann E. MORIN 2013-07-18 6:12 ` Spenser Gilliland 1 sibling, 1 reply; 16+ messages in thread From: Yann E. MORIN @ 2013-07-16 20:14 UTC (permalink / raw) To: buildroot Spenser, All, On 2013-07-14 00:10 -0500, Spenser Gilliland spake thusly: > +config BR2_PACKAGE_SUNXI_MALI > + bool "sunxi-mali" Do you plan on looking to the open source driver, lima, as an alternative to mali? http://limadriver.org/ Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-16 20:14 ` Yann E. MORIN @ 2013-07-18 6:12 ` Spenser Gilliland 2013-07-18 7:16 ` Thomas Petazzoni 2013-07-18 16:29 ` Yann E. MORIN 0 siblings, 2 replies; 16+ messages in thread From: Spenser Gilliland @ 2013-07-18 6:12 UTC (permalink / raw) To: buildroot Yann, > On 2013-07-14 00:10 -0500, Spenser Gilliland spake thusly: >> +config BR2_PACKAGE_SUNXI_MALI >> + bool "sunxi-mali" > > Do you plan on looking to the open source driver, lima, as an > alternative to mali? Yes, I've been looking at it but I'm not sure we should package it just yet. I'm going to work on the ODroidU2 first and come back to this. Spenser -- Spenser Gilliland Computer Engineer Doctoral Candidate ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-18 6:12 ` Spenser Gilliland @ 2013-07-18 7:16 ` Thomas Petazzoni 2013-07-18 16:29 ` Yann E. MORIN 1 sibling, 0 replies; 16+ messages in thread From: Thomas Petazzoni @ 2013-07-18 7:16 UTC (permalink / raw) To: buildroot Dear Spenser Gilliland, On Thu, 18 Jul 2013 01:12:17 -0500, Spenser Gilliland wrote: > > On 2013-07-14 00:10 -0500, Spenser Gilliland spake thusly: > >> +config BR2_PACKAGE_SUNXI_MALI > >> + bool "sunxi-mali" > > > > Do you plan on looking to the open source driver, lima, as an > > alternative to mali? > > Yes, I've been looking at it but I'm not sure we should package it > just yet. I'm going to work on the ODroidU2 first and come back to > this. Is lima actually usable today as a drop-in replacement for libOpenGLES, libEGL and so on? Last time I had some infos, my understanding was that it was still some experimental code that isn't yet available in a form of a drop-in OpenGL ES implementation. I've been looking around yesterday for more details on the Lima website, but things aren't really clear, even by having a quick look at the source code. Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 2/3] sunxi-mali: new package 2013-07-18 6:12 ` Spenser Gilliland 2013-07-18 7:16 ` Thomas Petazzoni @ 2013-07-18 16:29 ` Yann E. MORIN 1 sibling, 0 replies; 16+ messages in thread From: Yann E. MORIN @ 2013-07-18 16:29 UTC (permalink / raw) To: buildroot Spenser, All, On 2013-07-18 01:12 -0500, Spenser Gilliland spake thusly: > > On 2013-07-14 00:10 -0500, Spenser Gilliland spake thusly: > >> +config BR2_PACKAGE_SUNXI_MALI > >> + bool "sunxi-mali" > > > > Do you plan on looking to the open source driver, lima, as an > > alternative to mali? > > Yes, I've been looking at it but I'm not sure we should package it > just yet. I'm going to work on the ODroidU2 first and come back to > this. OK, I just wanted to know if you had looked at it. You have, good! :-) Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 3/3] opengl: add sunxi-mali as possible egl/gles provider 2013-07-14 5:10 [Buildroot] [RFC 0/3] ARM Mali Graphics Drivers Spenser Gilliland 2013-07-14 5:10 ` [Buildroot] [RFC 1/3] a10disp: new package Spenser Gilliland 2013-07-14 5:10 ` [Buildroot] [RFC 2/3] sunxi-mali: " Spenser Gilliland @ 2013-07-14 5:10 ` Spenser Gilliland 2013-07-16 8:55 ` Thomas Petazzoni 2 siblings, 1 reply; 16+ messages in thread From: Spenser Gilliland @ 2013-07-14 5:10 UTC (permalink / raw) To: buildroot Signed-off-by: Spenser Gilliland <spenser@gillilanding.com> --- package/opengl/libegl/libegl.mk | 4 ++++ package/opengl/libgles/libgles.mk | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/package/opengl/libegl/libegl.mk b/package/opengl/libegl/libegl.mk index bd8040d..f00f6d1 100644 --- a/package/opengl/libegl/libegl.mk +++ b/package/opengl/libegl/libegl.mk @@ -10,6 +10,10 @@ ifeq ($(BR2_PACKAGE_RPI_USERLAND),y) LIBEGL_DEPENDENCIES += rpi-userland endif +ifeq ($(BR2_PACKAGE_SUNXI_MALI),y) +LIBEGL_DEPENDENCIES += sunxi-mali +endif + ifeq ($(LIBEGL_DEPENDENCIES),) define LIBEGL_CONFIGURE_CMDS echo "No libEGL implementation selected. Configuration error." diff --git a/package/opengl/libgles/libgles.mk b/package/opengl/libgles/libgles.mk index a0048a7..ec06d57 100644 --- a/package/opengl/libgles/libgles.mk +++ b/package/opengl/libgles/libgles.mk @@ -10,6 +10,10 @@ ifeq ($(BR2_PACKAGE_RPI_USERLAND),y) LIBGLES_DEPENDENCIES += rpi-userland endif +ifeq ($(BR2_PACKAGE_SUNXI_MALI),y) +LIBGLES_DEPENDENCIES += sunxi-mali +endif + ifeq ($(LIBGLES_DEPENDENCIES),) define LIBGLES_CONFIGURE_CMDS echo "No libGLES implementation selected. Configuration error." -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Buildroot] [RFC 3/3] opengl: add sunxi-mali as possible egl/gles provider 2013-07-14 5:10 ` [Buildroot] [RFC 3/3] opengl: add sunxi-mali as possible egl/gles provider Spenser Gilliland @ 2013-07-16 8:55 ` Thomas Petazzoni 0 siblings, 0 replies; 16+ messages in thread From: Thomas Petazzoni @ 2013-07-16 8:55 UTC (permalink / raw) To: buildroot Dear Spenser Gilliland, On Sun, 14 Jul 2013 00:10:32 -0500, Spenser Gilliland wrote: > > Signed-off-by: Spenser Gilliland <spenser@gillilanding.com> > --- > package/opengl/libegl/libegl.mk | 4 ++++ > package/opengl/libgles/libgles.mk | 4 ++++ > 2 files changed, 8 insertions(+) This one obviously looks good. Just rebase on top of master now that ti-gfx has been merged, in order to avoid merge conflicts. Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2013-07-18 16:29 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-07-14 5:10 [Buildroot] [RFC 0/3] ARM Mali Graphics Drivers Spenser Gilliland 2013-07-14 5:10 ` [Buildroot] [RFC 1/3] a10disp: new package Spenser Gilliland 2013-07-16 8:21 ` Thomas Petazzoni 2013-07-16 15:46 ` Spenser Gilliland 2013-07-14 5:10 ` [Buildroot] [RFC 2/3] sunxi-mali: " Spenser Gilliland 2013-07-16 8:55 ` Thomas Petazzoni 2013-07-16 16:46 ` Spenser Gilliland 2013-07-16 19:08 ` Thomas Petazzoni 2013-07-18 7:21 ` Spenser Gilliland 2013-07-18 8:16 ` Thomas Petazzoni 2013-07-16 20:14 ` Yann E. MORIN 2013-07-18 6:12 ` Spenser Gilliland 2013-07-18 7:16 ` Thomas Petazzoni 2013-07-18 16:29 ` Yann E. MORIN 2013-07-14 5:10 ` [Buildroot] [RFC 3/3] opengl: add sunxi-mali as possible egl/gles provider Spenser Gilliland 2013-07-16 8:55 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox