From f57c2198380fcf475404c159c784d0ee70fa091b Mon Sep 17 00:00:00 2001 From: Cristian Ciocaltea Date: Tue, 1 Sep 2026 21:50:33 +0300 Subject: drm/display: scdc-helper: Add helper to set SCDC version information MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The HDMI 2.x specs mandate that compliant Sink devices report their SCDC version in the Sink Version register, which reads as 1 on any SCDC-capable sink. There is also a dedicated Source Version register. Writing it is not compulsory, but the spec advises that compliant Source devices do so, in which case the value must be 1. Add drm_scdc_set_source_version() to follow this recommendation. The Sink Version register is read first, both to log the advertised SCDC version and to guard against non-conformant devices: a sink reporting version 0 is either not SCDC-version-aware or broken, so writing the source version gains nothing and risks upsetting such hardware. In that case the write is skipped. The source version is passed as a parameter rather than hardcoded, as future spec revisions may define additional rules for the allowable version values. The written value is additionally clamped to the sink's reported version so the source never advertises a version the sink does not understand. Acked-by: Maxime Ripard Reviewed-by: Dmitry Baryshkov Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B 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-9-bc12954a0688@collabora.com Signed-off-by: Cristian Ciocaltea --- include/drm/display/drm_scdc_helper.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/drm/display/drm_scdc_helper.h b/include/drm/display/drm_scdc_helper.h index a3b20adaac7e..6a8be1f16ce0 100644 --- a/include/drm/display/drm_scdc_helper.h +++ b/include/drm/display/drm_scdc_helper.h @@ -168,6 +168,8 @@ bool drm_scdc_get_scrambling_status(struct drm_connector *connector); bool drm_scdc_set_scrambling(struct drm_connector *connector, bool enable); bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector, bool set); +int drm_scdc_set_source_version(struct drm_connector *connector, u8 ver); + int drm_scdc_read_state(struct drm_connector *connector, struct drm_scdc_state *state); void drm_scdc_debugfs_init(struct drm_connector *connector, struct dentry *root); -- cgit v1.2.3