Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues: - [High] mtk_dp_bridge_mode_valid() uses the SoC's absolute maximum link rate for mode validation instead of the negotiated limit, leading to unsupportable display modes being accepted. -- --- Patch [8]: [PATCH v3 08/11] drm/mediatek: mtk_dp: Move max link rate to SoC specific data --- commit 47b5711a6d2bc56c41f2725702c27dbf19ea9ba4 Author: AngeloGioacchino Del Regno <[email protected]> drm/mediatek: mtk_dp: Move max link rate to SoC specific data This patch moves the maximum link rate to SoC specific data instead of statically assigning it. This is in preparation for adding support for the MT8196 eDP IP which supports a higher maximum link rate. > diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c > b/drivers/gpu/drm/mediatek/mtk_dp.c > index cabfc833c0a80..ea90462b26f5e 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dp.c > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c [ ... ] > @@ -1469,7 +1470,7 @@ static void mtk_dp_initialize_priv_data(struct mtk_dp > *mtk_dp) > { > bool plugged_in = (mtk_dp->bridge.type == DRM_MODE_CONNECTOR_eDP); > > - mtk_dp->train_info.link_rate = DP_LINK_BW_5_4; > + mtk_dp->train_info.link_rate = mtk_dp->data->hw_max_link_rate; [Severity: High] This is a pre-existing issue, but does setting mtk_dp->train_info.link_rate to the SoC's absolute maximum bypass the board-level and sink limits during mode validation? In mtk_dp_bridge_mode_valid(), the available bandwidth is calculated using the unbounded mtk_dp->train_info.link_rate: u32 rate = drm_dp_bw_code_to_link_rate(mtk_dp->train_info.link_rate) * lane_count_min; Since mtk_dp_parse_capabilities() parses the sink's DPCD capabilities into rx_cap but doesn't update train_info.link_rate, this bandwidth calculation appears to ignore both the board-level limit (mtk_dp->max_linkrate) and the sink's negotiated limit (rx_cap). Because the actual link training will cap the rate to the limits, could this cause mtk_dp_bridge_mode_valid() to erroneously accept unsupportable high-bandwidth modes, resulting in display corruption or black screens when those modes are sent over a lower-bandwidth trained link? -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=8
