4 BITSPERPIXEL="$(fbset | grep geom | awk '{print $6}')"
5 YRES="$(fbset | grep geom | awk '{print $3}')"
10 echo PVR-INIT: Please use start, stop, or restart.
14 if [ "$1" = "stop" -o "$1" = "restart" ]; then
16 rmmod bufferclass_ti 2>/dev/null
17 rmmod omaplfb 2>/dev/null
18 rmmod pvrsrvkm 2>/dev/null
21 if [ "$1" = "stop" ]; then
25 # Set RGBA ordering to something the drivers like
26 if [ "$BITSPERPIXEL" = "32" ] ; then
27 fbset -rgba 8/16,8/8,8/0,8/24
30 # Try to enable triple buffering when there's enough VRAM
31 fbset -vyres $(expr $YRES \* 3)
34 insmod /lib/modules/$(uname -r)/kernel/drivers/gpu/pvr/pvrsrvkm.ko
35 insmod /lib/modules/$(uname -r)/kernel/drivers/gpu/pvr/omaplfb.ko
36 bc_ko="/lib/modules/$(uname -r)/kernel/drivers/gpu/pvr/bufferclass_ti.ko"
37 if test -f "$bc_ko"; then
41 if ! lsmod | grep -q pvrsrvkm; then
42 echo pvrsrvkm failed to load
46 #pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3`
47 #bc_maj=`grep "bc" /proc/devices | cut -b1,2,3`
49 #if [ -e /dev/pvrsrvkm ] ; then
53 #mknod /dev/pvrsrvkm c $pvr_maj 0
54 chmod 666 /dev/pvrsrvkm
56 touch /etc/powervr-esrev
58 SAVED_ESREVISION="$(cat /etc/powervr-esrev)"
60 devmem2 0x48004B48 w 0x2 > /dev/null
61 devmem2 0x48004B10 w 0x1 > /dev/null
62 devmem2 0x48004B00 w 0x2 > /dev/null
64 ES_REVISION="$(devmem2 0x50000014 | sed -e s:0x10205:5: -e s:0x10201:3: -e s:0x10003:2: | tail -n1 | awk -F': ' '{print $2}')"
66 # enable hardware supervised domain power state transition - makes suspend work
67 devmem2 0x48004B48 w 0x3 > /dev/null
69 if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then
70 echo -n "Starting SGX fixup for"
71 echo " ES${ES_REVISION}.x"
72 cp -a /usr/lib/ES${ES_REVISION}.0/* /usr/lib
73 cp -a /usr/bin/ES${ES_REVISION}.0/* /usr/bin
74 echo "${ES_REVISION}" > /etc/powervr-esrev