Add support for 15Khz resolutions

master
IanSB 2024-02-05 00:30:31 +00:00
rodzic 155526d3e9
commit e5640940af
3 zmienionych plików z 18 dodań i 9 usunięć

Wyświetl plik

@ -977,17 +977,17 @@ int get_hdisplay() {
int h_size = (*PIXELVALVE2_HORZB) & 0xFFFF;
#endif
int v_size = (*PIXELVALVE2_VERTB) & 0xFFFF;
if (h_size < 640 || h_size > 8192 || v_size < 480 || v_size > 4096) {
log_info("HDMI readback of screen size invalid (%dx%d) - rebooting", h_size, v_size);
delay_in_arm_cycles_cpu_adjust(1000000000);
reboot();
}
// if (h_size < 640 || h_size > 8192 || v_size < 200 || v_size > 4096) {
// log_info("HDMI readback of screen size invalid (%dx%d) - rebooting", h_size, v_size);
// delay_in_arm_cycles_cpu_adjust(1000000000);
// reboot();
// }
//workaround for 640x480 and 800x480 @50Hz using double rate clock so width gets doubled
if (v_size == 480 && h_size == 1280) {
h_size = 640;
} else if (v_size == 480 && h_size == 1600) {
h_size = 800;
} else if (v_size == 240 || v_size == 288) {
} else if (v_size <= 288) {
h_size >>= 1;
}
return h_size;
@ -997,6 +997,8 @@ int get_vdisplay() {
int v_size = (*PIXELVALVE2_VERTB) & 0xFFFF;
if (v_size == 2160 && get_hdisplay() == 1920){
v_size = 1080;
} else if (v_size <= 288) {
v_size <<= 1;
}
return v_size;
}

Wyświetl plik

@ -7143,7 +7143,7 @@ void osd_init() {
log_info("***EDID checksum FAIL! ...rebooting");
delay_in_arm_cycles_cpu_adjust(200000000);
reboot();
}
}
int valid_edid = 1;
if (strcmp(EDID_name, "MZ0404") == 0) {
@ -7307,6 +7307,14 @@ void osd_init() {
int auto_detected = 0;
if (strcmp(prop, DEFAULT_RESOLUTION) == 0)
{
//if auto detected then check vertical resolution and reboot if 240 or 288
//int v_size = (*PIXELVALVE2_VERTB) & 0xFFFF;
//if (v_size == 240 || v_size == 288) {
// log_info("Resolution = Auto and no HDMI connected (V=%d) - rebooting", v_size);
// delay_in_arm_cycles_cpu_adjust(1000000000);
// reboot();
//}
auto_detected = 1;
if (get_parameter(F_REFRESH) == REFRESH_50) {
force_genlock_range = REFRESH_50_60;

Wyświetl plik

@ -498,7 +498,7 @@ int height = 0;
width = mp->data.buffer_32[0];
height = mp->data.buffer_32[1];
if (width != adjusted_width || height != adjusted_height) {
log_info("Invalid frame buffer dimensions - maybe HDMI not connected - rebooting");
log_info("Invalid frame buffer dimensions %d/%d, %d/%d - maybe HDMI not connected - rebooting", width, adjusted_width, height, adjusted_height);
delay_in_arm_cycles_cpu_adjust(1000000000);
reboot();
}
@ -1674,7 +1674,6 @@ static void init_hardware() {
_init_cycle_counter();
RPI_SetGpioPinFunction(MODE7_PIN, FS_OUTPUT);
RPI_SetGpioValue(MODE7_PIN, 1);
get_hdisplay(); //forces a reboot if no hdmi connector fitted
#ifdef RPI4
*EMMC_LEGACY = *EMMC_LEGACY | 2; //bit enables legacy SD controller