summaryrefslogtreecommitdiffstats
path: root/recipes-graphics/libgles/libgles-omap3/rc.pvr
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-05-30 09:17:56 +0200
committerKoen Kooi <koen@dominion.thruhere.net>2011-05-30 09:26:22 +0200
commit1098ec32632ecf44560d92d7a7ee747d3a566cc6 (patch)
treea5f7b2196549f951d61c09df519395a110e91b7f /recipes-graphics/libgles/libgles-omap3/rc.pvr
parent3fd522b60e7184b19be7af7101b22888845b2a67 (diff)
downloadmeta-ti-1098ec32632ecf44560d92d7a7ee747d3a566cc6.tar.gz
libgles-omap3: add 4.03.00.02
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes-graphics/libgles/libgles-omap3/rc.pvr')
-rwxr-xr-xrecipes-graphics/libgles/libgles-omap3/rc.pvr93
1 files changed, 93 insertions, 0 deletions
diff --git a/recipes-graphics/libgles/libgles-omap3/rc.pvr b/recipes-graphics/libgles/libgles-omap3/rc.pvr
new file mode 100755
index 00000000..d32f9e4c
--- /dev/null
+++ b/recipes-graphics/libgles/libgles-omap3/rc.pvr
@@ -0,0 +1,93 @@
1#!/bin/sh
2PATH=$PATH:/usr/sbin
3
4BITSPERPIXEL="$(fbset | grep geom | awk '{print $6}')"
5YRES="$(fbset | grep geom | awk '{print $3}')"
6
7CPUTYPE="$(cputype)"
8
9if [ "$1" = "" ]; then
10 echo PVR-INIT: Please use start, stop, or restart.
11 exit 1
12fi
13
14if [ "$1" = "stop" -o "$1" = "restart" ]; then
15 echo Stopping PVR
16 rmmod bufferclass_ti
17 rmmod omaplfb 2>/dev/null
18 rmmod pvrsrvkm 2>/dev/null
19fi
20
21if [ "$1" = "stop" ]; then
22 exit 0
23fi
24
25# Set RGBA ordering to something the drivers like
26if [ "$BITSPERPIXEL" = "32" ] ; then
27 fbset -rgba 8/16,8/8,8/0,8/24
28fi
29
30# Try to enable triple buffering when there's enough VRAM
31fbset -vyres $(expr $YRES \* 3)
32
33sgxprepare () {
34 echo Starting PVR
35 insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko")
36 modprobe omaplfb
37 modprobe bufferclass_ti
38
39 pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3`
40 bc_maj=`grep "bc" /proc/devices | cut -b1,2,3`
41
42 if [ -e /dev/pvrsrvkm ] ; then
43 rm -f /dev/pvrsrvkm
44 fi
45
46 mknod /dev/pvrsrvkm c $pvr_maj 0
47 chmod 666 /dev/pvrsrvkm
48
49 touch /etc/powervr-esrev
50
51 SAVED_ESREVISION="$(cat /etc/powervr-esrev)"
52}
53
54sgxfinish () {
55 if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then
56 echo -n "Starting SGX fixup for"
57 echo " ES${ES_REVISION}.x"
58 cp -a /usr/lib/ES${ES_REVISION}.0/* /usr/lib
59 cp -a /usr/bin/ES${ES_REVISION}.0/* /usr/bin
60 echo "${ES_REVISION}" > /etc/powervr-esrev
61 fi
62 /usr/bin/pvrsrvinit
63}
64
65case $CPUTYPE in
66"OMAP3530")
67 sgxprepare
68
69 devmem2 0x48004B48 w 0x2 > /dev/null
70 devmem2 0x48004B10 w 0x1 > /dev/null
71 devmem2 0x48004B00 w 0x2 > /dev/null
72
73 ES_REVISION="$(devmem2 0x50000014 | sed -e s:0x00010205:5: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')"
74
75 sgxfinish
76 ;;
77"TI816x")
78 sgxprepare
79
80 devmem2 0x48180F04 w 0x0 > /dev/null
81 devmem2 0x48180900 w 0x2 > /dev/null
82 devmem2 0x48180920 w 0x2 > /dev/null
83
84 ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:6: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')"
85
86 sgxfinish
87 ;;
88*)
89 echo No SGX hardware, not starting PVR
90 ;;
91esac
92
93