The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / ti-gfx / S80ti-gfx
diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/ti-gfx/S80ti-gfx b/cirros-testvm/src-cirros/buildroot-2015.05/package/ti-gfx/S80ti-gfx
new file mode 100644 (file)
index 0000000..fc5999a
--- /dev/null
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+start() {
+       echo "ti-gfx: starting pvr 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 ))
+
+       modprobe pvrsrvkm
+       modprobe omaplfb
+       modprobe bufferclass_ti
+
+       pvr_maj=$(awk '$2=="pvrsrvkm" { print $1; }' /proc/devices)
+       rm -f /dev/pvrsrvkm
+
+       mknod /dev/pvrsrvkm c $pvr_maj 0
+       chmod 600 /dev/pvrsrvkm
+
+       if ! /usr/bin/pvrsrvctl --start --no-module; then
+               echo "ti-gfx: unable to start server"
+       fi
+}
+
+stop() {
+       echo "ti-gfx: stopping pvr driver"
+
+       rmmod bufferclass_ti
+       rmmod omaplfb
+       rmmod pvrsrvkm
+}
+
+case "$1" in
+start)
+       start
+;;
+stop)
+       stop
+;;
+restart)
+       stop
+       start
+;;
+*)
+       echo "ti-gfx: Please use start, stop, or restart."
+       exit 1
+;;
+esac