Commit 47ee4ccf authored by Adam Jackson's avatar Adam Jackson Committed by Dave Airlie

drm/edid: Retry EDID fetch up to four times

This matches the X server's retry logic.  Note that we'll only retry if
we get a DDC response but fail validation; legitimately disconnected
outputs will bomb out early.

See also: http://bugzilla.redhat.com/532957Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent f985dedb
...@@ -133,9 +133,6 @@ static bool edid_is_valid(struct edid *edid) ...@@ -133,9 +133,6 @@ static bool edid_is_valid(struct edid *edid)
DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version); DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
goto bad; goto bad;
} }
if (edid->revision > 4)
DRM_DEBUG("EDID minor > 4, assuming backward compatibility\n");
for (i = 0; i < EDID_LENGTH; i++) for (i = 0; i < EDID_LENGTH; i++)
csum += raw_edid[i]; csum += raw_edid[i];
if (csum) { if (csum) {
...@@ -143,6 +140,9 @@ static bool edid_is_valid(struct edid *edid) ...@@ -143,6 +140,9 @@ static bool edid_is_valid(struct edid *edid)
goto bad; goto bad;
} }
if (edid->revision > 4)
DRM_DEBUG("EDID minor > 4, assuming backward compatibility\n");
return 1; return 1;
bad: bad:
...@@ -1060,19 +1060,19 @@ static int drm_ddc_read_edid(struct drm_connector *connector, ...@@ -1060,19 +1060,19 @@ static int drm_ddc_read_edid(struct drm_connector *connector,
struct i2c_adapter *adapter, struct i2c_adapter *adapter,
char *buf, int len) char *buf, int len)
{ {
int ret; int i;
ret = drm_do_probe_ddc_edid(adapter, buf, len); for (i = 0; i < 4; i++) {
if (ret != 0) { if (drm_do_probe_ddc_edid(adapter, buf, len))
goto end; return -1;
if (edid_is_valid((struct edid *)buf))
return 0;
} }
if (!edid_is_valid((struct edid *)buf)) {
/* repeated checksum failures; warn, but carry on */
dev_warn(&connector->dev->pdev->dev, "%s: EDID invalid.\n", dev_warn(&connector->dev->pdev->dev, "%s: EDID invalid.\n",
drm_get_connector_name(connector)); drm_get_connector_name(connector));
ret = -1; return -1;
}
end:
return ret;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment