hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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