2013-07-20 01:37:52 +02:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
install_driver() {
|
|
|
|
DRIVER=$1
|
|
|
|
OPTS=$2
|
|
|
|
|
|
|
|
modprobe $DRIVER $OPTS
|
2013-08-24 21:41:57 +02:00
|
|
|
maj=$(awk "\$2==\"${DRIVER}\" { print \$1; }" /proc/devices)
|
2013-07-20 01:37:52 +02:00
|
|
|
|
|
|
|
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
|