xref: /OK3568_Linux_fs/buildroot/package/ti-gfx/S80ti-gfx (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2
3start() {
4	echo "ti-gfx: starting pvr driver"
5
6	BITSPERPIXEL="$(fbset | awk '/geom/ {print $6}')"
7	YRES="$(fbset | awk '/geom/ {print $3}')"
8	# Set RGBA ordering to something the drivers like
9	if [ "$BITSPERPIXEL" = "32" ] ; then
10		fbset -rgba 8/16,8/8,8/0,8/24
11	fi
12	# Try to enable triple buffering when there's enough VRAM
13	fbset -vyres $(( YRES*3 ))
14
15	modprobe pvrsrvkm
16	modprobe omaplfb
17	modprobe bufferclass_ti
18
19	pvr_maj=$(awk '$2=="pvrsrvkm" { print $1; }' /proc/devices)
20	rm -f /dev/pvrsrvkm
21
22	mknod /dev/pvrsrvkm c $pvr_maj 0
23	chmod 600 /dev/pvrsrvkm
24
25	if ! /usr/bin/pvrsrvctl --start --no-module; then
26		echo "ti-gfx: unable to start server"
27	fi
28}
29
30stop() {
31	echo "ti-gfx: stopping pvr driver"
32
33	rmmod bufferclass_ti
34	rmmod omaplfb
35	rmmod pvrsrvkm
36}
37
38case "$1" in
39start)
40	start
41;;
42stop)
43	stop
44;;
45restart)
46	stop
47	start
48;;
49*)
50	echo "ti-gfx: Please use start, stop, or restart."
51	exit 1
52;;
53esac
54