diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2011-05-30 09:17:56 +0200 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-05-30 09:26:22 +0200 |
commit | 1098ec32632ecf44560d92d7a7ee747d3a566cc6 (patch) | |
tree | a5f7b2196549f951d61c09df519395a110e91b7f /recipes-graphics/libgles/libgles-omap3/rc.pvr | |
parent | 3fd522b60e7184b19be7af7101b22888845b2a67 (diff) | |
download | meta-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-x | recipes-graphics/libgles/libgles-omap3/rc.pvr | 93 |
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 | ||
2 | PATH=$PATH:/usr/sbin | ||
3 | |||
4 | BITSPERPIXEL="$(fbset | grep geom | awk '{print $6}')" | ||
5 | YRES="$(fbset | grep geom | awk '{print $3}')" | ||
6 | |||
7 | CPUTYPE="$(cputype)" | ||
8 | |||
9 | if [ "$1" = "" ]; then | ||
10 | echo PVR-INIT: Please use start, stop, or restart. | ||
11 | exit 1 | ||
12 | fi | ||
13 | |||
14 | if [ "$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 | ||
19 | fi | ||
20 | |||
21 | if [ "$1" = "stop" ]; then | ||
22 | exit 0 | ||
23 | fi | ||
24 | |||
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 | ||
28 | fi | ||
29 | |||
30 | # Try to enable triple buffering when there's enough VRAM | ||
31 | fbset -vyres $(expr $YRES \* 3) | ||
32 | |||
33 | sgxprepare () { | ||
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 | |||
54 | sgxfinish () { | ||
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 | |||
65 | case $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 | ;; | ||
91 | esac | ||
92 | |||
93 | |||