aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-11-23 14:23:05 -0500
committerDave Airlie <airlied@redhat.com>2009-11-23 20:24:22 -0500
commit47ee4ccf745ea88ee1aadcf5895d91af3b73ea64 (patch)
treed9d74932f2610d37abf2c2c6a9c8b92d1464523b
parentf985dedb57bae741b4326415f72fe1a1e556563b (diff)
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/532957 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_edid.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index dd95edfcfdc7..282008229f06 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -133,9 +133,6 @@ static bool edid_is_valid(struct edid *edid)
133 DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version); 133 DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
134 goto bad; 134 goto bad;
135 } 135 }
136 if (edid->revision > 4)
137 DRM_DEBUG("EDID minor > 4, assuming backward compatibility\n");
138
139 for (i = 0; i < EDID_LENGTH; i++) 136 for (i = 0; i < EDID_LENGTH; i++)
140 csum += raw_edid[i]; 137 csum += raw_edid[i];
141 if (csum) { 138 if (csum) {
@@ -143,6 +140,9 @@ static bool edid_is_valid(struct edid *edid)
143 goto bad; 140 goto bad;
144 } 141 }
145 142
143 if (edid->revision > 4)
144 DRM_DEBUG("EDID minor > 4, assuming backward compatibility\n");
145
146 return 1; 146 return 1;
147 147
148bad: 148bad:
@@ -1060,19 +1060,19 @@ static int drm_ddc_read_edid(struct drm_connector *connector,
1060 struct i2c_adapter *adapter, 1060 struct i2c_adapter *adapter,
1061 char *buf, int len) 1061 char *buf, int len)
1062{ 1062{
1063 int ret; 1063 int i;
1064 1064
1065 ret = drm_do_probe_ddc_edid(adapter, buf, len); 1065 for (i = 0; i < 4; i++) {
1066 if (ret != 0) { 1066 if (drm_do_probe_ddc_edid(adapter, buf, len))
1067 goto end; 1067 return -1;
1068 } 1068 if (edid_is_valid((struct edid *)buf))
1069 if (!edid_is_valid((struct edid *)buf)) { 1069 return 0;
1070 dev_warn(&connector->dev->pdev->dev, "%s: EDID invalid.\n",
1071 drm_get_connector_name(connector));
1072 ret = -1;
1073 } 1070 }
1074end: 1071
1075 return ret; 1072 /* repeated checksum failures; warn, but carry on */
1073 dev_warn(&connector->dev->pdev->dev, "%s: EDID invalid.\n",
1074 drm_get_connector_name(connector));
1075 return -1;
1076} 1076}
1077 1077
1078/** 1078/**