alistair23-linux/drivers/gpu/drm/i915
Paulo Zanoni 049456416f drm/i915: fix Haswell FDI link training code
This commit makes hsw_fdi_link_train responsible for implementing
everything described in the "Enable and train FDI" section from the
Hawell CRT mode set sequence documentation. We completely rewrite
hsw_fdi_link_train to match the documentation and we also call it in
the right place.

This patch was initially sent as a series of tiny patches fixing every
little problem of the function, but since there were too many patches
fixing the same function it got a little difficult to get the "big
picture" of how the function would be in the end, so here we amended
all the patches into a single big patch fixing the whole function.

Problems we fixed:

  1 - Train Haswell FDI at the right time.

    We need to train the FDI before enabling the pipes and planes, so
    we're moving the call from lpt_pch_enable to haswell_crtc_enable
    directly.

    We are also removing ironlake_fdi_pll_enable since the PLL
    enablement on Haswell is completely different and is also done
    during the link training steps.

  2 - Use the right FDI_RX_CTL register on Haswell

    There is only one PCH transcoder, so it's always _FDI_RXA_CTL.
    Using "pipe" here is wrong.

  3 - Don't rely on DDI_BUF_CTL previous values

    Just set the bits we want, everything else is zero. Also
    POSTING_READ the register before sleeping.

  4 - Program the FDI RX TUSIZE register on hsw_fdi_link_train

    According to the mode set sequence documentation, this is the
    right place. According to the FDI_RX_TUSIZE register description,
    this is the value we should set.

    Also remove the code that sets this register from the old
    location: lpt_pch_enable.

  5 - Properly program FDI_RX_MISC pwrdn lane values on HSW

  6 - Wait only 35us for the FDI link training

    First we wait 30us for the FDI receiver lane calibration, then we
    wait 5us for the FDI auto training time.

  7 - Remove an useless indentation level on hsw_fdi_link_train

    We already "break" when the link training succeeds.

  8 - Disable FDI_RX_ENABLE, not FDI_RX_PLL_ENABLE

    When we fail the training.

  9 - Change Haswell FDI link training error messages

    We shouldn't call DRM_ERROR when still looping through voltage
    levels since this is expected and not really a failure. So in this
    commit we adjust the error path to only DRM_ERROR when we really
    fail after trying everything.

    While at it, replace DRM_DEBUG_DRIVER with DRM_DEBUG_KMS since
    it's what we use everywhere.

  10 - Try each voltage twice at hsw_fdi_link_train

    Now with Daniel Vetter's suggestion to use "/2" instead of ">>1".

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
[danvet: Applied tiny bikesheds:
- mention in comment that we test each voltage/emphasis level twice
- realing arguments of the only untouched reg write, it spilled over
  the 80 char limit ...]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-11 23:51:33 +01:00
..
dvo.h Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
dvo_ch7xxx.c drm/i915/dvo-ch7xxx: fix get_hw_state 2012-10-12 10:59:11 +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/dvo: implement get_hw_state 2012-09-06 07:58:52 +02:00
dvo_ns2501.c drm/i915/dvo: implement get_hw_state 2012-09-06 07:58:52 +02:00
dvo_sil164.c drm/i915/dvo: implement get_hw_state 2012-09-06 07:58:52 +02:00
dvo_tfp410.c drm/i915/dvo: implement get_hw_state 2012-09-06 07:58:52 +02:00
i915_debugfs.c Linux 3.7-rc2 2012-10-22 14:34:51 +02:00
i915_dma.c Linux 3.7-rc2 2012-10-22 14:34:51 +02:00
i915_drv.c drm/i915: check whether the pch is the soulmate of the cpu 2012-11-11 23:51:29 +01:00
i915_drv.h drm/i915: kill pch_init_clock_gating indirection 2012-11-11 23:51:31 +01:00
i915_gem.c Linux 3.7-rc2 2012-10-22 14:34:51 +02:00
i915_gem_context.c Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-next 2012-10-07 21:13:54 +10:00
i915_gem_debug.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
i915_gem_dmabuf.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
i915_gem_evict.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
i915_gem_execbuffer.c Linux 3.7-rc2 2012-10-22 14:34:51 +02:00
i915_gem_gtt.c drm/i915: move more pte encoding to pte encode 2012-11-11 23:51:11 +01:00
i915_gem_stolen.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
i915_gem_tiling.c Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-next 2012-10-07 21:13:54 +10:00
i915_ioc32.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
i915_irq.c drm/i915: convert pipe timing definitions to transcoder 2012-10-26 10:24:49 +02:00
i915_reg.h drm/i915: fix Haswell FDI link training code 2012-11-11 23:51:33 +01:00
i915_suspend.c Linux 3.7-rc2 2012-10-22 14:34:51 +02:00
i915_sysfs.c drm/i915: Fix !CONFIG_PM sysfs for real this time 2012-09-20 14:23:11 +02:00
i915_trace.h drm/i915: Allow DRM_ROOT_ONLY|DRM_MASTER to submit privileged batchbuffers 2012-10-17 21:06:59 +02:00
i915_trace_points.c drm/i915: [sparse] trivial sparse fixes 2012-04-18 10:34:49 +02:00
intel_acpi.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
intel_bios.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
intel_bios.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
intel_crt.c drm/i915: use intel_ddi_get_hw_state on CRT encoder too 2012-11-11 23:51:16 +01:00
intel_ddi.c drm/i915: fix Haswell FDI link training code 2012-11-11 23:51:33 +01:00
intel_display.c drm/i915: fix Haswell FDI link training code 2012-11-11 23:51:33 +01:00
intel_dp.c drm/i915: create the DDI encoder 2012-11-11 23:51:08 +01:00
intel_drv.h drm/i915: create the DDI encoder 2012-11-11 23:51:08 +01:00
intel_dvo.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
intel_fb.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
intel_hdmi.c drm/i915: create the DDI encoder 2012-11-11 23:51:08 +01:00
intel_i2c.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
intel_lvds.c drm/i915/lvds: move fitting mode from intel_lvds_connector to intel_panel 2012-10-26 20:50:57 +02:00
intel_modes.c drm/i915: Do not free the passed EDID in intel_connector_update_modes() 2012-10-22 19:33:46 +02:00
intel_opregion.c Linux 3.7-rc2 2012-10-22 14:34:51 +02:00
intel_overlay.c Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes 2012-10-16 10:11:59 +10:00
intel_panel.c drm/i915: Move the fixed mode to intel_panel 2012-10-22 19:01:49 +02:00
intel_pm.c drm/i915: kill pch_init_clock_gating indirection 2012-11-11 23:51:31 +01:00
intel_ringbuffer.c drm/i915/ringbuffer: exclude last 2 cachelines on 845g on all callpaths 2012-11-11 23:51:09 +01:00
intel_ringbuffer.h drm/i915: Allow DRM_ROOT_ONLY|DRM_MASTER to submit privileged batchbuffers 2012-10-17 21:06:59 +02:00
intel_sdvo.c drm/i915/sdvo: restore i2c adapter config on intel_sdvo_init() failures 2012-10-26 10:26:43 +02:00
intel_sdvo_regs.h drm/i915: properly handle interlaced bit for sdvo dtd conversion 2012-05-24 17:53:52 +02:00
intel_sprite.c drm/i915: Bad pixel formats can't reach the sprite code 2012-11-11 23:51:14 +01:00
intel_tv.c drm/i915/tv: Use intel_flush_display_plane() to flush the primary plane 2012-11-11 23:51:00 +01:00
Makefile drm/i915: Support for ns2501-DVO 2012-07-25 18:23:48 +02:00