Commit 7ba8fb57 authored by zain wang's avatar zain wang Committed by Andrzej Hajda

drm/bridge: analogix_dp: Don't use fast link training when panel just powered up

Panel would reset its setting when it powers down. It would forget the last
succeeded link training setting. So we can't use the last successful link
training setting to do fast link training. Let's reset fast_train_enable in
analogix_dp_bridge_disable();

Cc: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: default avatarzain wang <wzz@rock-chips.com>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: default avatarArchit Taneja <architt@codeaurora.org>
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180423105003.9004-4-enric.balletbo@collabora.com
parent c2021db1
...@@ -579,14 +579,14 @@ static int analogix_dp_process_equalizer_training(struct analogix_dp_device *dp) ...@@ -579,14 +579,14 @@ static int analogix_dp_process_equalizer_training(struct analogix_dp_device *dp)
if (retval != 1) { if (retval != 1) {
dev_err(dp->dev, "failed to read downspread %d\n", dev_err(dp->dev, "failed to read downspread %d\n",
retval); retval);
dp->fast_train_support = false; dp->fast_train_enable = false;
} else { } else {
dp->fast_train_support = dp->fast_train_enable =
(spread & DP_NO_AUX_HANDSHAKE_LINK_TRAINING) ? (spread & DP_NO_AUX_HANDSHAKE_LINK_TRAINING) ?
true : false; true : false;
} }
dev_dbg(dp->dev, "fast link training %s\n", dev_dbg(dp->dev, "fast link training %s\n",
dp->fast_train_support ? "supported" : "unsupported"); dp->fast_train_enable ? "supported" : "unsupported");
/* set enhanced mode if available */ /* set enhanced mode if available */
analogix_dp_set_enhanced_mode(dp); analogix_dp_set_enhanced_mode(dp);
...@@ -793,7 +793,7 @@ static int analogix_dp_fast_link_train(struct analogix_dp_device *dp) ...@@ -793,7 +793,7 @@ static int analogix_dp_fast_link_train(struct analogix_dp_device *dp)
static int analogix_dp_train_link(struct analogix_dp_device *dp) static int analogix_dp_train_link(struct analogix_dp_device *dp)
{ {
if (dp->fast_train_support) if (dp->fast_train_enable)
return analogix_dp_fast_link_train(dp); return analogix_dp_fast_link_train(dp);
return analogix_dp_full_link_train(dp, dp->video_info.max_lane_count, return analogix_dp_full_link_train(dp, dp->video_info.max_lane_count,
...@@ -1197,6 +1197,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) ...@@ -1197,6 +1197,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
DRM_ERROR("failed to setup the panel ret = %d\n", ret); DRM_ERROR("failed to setup the panel ret = %d\n", ret);
dp->psr_enable = false; dp->psr_enable = false;
dp->fast_train_enable = false;
dp->dpms_mode = DRM_MODE_DPMS_OFF; dp->dpms_mode = DRM_MODE_DPMS_OFF;
} }
......
...@@ -173,7 +173,7 @@ struct analogix_dp_device { ...@@ -173,7 +173,7 @@ struct analogix_dp_device {
int hpd_gpio; int hpd_gpio;
bool force_hpd; bool force_hpd;
bool psr_enable; bool psr_enable;
bool fast_train_support; bool fast_train_enable;
struct mutex panel_lock; struct mutex panel_lock;
bool panel_is_modeset; bool panel_is_modeset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment