Skip to content

Commit

Permalink
Add HDMI Grey Standby option in settings menu
Browse files Browse the repository at this point in the history
  • Loading branch information
IanSB committed May 17, 2021
1 parent 20796c8 commit 1393e39
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/geometry.c
Expand Up @@ -532,7 +532,7 @@ void geometry_get_fb_params(capture_info_t *capinfo) {
if (get_invert() == INVERT_Y) {
capinfo->ntscphase |= NTSC_Y_INVERT;
}
if (get_hdmi_blank()) {
if (get_hdmi_standby()) {
capinfo->ntscphase |= NTSC_HDMI_BLANK;
}

Expand Down
20 changes: 9 additions & 11 deletions src/osd.c
Expand Up @@ -318,6 +318,7 @@ enum {
F_RESOLUTION,
F_REFRESH,
F_HDMI,
F_HDMI_STANDBY,
F_SCALING,
F_PROFILE,
F_SAVED,
Expand Down Expand Up @@ -368,6 +369,7 @@ static param_t features[] = {
{ F_RESOLUTION, "Resolution", "resolution", 0, 0, 1 },
{ F_REFRESH, "Refresh", "refresh", 0, NUM_REFRESH - 1, 1 },
{ F_HDMI, "HDMI Mode", "hdmi_mode", 0, NUM_HDMIS - 1, 1 },
{ F_HDMI_STANDBY, "HDMI Grey Standby", "hdmi_standby", 0, 1, 1 },
{ F_SCALING, "Scaling", "scaling", 0, NUM_SCALING - 1, 1 },
{ F_PROFILE, "Profile", "profile", 0, 0, 1 },
{ F_SAVED, "Saved Config", "saved_config", 0, 4, 1 },
Expand Down Expand Up @@ -546,6 +548,7 @@ static param_menu_item_t subprofile_ref = { I_FEATURE, &features[F_SUBPROFI
static param_menu_item_t resolution_ref = { I_FEATURE, &features[F_RESOLUTION] };
static param_menu_item_t refresh_ref = { I_FEATURE, &features[F_REFRESH] };
static param_menu_item_t hdmi_ref = { I_FEATURE, &features[F_HDMI] };
static param_menu_item_t hdmi_standby_ref = { I_FEATURE, &features[F_HDMI_STANDBY] };
static param_menu_item_t scaling_ref = { I_FEATURE, &features[F_SCALING] };
static param_menu_item_t overscan_ref = { I_FEATURE, &features[F_OVERSCAN] };
static param_menu_item_t capscale_ref = { I_FEATURE, &features[F_CAPSCALE] };
Expand Down Expand Up @@ -663,6 +666,7 @@ static menu_t settings_menu = {
(base_menu_item_t *) &vlockspeed_ref,
(base_menu_item_t *) &vlockadj_ref,
(base_menu_item_t *) &nbuffers_ref,
(base_menu_item_t *) &hdmi_standby_ref,
(base_menu_item_t *) &return_ref,
(base_menu_item_t *) &oclock_cpu_ref,
(base_menu_item_t *) &oclock_core_ref,
Expand Down Expand Up @@ -1057,6 +1061,8 @@ static int get_feature(int num) {
return get_refresh();
case F_HDMI:
return get_hdmi();
case F_HDMI_STANDBY:
return get_hdmi_standby();
case F_SCALING:
return get_scaling();
case F_FRONTEND:
Expand Down Expand Up @@ -1177,6 +1183,9 @@ static void set_feature(int num, int value) {
case F_HDMI:
set_hdmi(value, 1);
break;
case F_HDMI_STANDBY:
set_hdmi_standby(value);
break;
case F_SCALING:
set_scaling(value, 1);
break;
Expand Down Expand Up @@ -5644,17 +5653,6 @@ void osd_init() {

set_hdmi(val, 0);


if (cbytes) {
prop = get_prop_no_space(config_buffer, "hdmi_blanking");
}
if (!prop || !cbytes) {
prop = "0";
}
log_info("hdmi_blanking: %s", prop);
val = atoi(prop);
set_hdmi_blank(val);

if (cbytes) {
prop = get_prop_no_space(config_buffer, "#refresh");
}
Expand Down
3 changes: 3 additions & 0 deletions src/rgb_to_fb.S
Expand Up @@ -770,6 +770,9 @@ process_line_loop:
// Call capture line function
blx r12 // exits with h sync timestamp in r0

tst r3, #BIT_OSD //of osd on then disable grey screen
bicne r3, #BITDUP_GREY_DETECTED

ldr r1, greylinecount
tst r3, #BITDUP_GREY_DETECTED
addne r1, r1, #1
Expand Down
4 changes: 2 additions & 2 deletions src/rgb_to_hdmi.c
Expand Up @@ -2574,11 +2574,11 @@ int get_scaling() {
return scaling;
}

int get_hdmi_blank() {
int get_hdmi_standby() {
return hdmi_blank;
}

void set_hdmi_blank(int value) {
void set_hdmi_standby(int value) {
hdmi_blank = value;
}

Expand Down
4 changes: 2 additions & 2 deletions src/rgb_to_hdmi.h
Expand Up @@ -21,8 +21,8 @@ void set_refresh(int value, int reboot);
int get_refresh();
void set_hdmi(int value, int reboot);
int get_hdmi();
void set_hdmi_blank(int value);
int get_hdmi_blank();
void set_hdmi_standby(int value);
int get_hdmi_standby();
void set_scaling(int mode, int reboot);
int get_scaling();
void set_frontend(int value, int save);
Expand Down

0 comments on commit 1393e39

Please sign in to comment.