Add automatic overscan for 1920x1080 in 16bpp double height mode

pull/173/head
IanSB 2021-01-15 03:52:26 +00:00
rodzic c17badc15f
commit f400a1c843
4 zmienionych plików z 35 dodań i 2 usunięć

Wyświetl plik

@ -391,6 +391,23 @@ void set_setup_mode(int mode) {
}
void geometry_get_fb_params(capture_info_t *capinfo) {
int left;
int right;
int top;
int bottom;
get_config_overscan(&left, &right, &top, &bottom);
if (get_startup_overscan() == 0 && (get_hdisplay() + left + right) == 1920 && (get_vdisplay() + top + bottom) == 1080) {
// if 16bpp frame buffer with double height and 1920x1080 there is insufficent time so set overscan to reduce width to 1600x1080
if (geometry->fb_sizex2 !=0 && geometry->fb_bpp == BPP_16) {
left = 160;
right = 160;
} else {
left = 0;
right = 0;
}
set_config_overscan(left, right, top, bottom);
}
capinfo->sync_type = geometry->sync_type;
capinfo->vsync_type = geometry->vsync_type;
capinfo->video_type = geometry->video_type;
@ -438,6 +455,9 @@ void geometry_get_fb_params(capture_info_t *capinfo) {
}
}
int geometry_h_offset = geometry->h_offset;
int geometry_v_offset = geometry->v_offset;
int geometry_min_h_width = geometry->min_h_width;

Wyświetl plik

@ -5350,6 +5350,8 @@ void osd_init() {
set_config_overscan(l, r, t, b);
set_startup_overscan(l + r);
if (cbytes) {
prop = get_prop_no_space(config_buffer, "hdmi_drive");
}

Wyświetl plik

@ -249,6 +249,7 @@ static int config_overscan_left = 0;
static int config_overscan_right = 0;
static int config_overscan_top = 0;
static int config_overscan_bottom = 0;
static int startup_overscan = 0;
static int cpuspeed = 1000;
static int cpld_fail_state = CPLD_NORMAL;
static int helper_flag = 0;
@ -2265,6 +2266,14 @@ int get_current_display_buffer() {
}
}
void set_startup_overscan(int value) {
startup_overscan = value;
}
int get_startup_overscan() {
return startup_overscan;
}
void set_config_overscan(int l, int r, int t, int b) {
config_overscan_left = l;
config_overscan_right = r;
@ -3116,9 +3125,9 @@ void rgb_to_hdmi_main() {
if (resolution_status) {
if (sync_detected) {
if (vlock_limited || vlockmode != HDMI_EXACT) {
sprintf(osdline, "%d x %d @ %dHz", get_hdisplay(), get_vdisplay(), display_vsync_freq_hz);
sprintf(osdline, "%d x %d @ %dHz", get_hdisplay() + config_overscan_left + config_overscan_right, get_vdisplay() + config_overscan_top + config_overscan_bottom, display_vsync_freq_hz);
} else {
sprintf(osdline, "%d x %d @ %dHz", get_hdisplay(), get_vdisplay(), source_vsync_freq_hz);
sprintf(osdline, "%d x %d @ %dHz", get_hdisplay() + config_overscan_left + config_overscan_right, get_vdisplay() + config_overscan_top + config_overscan_bottom, source_vsync_freq_hz);
}
} else {
sprintf(osdline, "%d x %d", get_hdisplay(), get_vdisplay());

Wyświetl plik

@ -4,6 +4,8 @@
// Property setters/getters
void set_config_overscan(int l, int r, int t, int b);
void get_config_overscan(int *l, int *r, int *t, int *b);
void set_startup_overscan(int value);
int get_startup_overscan();
void set_profile(int value);
int get_profile();
void set_saved_config_number(int value);