Test for existence of hdmi clock before querying edid (#676)

Don't forget to close fd

Co-authored-by: Zakk <zakk@rsdio.com>
This commit is contained in:
zakk4223
2022-08-10 07:09:38 -04:00
committed by GitHub
parent 7ab42bf375
commit ce2da62288

View File

@@ -1393,6 +1393,15 @@ static int get_active_edid()
return 0;
}
//Test if adv7513 senses hdmi clock. If not, don't bother with the edid query
int hpd_state = i2c_smbus_read_byte_data(fd, 0x42);
if (hpd_state < 0 || !(hpd_state & 0x20))
{
i2c_close(fd);
return 0;
}
for (int i = 0; i < 10; i++)
{
i2c_smbus_write_byte_data(fd, 0xC9, 0x03);