Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stephen Boyd and committed by
Dmitry Baryshkov
7bfd3259 b7ba5db9

+3 -28
+3 -22
drivers/gpu/drm/msm/dp/dp_panel.c
··· 43 43 44 44 static int dp_panel_read_dpcd(struct dp_panel *dp_panel) 45 45 { 46 - int rc = 0; 47 - size_t len; 48 - ssize_t rlen; 46 + int rc; 49 47 struct dp_panel_private *panel; 50 48 struct dp_link_info *link_info; 51 49 u8 *dpcd, major, minor; ··· 77 79 if (drm_dp_enhanced_frame_cap(dpcd)) 78 80 link_info->capabilities |= DP_LINK_CAP_ENHANCED_FRAMING; 79 81 80 - dp_panel->dfp_present = dpcd[DP_DOWNSTREAMPORT_PRESENT]; 81 - dp_panel->dfp_present &= DP_DWN_STRM_PORT_PRESENT; 82 - 83 - if (dp_panel->dfp_present && (dpcd[DP_DPCD_REV] > 0x10)) { 84 - dp_panel->ds_port_cnt = dpcd[DP_DOWN_STREAM_PORT_COUNT]; 85 - dp_panel->ds_port_cnt &= DP_PORT_COUNT_MASK; 86 - len = DP_DOWNSTREAM_PORTS * DP_DOWNSTREAM_CAP_SIZE; 87 - 88 - rlen = drm_dp_dpcd_read(panel->aux, 89 - DP_DOWNSTREAM_PORT_0, dp_panel->ds_cap_info, len); 90 - if (rlen < len) { 91 - DRM_ERROR("ds port status failed, rlen=%zd\n", rlen); 92 - rc = -EINVAL; 93 - goto end; 94 - } 95 - } 96 - 97 82 dp_panel_read_psr_cap(panel); 98 - end: 83 + 99 84 return rc; 100 85 } 101 86 ··· 154 173 return -EINVAL; 155 174 } 156 175 157 - if (dp_panel->dfp_present) { 176 + if (drm_dp_is_branch(dp_panel->dpcd)) { 158 177 count = drm_dp_read_sink_count(panel->aux); 159 178 if (!count) { 160 179 DRM_ERROR("no downstream ports connected\n");
-6
drivers/gpu/drm/msm/dp/dp_panel.h
··· 13 13 14 14 struct edid; 15 15 16 - #define DP_DOWNSTREAM_PORTS 4 17 - #define DP_DOWNSTREAM_CAP_SIZE 4 18 - 19 16 struct dp_display_mode { 20 17 struct drm_display_mode drm_mode; 21 18 u32 capabilities; ··· 36 39 struct dp_panel { 37 40 /* dpcd raw data */ 38 41 u8 dpcd[DP_RECEIVER_CAP_SIZE]; 39 - u8 ds_cap_info[DP_DOWNSTREAM_PORTS * DP_DOWNSTREAM_CAP_SIZE]; 40 - u32 ds_port_cnt; 41 - u32 dfp_present; 42 42 43 43 struct dp_link_info link_info; 44 44 struct drm_dp_desc desc;