Some monitors consistently NAK the first EDID read request when connected
over a DVI-DP cable. Thus, allow five NAK failures before giving up when
probing.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:31301
TEST=Hot plug DP/DVI cable into lumpy;
TEST=Should show display on both monitors.
Change-Id: I339dde875893bddb9fb65bcf277993493aa56f20
Reviewed-on: https://gerrit.chromium.org/gerrit/27634
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Simon Que <sque@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: <marcheu@google.com>
drm_probe_ddc(struct i2c_adapter *adapter)
{
unsigned char out;
+ int tries = 5;
+ int ret;
- return (drm_do_probe_ddc_edid(adapter, &out, 0, 1) == 0);
+ /*
+ * Some monitors NAK the first EDID read request when connected over
+ * a DVI-DP cable, so we try 5 times before giving up.
+ */
+ do {
+ ret = drm_do_probe_ddc_edid(adapter, &out, 0, 1);
+ } while (ret && --tries);
+
+ return ret == 0;
}
/**