linux/drivers/gpu/drm/i915
Jani Nikula 10e6cc7bfe drm/i915: Fix DDC probe for passive adapters
commit 3f5f1554ee upstream.

Passive DP->DVI/HDMI dongles on DP++ ports show up to the system as HDMI
devices, as they do not have a sink device in them to respond to any AUX
traffic. When probing these dongles over the DDC, sometimes they will
NAK the first attempt even though the transaction is valid and they
support the DDC protocol. The retry loop inside of
drm_do_probe_ddc_edid() would normally catch this case and try the
transaction again, resulting in success.

That, however, was thwarted by the fix for [1]:

commit 9292f37e1f
Author: Eugeni Dodonov <eugeni.dodonov@intel.com>
Date:   Thu Jan 5 09:34:28 2012 -0200

    drm: give up on edid retries when i2c bus is not responding

This added code to exit immediately if the return code from the
i2c_transfer function was -ENXIO in order to reduce the amount of time
spent in waiting for unresponsive or disconnected devices. That was
possible because the underlying i2c bit banging algorithm had retries of
its own (which, of course, were part of the reason for the bug the
commit fixes).

Since its introduction in

commit f899fc64cd
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jul 20 15:44:45 2010 -0700

    drm/i915: use GMBUS to manage i2c links

we've been flipping back and forth enabling the GMBUS transfers, but
we've settled since then. The GMBUS implementation does not do any
retries, however, bailing out of the drm_do_probe_ddc_edid() retry loop
on first encounter of -ENXIO. This, combined with Eugeni's commit, broke
the retry on -ENXIO.

Retry GMBUS once on -ENXIO on first message to mitigate the issues with
passive adapters.

This patch is based on the work, and commit message, by Todd Previte
<tprevite@gmail.com>.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=41059

v2: Don't retry if using bit banging.

v3: Move retry within gmbux_xfer, retry only on first message.

v4: Initialize GMBUS0 on retry (Ville).

v5: Take index reads into account (Ville).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85924
Cc: Todd Previte <tprevite@gmail.com>
Tested-by: Oliver Grafe <oliver.grafe@ge.com> (v2)
Tested-by: Jim Bride <jim.bride@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-06-30 17:15:22 +01:00
..
dvo.h drm/i915: Remove unused mode_fixup() vfunc of struct intel_dvo_dev_ops 2013-09-05 21:39:59 +02:00
dvo_ch7xxx.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
dvo_ch7017.c drm/i915/dvo: implement get_hw_state 2012-09-06 07:58:52 +02:00
dvo_ivch.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
dvo_ns2501.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
dvo_sil164.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
dvo_tfp410.c drm/i915: Remove spurious semicolons 2014-04-09 21:54:33 +02:00
i915_cmd_parser.c drm/i915: Don't leak command parser tables on suspend/resume 2014-10-05 13:40:55 -07:00
i915_debugfs.c drm/i915: Hold the table lock whilst walking the file's idr and counting the objects in debugfs 2014-06-24 15:00:48 +03:00
i915_dma.c drm/i915: Kick fbdev before vgacon 2014-12-01 10:02:14 +00:00
i915_drv.c drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg 2015-05-06 10:36:21 +01:00
i915_drv.h drm/i915/vlv: save/restore the power context base reg 2015-04-27 16:16:35 +01:00
i915_gem.c drm/i915: Only fence tiled region of object. 2015-02-04 10:58:14 +00:00
i915_gem_context.c drm/i915: Only mark the ctx as initialised after a SET_CONTEXT operation 2014-06-24 14:48:41 +03:00
i915_gem_debug.c drm/i915: prefer struct drm_i915_private to drm_i915_private_t 2014-03-31 15:34:21 +02:00
i915_gem_dmabuf.c drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl 2014-05-16 19:31:29 +02:00
i915_gem_evict.c drm/i915: Prevent negative relocation deltas from wrapping 2014-05-27 11:18:40 +03:00
i915_gem_execbuffer.c Merge commit '9e9a928eed' into drm-next 2014-06-05 20:28:59 +10:00
i915_gem_gtt.c drm/i915: Disable caches for Global GTT. 2014-11-27 11:21:35 +00:00
i915_gem_gtt.h drm/i915: s/i915_hw_context/intel_context 2014-05-22 23:41:17 +02:00
i915_gem_render_state.c drm/i915: fix freeze with blank screen booting highmem 2014-07-22 08:10:36 +02:00
i915_gem_stolen.c drm/i915: Don't complain about stolen conflicts on gen3 2015-01-15 10:43:48 +00:00
i915_gem_tiling.c drm/i915: Check obj->vma_list under the struct_mutex 2015-03-18 09:58:59 +00:00
i915_gem_userptr.c drm/i915: Do not leak pages when freeing userptr objects 2014-11-17 14:11:48 +00:00
i915_gpu_error.c drm/i95: Initialize active ring->pid to -1 2014-06-11 11:06:43 +03:00
i915_ioc32.c drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
i915_irq.c drm/i915: Dont enable CS_PARSER_ERROR interrupts at all 2015-05-06 10:24:22 +01:00
i915_params.c drm/i915: Add debug module option for VTd validation 2014-04-03 11:23:11 +02:00
i915_reg.h drm/i915: cope with large i2c transfers 2015-05-06 10:36:21 +01:00
i915_suspend.c drm/i915: save/restore GMBUS freq across suspend/resume on gen4 2015-01-15 10:43:56 +00:00
i915_sysfs.c drm/i915: s/i915_hw_context/intel_context 2014-05-22 23:41:17 +02:00
i915_trace.h drm/i915: s/intel_ring_buffer/intel_engine_cs 2014-05-22 23:01:05 +02:00
i915_trace_points.c drm/i915: [sparse] trivial sparse fixes 2012-04-18 10:34:49 +02:00
i915_ums.c drm/i915: Only restore backlight combination mode reg for ums 2014-01-24 17:22:45 +01:00
intel_acpi.c Merge branch 'acpi-dsm' 2014-01-12 23:45:52 +01:00
intel_bios.c drm/i915: Remove bogus __init annotation from DMI callbacks 2014-10-05 13:40:55 -07:00
intel_bios.h drm/i915: Detect if MIPI panel based on VBT and initialize only if present 2014-06-05 08:52:33 +02:00
intel_crt.c drm/i915: Remove bogus __init annotation from DMI callbacks 2014-10-05 13:40:55 -07:00
intel_ddi.c drm/i915: grab the audio power domain when enabling audio on HSW+ 2014-05-22 15:06:33 +02:00
intel_display.c drm/i915: Dell Chromebook 11 has PWM backlight 2015-03-18 09:58:48 +00:00
intel_dp.c drm/i915/hsw: Fix workaround for server AUX channel clock divisor 2015-06-11 11:24:58 +01:00
intel_drv.h drm/i915: Fix locking for intel_enable_pipe_a() 2014-10-05 13:40:54 -07:00
intel_dsi.c drm/i915/vlv: Update the DSI ULPS entry/exit sequence 2014-07-09 09:52:04 +02:00
intel_dsi.h drm/i915: Add support for Generic MIPI panel driver 2014-06-05 08:52:32 +02:00
intel_dsi_cmd.c drm/i915/vlv: DPI FIFO empty check is not needed 2014-07-09 09:51:53 +02:00
intel_dsi_cmd.h drm/i915: Send DPI command explicitely in LP mode 2014-04-09 21:54:30 +02:00
intel_dsi_panel_vbt.c drm/i915: Add support for Generic MIPI panel driver 2014-06-05 08:52:32 +02:00
intel_dsi_pll.c drm/i915: Try harder to get best m, n, p values with minimal error 2013-12-11 23:52:18 +01:00
intel_dvo.c drm/i915: replace drm_get_connector_name() with direct name field use 2014-06-04 13:14:37 +10:00
intel_fbdev.c Merge commit '9e9a928eed' into drm-next 2014-06-05 20:28:59 +10:00
intel_hdmi.c drm/i915/hdmi: fix hdmi audio state readout 2014-10-05 13:40:55 -07:00
intel_i2c.c drm/i915: Fix DDC probe for passive adapters 2015-06-30 17:15:22 +01:00
intel_lvds.c drm/i915: Assume dual channel LVDS if pixel clock necessitates it 2015-06-16 16:01:47 +01:00
intel_modes.c drm/i915: Add "Automatic" mode for the "Broadcast RGB" property 2013-01-20 13:09:44 +01:00
intel_opregion.c ACPI / i915: Update the condition to ignore firmware backlight change request 2014-10-09 12:23:48 -07:00
intel_overlay.c Merge commit '9e9a928eed' into drm-next 2014-06-05 20:28:59 +10:00
intel_panel.c drm/i915: don't warn if backlight unexpectedly enabled 2014-12-30 23:28:37 +00:00
intel_pm.c drm/i915: drop WaSetupGtModeTdRowDispatch:snb 2014-12-01 10:02:14 +00:00
intel_renderstate.h drm/i915: add render state initialization 2014-05-14 19:16:13 +02:00
intel_renderstate_gen6.c drm/i915: add null render states for gen6, gen7 and gen8 2014-05-14 19:17:08 +02:00
intel_renderstate_gen7.c drm/i915: add null render states for gen6, gen7 and gen8 2014-05-14 19:17:08 +02:00
intel_renderstate_gen8.c drm/i915: add null render states for gen6, gen7 and gen8 2014-05-14 19:17:08 +02:00
intel_ringbuffer.c drm/i915: Evict CS TLBs between batches 2015-01-23 12:17:58 +00:00
intel_ringbuffer.h drm/i915: Reorder semaphore deadlock check 2014-06-11 11:06:43 +03:00
intel_sdvo.c drm/i915: Avoid div-by-zero when pixel_multiplier is zero 2014-06-11 11:06:43 +03:00
intel_sdvo_regs.h drm/i915: use __packed instead of __attribute__((packed)) 2013-12-03 18:19:49 +01:00
intel_sideband.c drm/i915: Correct the IOSF Dev_FN field for IOSF transfers 2015-03-02 13:17:10 +00:00
intel_sprite.c drm/i915: Wait for vblank after enabling the primary plane on BDW 2014-06-27 17:36:11 +03:00
intel_tv.c drm/i915: Wait for vblank before enabling the TV encoder 2014-10-05 13:40:55 -07:00
intel_uncore.c drm/i915: Only warn the first time we attempt to mmio whilst suspended 2015-01-12 15:44:16 +00:00
Kconfig drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl 2014-05-16 19:31:29 +02:00
Makefile drm/i915: Add support for Generic MIPI panel driver 2014-06-05 08:52:32 +02:00