4 profiles=/etc/pandora/conf/tvout-profiles.conf
15 echo "usage: $0 [-d] [-t pal|ntsc] [-c composite|svideo] [-l 0|1|o] [-{p|n}s w,h] [-{p|n}p x,y]"
21 # we must preallocate enough memory for the scaler layer
22 # since the app won't be able to change this
23 # the whole time TV-out is running..
24 ofbset -fb /dev/fb1 -mem $[3*1024*1024] -size 512 256 -en 0
31 if [ "$tv_type" = "ntsc" ]; then
35 echo "${tv_type}, ${conn_type}, layer $layer, $pos $size"
37 cd /sys/devices/platform/omapdss
38 ovl0=`cat overlay0/enabled`
39 ovl1=`cat overlay1/enabled`
40 echo 0 > display1/enabled
41 echo 0 > overlay0/enabled
42 echo 0 > overlay1/enabled
43 echo 0 > overlay2/enabled
44 echo "" > /sys/class/graphics/fb2/overlays
45 echo "" > /sys/class/graphics/fb1/overlays
46 if [ $layer -eq 1 ]; then
48 echo "0" > /sys/class/graphics/fb0/overlays
49 echo "1,2" > /sys/class/graphics/fb1/overlays
51 # assume layer 0 for now
52 echo "0,2" > /sys/class/graphics/fb0/overlays
53 echo "1" > /sys/class/graphics/fb1/overlays
55 echo $conn_type > display1/venc_type
56 echo "tv" > overlay2/manager
57 echo $tv_type > display1/timings
58 echo $size > overlay2/output_size
59 echo $pos > overlay2/position
60 echo $ovl0 > overlay0/enabled
61 echo $ovl1 > overlay1/enabled
62 echo 1 > overlay2/enabled
63 echo 1 > display1/enabled
68 cd /sys/devices/platform/omapdss
69 echo 0 > overlay0/enabled
70 echo 0 > overlay1/enabled
71 echo 0 > overlay2/enabled
72 echo 0 > display1/enabled
73 echo "" > /sys/class/graphics/fb2/overlays
74 echo "" > /sys/class/graphics/fb1/overlays
75 echo 0 > /sys/class/graphics/fb0/overlays
76 echo 1 > /sys/class/graphics/fb1/overlays
77 # for system menu, etc
78 echo 2 > /sys/class/graphics/fb2/overlays
79 echo "lcd" > overlay2/manager
80 echo 1 > overlay0/enabled
85 tv_on=`cat /sys/devices/platform/omapdss/display1/enabled`
86 if [ "$tv_on" != "1" ]; then
87 echo "tv-out is off, not changing layers"
90 ovl1_on=`cat /sys/devices/platform/omapdss/overlay1/enabled`
91 if [ "$ovl1_on" != "1" ]; then
96 tmp=`cat /sys/class/graphics/fb0/overlays`
97 if [ "$tmp" == "0" ]; then
107 if [ "$1" == "pal" -o "$1" == "ntsc" ]; then
110 echo "bad tv_type: $1"
116 if [ "$1" == "svideo" -o "$1" == "composite" ]; then
119 echo "bad conn_type: $1"
125 if [ "$1" == "0" -o "$1" == "1" ]; then
132 # read defaults from user profile
133 if test -f "$profiles"; then
134 defprofile=`grep -A1 '^Last written' "$profiles" | tail -n 1`
135 if test -n "$defprofile"; then
140 is_good_tv_type $2 && tv_type=$2
142 is_good_conn_type $3 && conn_type=$3
144 is_good_layer $4 && layer=$4
146 test -n "$5" -a -n "$6" && eval ${tv_type}_pos=$5,$6
148 test -n "$7" -a -n "$8" && eval ${tv_type}_size=$7,$8
151 parse_profile $defprofile
152 echo "loaded defaults from last used profile"
173 if [ "$1" == "o" ]; then
174 # "other layer" - switch to different layer
182 if [ "$1" != "0,0" ]; then
185 echo "warning: ignored pal_size: $1"
194 if [ "$1" != "0,0" ]; then
197 echo "warning: ignored ntsc_size: $1"
211 if ! shift; then break; fi
214 if ! is_good_tv_type $tv_type; then
218 if ! is_good_conn_type $conn_type; then
222 if ! is_good_layer $layer; then