summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-02-02 01:06:22 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-02-02 01:06:22 +0000
commitfe55dfde82d2faf80a3ca92ba365c26ec5e2ad02 (patch)
tree43132f50575007bd0b588eff23b86ba9c4093a97
parent45768120191e1b8b78f90445c24a3212fa146b04 (diff)
drm/i915/dp: increase i2c-over-aux retry interval on AUX DEFER
From Jani Nikula 67c729e64ef03476312fc9fb815046d5e540428a in ubuntu 3.8 8d16f258217f2f583af1fd57c5144aa4bbe73e48 in mainline linux
-rw-r--r--sys/dev/pci/drm/i915/intel_dp.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/i915/intel_dp.c b/sys/dev/pci/drm/i915/intel_dp.c
index db19006bb37..29dc199eb14 100644
--- a/sys/dev/pci/drm/i915/intel_dp.c
+++ b/sys/dev/pci/drm/i915/intel_dp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_dp.c,v 1.14 2014/01/23 10:42:57 jsg Exp $ */
+/* $OpenBSD: intel_dp.c,v 1.15 2014/02/02 01:06:21 jsg Exp $ */
/*
* Copyright © 2008 Intel Corporation
*
@@ -629,7 +629,18 @@ intel_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
DRM_DEBUG_KMS("aux_ch native nack\n");
return -EIO;
case AUX_NATIVE_REPLY_DEFER:
- udelay(100);
+ /*
+ * For now, just give more slack to branch devices. We
+ * could check the DPCD for I2C bit rate capabilities,
+ * and if available, adjust the interval. We could also
+ * be more careful with DP-to-Legacy adapters where a
+ * long legacy cable may force very low I2C bit rates.
+ */
+ if (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
+ DP_DWN_STRM_PORT_PRESENT)
+ usleep_range(500, 600);
+ else
+ usleep_range(300, 400);
continue;
default:
DRM_ERROR("aux_ch invalid native reply 0x%02x\n",