diff options
author | Stephen Boyd <swboyd@chromium.org> | 2023-08-29 21:47:28 +0300 |
---|---|---|
committer | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2023-10-09 12:17:46 +0300 |
commit | 7bfd3259b1fc43b970b8a0761302a9140b71d815 (patch) | |
tree | 88cd28ed1f22797d7d0a35da9555563a665aa6dd /drivers/gpu/drm/msm/dp | |
parent | b7ba5db9c863a9981202862673bf6b13f2765021 (diff) | |
download | linux-7bfd3259b1fc43b970b8a0761302a9140b71d815.tar.xz |
drm/msm/dp: Remove dead code related to downstream cap info
We read the downstream port count and capability info but never use it
anywhere. Remove 'ds_port_cnt' and 'ds_cap_info' and any associated code
from this driver. Fold the check for 'dfp_present' into a call to
drm_dp_is_branch() at the one place it is used to get rid of any member
storage related to downstream ports.
Cc: Vinod Polimera <quic_vpolimer@quicinc.com>
Cc: Kuogee Hsieh <quic_khsieh@quicinc.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/554984/
Link: https://lore.kernel.org/r/20230829184735.2841739-4-swboyd@chromium.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/msm/dp')
-rw-r--r-- | drivers/gpu/drm/msm/dp/dp_panel.c | 25 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/dp/dp_panel.h | 6 |
2 files changed, 3 insertions, 28 deletions
diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c index a0523b18b9e9..9fb4e963fefb 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.c +++ b/drivers/gpu/drm/msm/dp/dp_panel.c @@ -43,9 +43,7 @@ static void dp_panel_read_psr_cap(struct dp_panel_private *panel) static int dp_panel_read_dpcd(struct dp_panel *dp_panel) { - int rc = 0; - size_t len; - ssize_t rlen; + int rc; struct dp_panel_private *panel; struct dp_link_info *link_info; u8 *dpcd, major, minor; @@ -79,25 +77,8 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel) if (drm_dp_enhanced_frame_cap(dpcd)) link_info->capabilities |= DP_LINK_CAP_ENHANCED_FRAMING; - dp_panel->dfp_present = dpcd[DP_DOWNSTREAMPORT_PRESENT]; - dp_panel->dfp_present &= DP_DWN_STRM_PORT_PRESENT; - - if (dp_panel->dfp_present && (dpcd[DP_DPCD_REV] > 0x10)) { - dp_panel->ds_port_cnt = dpcd[DP_DOWN_STREAM_PORT_COUNT]; - dp_panel->ds_port_cnt &= DP_PORT_COUNT_MASK; - len = DP_DOWNSTREAM_PORTS * DP_DOWNSTREAM_CAP_SIZE; - - rlen = drm_dp_dpcd_read(panel->aux, - DP_DOWNSTREAM_PORT_0, dp_panel->ds_cap_info, len); - if (rlen < len) { - DRM_ERROR("ds port status failed, rlen=%zd\n", rlen); - rc = -EINVAL; - goto end; - } - } - dp_panel_read_psr_cap(panel); -end: + return rc; } @@ -173,7 +154,7 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel, return -EINVAL; } - if (dp_panel->dfp_present) { + if (drm_dp_is_branch(dp_panel->dpcd)) { count = drm_dp_read_sink_count(panel->aux); if (!count) { DRM_ERROR("no downstream ports connected\n"); diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h index 6d733480a62d..3cb1f8dcfd3b 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.h +++ b/drivers/gpu/drm/msm/dp/dp_panel.h @@ -13,9 +13,6 @@ struct edid; -#define DP_DOWNSTREAM_PORTS 4 -#define DP_DOWNSTREAM_CAP_SIZE 4 - struct dp_display_mode { struct drm_display_mode drm_mode; u32 capabilities; @@ -39,9 +36,6 @@ struct dp_panel_psr { struct dp_panel { /* dpcd raw data */ u8 dpcd[DP_RECEIVER_CAP_SIZE]; - u8 ds_cap_info[DP_DOWNSTREAM_PORTS * DP_DOWNSTREAM_CAP_SIZE]; - u32 ds_port_cnt; - u32 dfp_present; struct dp_link_info link_info; struct drm_dp_desc desc; |