• Manasi Navare's avatar
    drm/i915: Implement Link Rate fallback on Link training failure · 9301397a
    Manasi Navare authored
    If link training at a link rate optimal for a particular
    mode fails during modeset's atomic commit phase, then we
    let the modeset complete and then retry. We save the link rate
    value at which link training failed, update the link status property
    to "BAD" and use a lower link rate to prune the modes. It will redo
    the modeset on the current mode at lower link rate or if the current
    mode gets pruned due to lower link constraints then, it will send a
    hotplug uevent for userspace to handle it.
    
    This is also required to pass DP CTS tests 4.3.1.3, 4.3.1.4,
    4.3.1.6.
    
    This patch is a resend of the original commit id (233ce881
    "drm/i915: Implement Link Rate fallback on Link training failure")
    which got reverted in this commit id (afc1ebf4 Revert
    "drm/i915: Implement Link Rate fallback on Link training failure")
    due to CI failures.
    
    After investigating the CI failures it was found that these
    were essentially the failures which were always there but hidden because
    they used to be DRM_DEBUG_KMS messages for link failures so never got
    caught by CI. But now this patch actually throws DRM_ERROR if the link
    training fails at RBR and 1 lane. So it caught these link train failures.
    
    There were two failures:
    1. On SKL 6700k this was because the machine in CI lab is a SKL desktop
    without eDP on Port A. But our VBT initialization code in the driver writes
    VBT defaults in a way that it always sets DP flag on Port A and this does
    not get cleared after parsing the VBT outputs. This has been fixed in
    commit id (bb1d1329 "drm/i915/vbt: split out defaults that are set
    when there is no VBT) and (66578857 "drm/i915/vbt: don't propagate
    errors from intel_bios_init())
    
    2. On ILK-650 desktop - This was happening because of a bad monitor desktop
    combination. I switched the monitor in the CI lab and that helped get rid
    of the link failures on ILK system.
    
    v10:
    * Rebase on drm-tip and resend after revert
    v9:
    * Use the trimmed max values of link rate/lane count based on
    link train fallback (Daniel Vetter)
    v8:
    * Set link_status to BAD first and then call mode_valid (Jani Nikula)
    v7:
    Remove the redundant variable in previous patch itself
    v6:
    * Obtain link rate index from fallback_link_rate using
    the helper intel_dp_link_rate_index (Jani Nikula)
    * Include fallback within intel_dp_start_link_train (Jani Nikula)
    v5:
    * Move set link status to drm core (Daniel Vetter, Jani Nikula)
    v4:
    * Add fallback support for non DDI platforms too
    * Set connector->link status inside set_link_status function
    (Jani Nikula)
    v3:
    * Set link status property to BAd unconditionally (Jani Nikula)
    * Dont use two separate variables link_train_failed and link_status
    to indicate same thing (Jani Nikula)
    v2:
    * Squashed a few patches (Jani Nikula)
    Acked-by: default avatarTony Cheng <tony.cheng@amd.com>
    Acked-by: default avatarHarry Wentland <Harry.wentland@amd.com>
    Cc: Jani Nikula <jani.nikula@linux.intel.com>
    Cc: Daniel Vetter <daniel.vetter@intel.com>
    Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
    Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
    Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
    Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
    Link: http://patchwork.freedesktop.org/patch/msgid/16ca48b1e74c618929245e9a085b9e3483c3a16d.1491485983.git.jani.nikula@intel.com
    9301397a
intel_dp.c 172 KB