~fitzsim/Main_MiSTer

ce2da62288dcbe43388a287b37771ef114b46b59 — zakk4223 2 years ago 7ab42bf
Test for existence of hdmi clock before querying edid (#676)

Don't forget to close fd

Co-authored-by: Zakk <zakk@rsdio.com>
1 files changed, 9 insertions(+), 0 deletions(-)

M video.cpp
M video.cpp => video.cpp +9 -0
@@ 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);