Commit 45b7846b authored by Spenser Gilliland's avatar Spenser Gilliland Committed by Thomas Petazzoni
Browse files

sunxi-mali: new package



[Thomas: remove trailing whitespace, install libraries with execution
permissions so that they get stripped by Buildroot, r2p4 is only
available on EABI toolchains, r3p0 on EABIhf toolchains.]

Signed-off-by: default avatarSpenser Gilliland <spenser@gillilanding.com>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent a51b43a6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -295,6 +295,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-gfx/Config.in"
source "package/ti-utils/Config.in"
+4 −0
Original line number Diff line number Diff line
# Sunxi-mali-prop is a git submodule of sunxi-mali. To use this package
# select the sunxi-mali option.
config BR2_PACKAGE_SUNXI_MALI_PROP
	bool
+10 −0
Original line number Diff line number Diff line
################################################################################
#
# 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))
+61 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_SUNXI_MALI
	bool "sunxi-mali"
	select BR2_PACKAGE_HAS_OPENGL_EGL
	select BR2_PACKAGE_HAS_OPENGL_ES
	# The egl/gles mali libraries are provided as a git submodule of the
	# sunxi-mali repo and are downloaded by the sunxi-mali-prop package.
	select BR2_PACKAGE_SUNXI_MALI_PROP
	depends on BR2_TOOLCHAIN_USES_GLIBC
	depends on BR2_arm
	help
	  Install the ARM Mali drivers for sunxi based systems (i.e
	  systems based on ARM Allwinner SoCs). This driver requires
	  either the sunxi-kernel with the ARM Mali driver enabled or
	  the installation of the ARM Mali drivers as an external
	  module.

	  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.

choice
	prompt "Version"
	default BR2_PACKAGE_SUNXI_MALI_R3P0
	help
	  Select the version of the kernel module.  For the sunxi-kernel, the
	  appropriate version number is r3p0. For other kernels, use the maliver
	  application to determine the appropriate version.

config BR2_PACKAGE_SUNXI_MALI_R2P4
	bool "r2p4"
	depends on BR2_ARM_EABI

comment "r2p4 requires an EABI toolchain"
	depends on !BR2_ARM_EABI

config BR2_PACKAGE_SUNXI_MALI_R3P0
	bool "r3p0"
	depends on BR2_ARM_EABIHF

comment "r3p0 requires an EABIhf toolchain"
	depends on !BR2_ARM_EABIHF

config BR2_PACKAGE_SUNXI_MALI_R3P1
	depends on BR2_ARM_EABIHF
	bool "r3p1"

comment "r3p1 requires an EABIhf toolchain"
	depends on !BR2_ARM_EABIHF

endchoice

endif

comment "sunxi-mali requires an eglibc/glibc based toolchain"
	depends on BR2_arm && !BR2_TOOLCHAIN_USES_GLIBC
+54 −0
Original line number Diff line number Diff line
#!/bin/sh -e

install_driver() {
	DRIVER=$1
	OPTS=$2

	modprobe $DRIVER $OPTS
	maj=$(awk "$$2==\"${DRIVER}\" { print $$1; }" /proc/devices)

	rm -f /dev/${DRIVER}

	mknod /dev/${DRIVER} c $maj 0
	chmod 600 /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
Loading