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

drm/hisilicon/hibmc: fix rare monitors cannot display problem

In some case, the dp link training success at 8.1Gbps, but the sink's
maximum supported rate is less than 8.1G. So change the default 8.1Gbps
link rate to the rate that reads from devices' capabilities.

Fixes: 54063d86e036 ("drm/hisilicon/hibmc: add dp link moduel in hibmc drivers")
Signed-off-by: Baihan Li <libaihan@huawei.com>
Signed-off-by: Yongbang Shi <shiyongbang@huawei.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250813094238.3722345-6-shiyongbang@huawei.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

authored by

Baihan Li and committed by
Dmitry Baryshkov
9f98b429 93a08f85

+12 -2
+12 -2
drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.c
··· 325 325 return hibmc_dp_link_reduce_rate(dp); 326 326 } 327 327 328 + static void hibmc_dp_update_caps(struct hibmc_dp_dev *dp) 329 + { 330 + dp->link.cap.link_rate = dp->dpcd[DP_MAX_LINK_RATE]; 331 + if (dp->link.cap.link_rate > DP_LINK_BW_8_1 || !dp->link.cap.link_rate) 332 + dp->link.cap.link_rate = DP_LINK_BW_8_1; 333 + 334 + dp->link.cap.lanes = dp->dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK; 335 + if (dp->link.cap.lanes > HIBMC_DP_LANE_NUM_MAX) 336 + dp->link.cap.lanes = HIBMC_DP_LANE_NUM_MAX; 337 + } 338 + 328 339 int hibmc_dp_link_training(struct hibmc_dp_dev *dp) 329 340 { 330 341 struct hibmc_dp_link *link = &dp->link; ··· 345 334 if (ret) 346 335 drm_err(dp->dev, "dp aux read dpcd failed, ret: %d\n", ret); 347 336 348 - dp->link.cap.link_rate = dp->dpcd[DP_MAX_LINK_RATE]; 349 - dp->link.cap.lanes = 0x2; 337 + hibmc_dp_update_caps(dp); 350 338 351 339 ret = hibmc_dp_get_serdes_rate_cfg(dp); 352 340 if (ret < 0)