linux/drivers/gpu/drm/i915
David Flynn 8316f33766 drm/i915/dp: Fix I2C/EDID handling with active DisplayPort to DVI converter
The DisplayPort standard (1.1a) states that:
  The I2C-over-AUX Reply field is valid only when Native AUX CH Reply
  field is AUX_ACK (00). When Native AUX CH Reply field is not 00, then,
  I2C-over-AUX Reply field must be 00 and be ignored.

This fixes broken EDID reading when using an active DisplayPort to
duallink DVI converter.  If the AUX CH replier chooses to defer the
transaction, a short read occurs and erroneous data is returned as
the i2c reply due to a lack of length checking and failure to check
for AUX ACK.

As a result, broken EDIDs can look like:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: bc bc bc ff bc bc bc ff bc bc bc ac bc bc bc 45    ???.???.???????E
10: bc bc bc 10 bc bc bc 34 bc bc bc ee bc bc bc 4c    ???????4???????L
20: bc bc bc 50 bc bc bc 00 bc bc bc 40 bc bc bc 00    ???P???.???@???.
30: bc bc bc 01 bc bc bc 01 bc bc bc a0 bc bc bc 40    ???????????????@
40: bc bc bc 00 bc bc bc 00 bc bc bc 00 bc bc bc 55    ???.???.???.???U
50: bc bc bc 35 bc bc bc 31 bc bc bc 20 bc bc bc fc    ???5???1??? ????
60: bc bc bc 4c bc bc bc 34 bc bc bc 46 bc bc bc 00    ???L???4???F???.
70: bc bc bc 38 bc bc bc 11 bc bc bc 20 bc bc bc 20    ???8??????? ???
80: bc bc bc ff bc bc bc ff bc bc bc ff bc bc bc ff    ???.???.???.???.
...

which can lead to:
[drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder
[drm:drm_edid_block_valid] *ERROR* Raw EDID:
<3>30 30 30 30 30 30 30 32 38 32 30 32 63 63 31 61  000000028202cc1a
<3>28 00 02 8c 00 00 00 00 18 00 00 00 00 00 00 00  (...............
<3>20 4c 61 73 74 20 62 65 61 63 6f 6e 3a 20 33 32   Last beacon: 32
<3>32 30 6d 73 20 61 67 6f 46 00 05 8c 00 00 00 00  20ms agoF.......
<3>36 00 00 00 00 00 00 00 00 0c 57 69 2d 46 69 20  6.........Wi-Fi
<3>52 6f 75 74 65 72 01 08 82 84 8b 96 24 30 48 6c  Router......$0Hl
<3>03 01 01 06 02 00 00 2a 01 00 2f 01 00 32 04 0c  .......*../..2..
<3>12 18 60 dd 09 00 10 18 02 00 00 01 00 00 18 00  ..`.............

Signed-off-by: David Flynn <davidf@rd.bbc.co.uk>
[ickle: fix up some surrounding checkpatch warnings]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
2010-12-08 19:40:08 +00:00
..
dvo.h drm/i915: Subclass intel_encoder. 2010-08-09 11:24:28 -07:00
dvo_ch7xxx.c drm/i915: use GMBUS to manage i2c links 2010-09-18 15:46:19 +01:00
dvo_ch7017.c drm/i915: Tidy dvo_ch7017 and print out which chip we detect 2010-09-28 23:33:17 +01:00
dvo_ivch.c drm/i915: use GMBUS to manage i2c links 2010-09-18 15:46:19 +01:00
dvo_sil164.c drm/i915: use GMBUS to manage i2c links 2010-09-18 15:46:19 +01:00
dvo_tfp410.c drm/i915: use GMBUS to manage i2c links 2010-09-18 15:46:19 +01:00
i915_debugfs.c Merge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2010-10-26 18:57:59 -07:00
i915_dma.c drm/i915: announce to userspace that the bsd ring is coherent 2010-12-05 10:40:39 +00:00
i915_drv.c drm/i915: Disable FBC on Ironlake to save 1W 2010-11-19 09:36:21 +00:00
i915_drv.h drm/i915: Retire any pending operations on the old scanout when switching 2010-11-13 09:49:11 +00:00
i915_gem.c drm/i915: Emit a request to clear a flushed and idle ring for unbusy bo 2010-12-07 10:59:14 +00:00
i915_gem_debug.c drm/i915/debug: Convert i915_verify_active() to scan all lists 2010-09-30 09:30:11 +01:00
i915_gem_evict.c drm/i915: Flush read-only buffers from the active list upon idle as well 2010-10-28 21:31:19 +01:00
i915_gem_tiling.c drm/i915: IS_IRONLAKE is synonymous with gen == 5 2010-10-21 19:08:39 +01:00
i915_ioc32.c drm: convert drm_ioctl to unlocked_ioctl 2009-12-18 11:22:31 +10:00
i915_irq.c Merge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2010-10-26 18:57:59 -07:00
i915_mem.c drm: Remove memory debugging infrastructure. 2009-06-18 13:00:33 -07:00
i915_reg.h drm/i915: Always set the DP transcoder config to 8BPC. 2010-12-02 22:31:20 +00:00
i915_suspend.c drm/i915: Only save/restore cursor regs if !KMS 2010-11-21 09:56:00 +00:00
i915_trace.h drm/i915: add tracepoints for flip requests & completions 2010-07-02 14:04:14 +10:00
i915_trace_points.c drm/i915: Add tracepoints 2009-09-23 01:05:21 +01:00
intel_acpi.c drm/i915: i915 cannot provide switcher services. 2010-12-08 15:40:44 +10:00
intel_bios.c drm/i915: IS_IRONLAKE is synonymous with gen == 5 2010-10-21 19:08:39 +01:00
intel_bios.h drm/i915: Initialize panel timing registers if VBIOS did not 2010-10-19 09:17:24 +01:00
intel_crt.c drm/i915: Take advantage of auto-polling CRT hotplug detection on PCH hardware 2010-11-19 09:30:28 +00:00
intel_display.c drm/i915: Factor in pixel-repeat in FDI M/N calculation 2010-12-04 13:41:04 +00:00
intel_dp.c drm/i915/dp: Fix I2C/EDID handling with active DisplayPort to DVI converter 2010-12-08 19:40:08 +00:00
intel_drv.h drm/i915: Clear pfit registers when not used by any outputs 2010-11-29 18:45:01 +00:00
intel_dvo.c drm/i915/dvo: Fix panel and DDC i2c pins 2010-09-28 23:34:44 +01:00
intel_fb.c Merge remote branch 'airlied/drm-core-next' into tmp 2010-10-19 09:14:50 +01:00
intel_hdmi.c i915: enable AVI infoframe for intel_hdmi.c [v4] 2010-10-22 09:14:30 +01:00
intel_i2c.c drm/i915: Fix I2C adapter registration 2010-11-09 23:04:52 +00:00
intel_lvds.c drm/i915/lvds: Always restore panel-fitter when enabling the LVDS 2010-12-05 23:01:06 +00:00
intel_modes.c drm/i915: use GMBUS to manage i2c links 2010-09-18 15:46:19 +01:00
intel_opregion.c drm/i915: opregion_setup: iounmap correct address 2010-11-01 10:29:12 +00:00
intel_overlay.c i915: signedness bug in check_overlay_src() 2010-10-27 22:57:59 +01:00
intel_panel.c drm/i915: INTEL_INFO->gen supercedes i8xx, i9xx, i965g 2010-09-21 11:19:45 +01:00
intel_ringbuffer.c drm/i915/ringbuffer: Only print an error on the second attempt to reset head 2010-12-05 23:01:05 +00:00
intel_ringbuffer.h drm/i915: SNB BLT workaround 2010-11-02 10:48:48 +00:00
intel_sdvo.c drm/i915/sdvo: Always add a 30ms delay to make SDVO TV detection reliable 2010-11-24 17:37:17 +00:00
intel_sdvo_regs.h drm/i915/sdvo: Add missing TV filters 2010-08-09 11:24:29 -07:00
intel_tv.c Merge branch 'drm-intel-fixes' into drm-intel-next 2010-10-03 10:56:11 +01:00
Makefile drm/i915: add _DSM support 2010-10-08 10:27:43 +01:00