X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pandora%2Fplat.c;h=fbb670ce3e53b5200dacea8ca16e48869b0a65a0;hb=1bc471ebf1c85cf78f1862f5596a76f051e7112d;hp=f97cb8347f5fceb86dbedd97c0b079facc9d0b80;hpb=a1b30e1a4a93f8104a1119e4387fa83ba777c712;p=libpicofe.git diff --git a/pandora/plat.c b/pandora/plat.c index f97cb83..fbb670c 100644 --- a/pandora/plat.c +++ b/pandora/plat.c @@ -43,7 +43,7 @@ static void scan_for_filters(void) { struct dirent *ent; int i, count = 0; - char **mfilters; + const char **mfilters; char buff[64]; DIR *dir; @@ -204,6 +204,41 @@ static int gamma_set(int val, int black_level) return do_system(buf); } +/* For now, this only switches tv-out to appropriate fb. + * Maybe this could control actual layers too? */ +static int switch_layer(int which, int enable) +{ + static int was_ovl_enabled = -1; + int tv_enabled = 0; + char buf[128]; + int ret; + + if (which != 1) + return -1; + if (enable == was_ovl_enabled) + return 0; + + was_ovl_enabled = -1; + + tv_enabled = read_int_from_file( + "/sys/devices/platform/omapdss/display1/enabled"); + if (tv_enabled < 0) + return -1; + + if (!tv_enabled) { + // tv-out not enabled + return 0; + } + + snprintf(buf, sizeof(buf), "%s/op_tvout.sh -l %d", + pnd_script_base, enable); + ret = do_system(buf); + if (ret == 0) + was_ovl_enabled = enable; + + return ret; +} + struct plat_target plat_target = { cpu_clock_get, cpu_clock_set, @@ -211,6 +246,7 @@ struct plat_target plat_target = { hwfilter_set, lcdrate_set, gamma_set, + .switch_layer = switch_layer, }; int plat_target_init(void)