From 0f7bb8f4d26abbc27e78e633b44cac2279f0ce1e Mon Sep 17 00:00:00 2001 From: Cristian Ciocaltea Date: Tue, 1 Sep 2026 21:50:44 +0300 Subject: [PATCH] drm/display: hdmi-state-helper: Add source TMDS rate validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Validate the computed TMDS character rate against connector->hdmi.max_tmds_char_rate, when provided by the driver/source. This gives HDMI connectors common support for rejecting modes whose TMDS character rate exceeds the source supported limit, while still allowing drivers with custom validation requirements to implement their own tmds_char_rate_valid() callback. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Reviewed-by: Maxime Ripard Tested-by: Igor Paunovic # RK3588 Orange Pi 5 Plus, dual HDMI Tested-by: Robin Räber Link: https://patch.msgid.link/20260901-dw-hdmi-qp-scramb-v11-20-bc12954a0688@collabora.com Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index bccc5d7c8eed..3ef6de31dc02 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -562,6 +562,10 @@ hdmi_clock_valid(const struct drm_connector *connector, if (info->max_tmds_clock && clock > info->max_tmds_clock * 1000) return MODE_CLOCK_HIGH; + if (connector->hdmi.max_tmds_char_rate && + clock > connector->hdmi.max_tmds_char_rate) + return MODE_CLOCK_HIGH; + if (funcs && funcs->tmds_char_rate_valid) { enum drm_mode_status status;