mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-04 22:47:44 -04:00
pandora: add tv layer selection helper
This commit is contained in:
parent
18306c325f
commit
1bc471ebf1
2 changed files with 45 additions and 0 deletions
|
@ -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)
|
||||
|
|
9
plat.h
9
plat.h
|
@ -16,6 +16,7 @@ struct plat_target {
|
|||
int (*lcdrate_set)(int is_pal);
|
||||
int (*gamma_set)(int val, int black_level);
|
||||
int (*step_volume)(int *volume, int diff);
|
||||
int (*switch_layer)(int which, int enable);
|
||||
const char **vout_methods;
|
||||
int vout_method;
|
||||
int vout_fullscreen;
|
||||
|
@ -83,6 +84,14 @@ static __inline int plat_target_step_volume(int *volume, int diff)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* switch device graphics layers/overlays */
|
||||
static __inline int plat_target_switch_layer(int which, int enable)
|
||||
{
|
||||
if (plat_target.switch_layer)
|
||||
return plat_target.switch_layer(which, enable);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* menu: enter (switch bpp, etc), begin/end drawing */
|
||||
void plat_video_menu_enter(int is_rom_loaded);
|
||||
void plat_video_menu_begin(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue