[PATCH 1/2] drm: Improve detection of floating connectors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	Some RS690 chipsets seem to end up with floating connectors, either
	a DVI connector isn't actually populated, or an add-in HDMI card
	is available but not installed. In this case we seem to get a NULL byte
	response for each byte of the i2c transaction.

	Function drm_edid_is_zero has been introduced to handle this. But this
	function detects only all-0 EDIDs. Testing showed that there are floating
	RS690 connectors that responds also few random value bytes via i2c transaction.
	So we detect also this case.

	I've tested this on my RS690 without the HDMI card installed and
	it seems to work fine.

Signed-off-by: Thomas Reim <reimth@xxxxxxxxx>
---
 drivers/gpu/drm/drm_edid.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 3e927ce..0e9be64 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -271,14 +271,25 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
 	return ret == 2 ? 0 : -1;
 }
 
+/*
+ * drm_edid_is_zero - zero value EDID records
+ * @edid: EDID data
+ *
+ * Check if an EDID record mainly consists of zero bytes
+ */
 static bool drm_edid_is_zero(u8 *in_edid, int length)
 {
+	int non_zero_counter = 0;
 	int i;
 	u32 *raw_edid = (u32 *)in_edid;
 
-	for (i = 0; i < length / 4; i++)
+	for (i = 0; i < length / 4; i++) {
 		if (*(raw_edid + i) != 0)
+			non_zero_counter++;
+		/* ignore random non-zero bytes */
+		if (non_zero_counter > 8)
 			return false;
+	}
 	return true;
 }
 
-- 
1.7.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux