From: Grazvydas Ignotas Date: Fri, 20 Sep 2013 23:51:43 +0000 (+0300) Subject: op_tvout: add ability to switch to other layer X-Git-Tag: sz_160~49 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed002a5bce35ff1ae623a2e9f605df4f078ca14a;p=openpandora.oe.git op_tvout: add ability to switch to other layer --- diff --git a/recipes/pandora-system/pandora-scripts/op_tvout.sh b/recipes/pandora-system/pandora-scripts/op_tvout.sh index e9ee540..ff96e65 100755 --- a/recipes/pandora-system/pandora-scripts/op_tvout.sh +++ b/recipes/pandora-system/pandora-scripts/op_tvout.sh @@ -12,7 +12,7 @@ ntsc_pos="40,15" usage() { - echo "usage: $0 [-d] [-t pal|ntsc] [-c composite|svideo] [-l 0|1] [-{p|n}s w,h] [-{p|n}p x,y]" + echo "usage: $0 [-d] [-t pal|ntsc] [-c composite|svideo] [-l 0|1|o] [-{p|n}s w,h] [-{p|n}p x,y]" exit 1 } @@ -35,6 +35,8 @@ enable_it() echo "${tv_type}, ${conn_type}, layer $layer, $pos $size" cd /sys/devices/platform/omapdss + ovl0=`cat overlay0/enabled` + ovl1=`cat overlay1/enabled` echo 0 > display1/enabled echo 0 > overlay0/enabled echo 0 > overlay1/enabled @@ -55,7 +57,8 @@ enable_it() echo $tv_type > display1/timings echo $size > overlay2/output_size echo $pos > overlay2/position - echo 1 > overlay0/enabled + echo $ovl0 > overlay0/enabled + echo $ovl1 > overlay1/enabled echo 1 > overlay2/enabled echo 1 > display1/enabled } @@ -75,6 +78,28 @@ disable_it() echo 1 > overlay0/enabled } +layer_toggle() +{ + tv_on=`cat /sys/devices/platform/omapdss/display1/enabled` + if [ "$tv_on" != "1" ]; then + echo "tv-out is off, not changing layers" + exit 1 + fi + ovl1_on=`cat /sys/devices/platform/omapdss/overlay1/enabled` + if [ "$ovl1_on" != "1" ]; then + layer=0 + return + fi + + tmp=`cat /sys/class/graphics/fb0/overlays` + if [ "$tmp" == "0" ]; then + # tv was on overlay + layer=0 + else + layer=1 + fi +} + is_good_tv_type() { if [ "$1" == "pal" -o "$1" == "ntsc" ]; then @@ -144,7 +169,12 @@ while true; do ;; "-l") shift - layer=$1 + if [ "$1" == "o" ]; then + # "other layer" - switch to different layer + layer_toggle + else + layer=$1 + fi ;; "-ps") shift