summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/dp/dp_panel.c
diff options
context:
space:
mode:
authorKuogee Hsieh <khsieh@codeaurora.org>2020-12-18 18:53:40 +0100
committerRob Clark <robdclark@chromium.org>2021-01-07 18:11:02 +0100
commit2b5f09cadfc576817c0450e01d454f750909b103 (patch)
tree67f762e91b38d0c4ff9bd2c22238e611661ddf2d /drivers/gpu/drm/msm/dp/dp_panel.c
parentdrm/msm: Ensure get_pages is called when locked (diff)
downloadlinux-2b5f09cadfc576817c0450e01d454f750909b103.tar.xz
linux-2b5f09cadfc576817c0450e01d454f750909b103.zip
drm/msm/dp: postpone irq_hpd event during connection pending state
irq_hpd event can only be executed at connected state. Therefore irq_hpd event should be postponed if it happened at connection pending state. This patch also make sure both link rate and lane are valid before start link training. Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org> Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/dp/dp_panel.c')
-rw-r--r--drivers/gpu/drm/msm/dp/dp_panel.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
index 97dca3e378b7..d1780bcac8cc 100644
--- a/drivers/gpu/drm/msm/dp/dp_panel.c
+++ b/drivers/gpu/drm/msm/dp/dp_panel.c
@@ -167,12 +167,18 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
rc = dp_panel_read_dpcd(dp_panel);
+ if (rc) {
+ DRM_ERROR("read dpcd failed %d\n", rc);
+ return rc;
+ }
+
bw_code = drm_dp_link_rate_to_bw_code(dp_panel->link_info.rate);
- if (rc || !is_link_rate_valid(bw_code) ||
+ if (!is_link_rate_valid(bw_code) ||
!is_lane_count_valid(dp_panel->link_info.num_lanes) ||
(bw_code > dp_panel->max_bw_code)) {
- DRM_ERROR("read dpcd failed %d\n", rc);
- return rc;
+ DRM_ERROR("Illegal link rate=%d lane=%d\n", dp_panel->link_info.rate,
+ dp_panel->link_info.num_lanes);
+ return -EINVAL;
}
if (dp_panel->dfp_present) {