* [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX
@ 2026-07-02 14:46 Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 01/39] video/hdmi: Introduce HDMI version enum Cristian Ciocaltea
` (39 more replies)
0 siblings, 40 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Dmitry Baryshkov, Diederik de Haas, Maud Spierings
Enable HDMI 2.0 display modes (e.g. 4K@60Hz) on the Synopsys DW HDMI QP
TX controller, as found in Rockchip RK3576 & RK3588 SoCs, by adding SCDC
management for high TMDS clock ratio and scrambling.
Since SCDC state is lost on sink disconnects, the bridge driver needs to
trigger a CRTC reset during connector detection. To support this, the
series introduces the connector and bridge scrambling infrastructure
(patches 1-8), wires it up through the bridge connector layer with an
atomic-aware detect_ctx hook (patches 9-11), then implements the SCDC
scrambling feature in the DW HDMI QP bridge driver (patches 12-15).
Patches 16-18 are minor cleanups in the Rockchip platform driver.
Patches 19-23 improve HPD handling by deferring IRQ registration until
the connector is fully initialized, adding .enable_hpd()/.disable_hpd()
PHY ops, and restricting HPD events to the affected connector.
Patches 24-25 convert vc4 HDMI to the common SCDC scrambling helpers as
a proof of reuse, replacing the driver-local scrambling implementation.
Patches 26-30 add KUnit tests: connector scrambler validation, a new
4K@60Hz 600MHz EDID, hdmi_state_helper scrambling tests, and EDID
conformity fixes for some of the existing test blobs.
This has been tested on the following boards:
* Radxa ROCK 5B (RK3588)
* Radxa ROCK 4D (RK3576)
* Raspberry Pi 5 Model B Rev 1.1 (BCM2712 D0)
Note that commit d87773de9efe1 ("clocksource/drivers/arm_arch_timer:
Default to EL2 virtual timer when running VHE"), introduced in v7.2-rc1,
causes Raspberry Pi 5 to hang during boot. Reverting the commit
restores normal boot. This issue has already been reported in [1];
alternatively, the workaround proposed in [2] can be applied.
Regards,
Cristian
[1] https://lore.kernel.org/all/ea15cce1-b393-43f6-8d58-3d6f90f0c0cd@samsung.com/
[2] https://lore.kernel.org/all/20260619204832.586079-1-dan@reactivated.net/
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Changes in v8:
- Added an enum hdmi_version under video/hdmi to describe the HDMI
specification version a source/sink supports (new patch 1)
- Introduced HDMI connector capabilities API and reworked the
infrastructure patches on top of it: drmm_connector_hdmi_init() now
takes a drm_connector_hdmi_caps struct that carries supported_formats,
max_bpc, supported_hdmi_ver and max_tmds_char_rate (new patches 2-3)
- Moved all the new SCDC helpers covering both source and sink to
display/drm_hdmi_helper.c
- Renamed drm_scdc_{start,stop}_scrambling() to
drm_connector_hdmi_{enable,disable}_scrambling() and added a
connector-state argument so the scrambler_needed flag is checked
centrally instead of in every driver
- Renamed drm_scdc_sync_status() to drm_connector_hdmi_sync_scdc(),
aligned its lifecycle with vc4_hdmi_reset_link(), and removed the
internal drm_scdc_reset_crtc() helper; it now also gates on CRTC state
and an in-flight commit (Maxime)
- Changed the prototype of drm_atomic_helper_connector_hdmi_hotplug() to
take an acquire context and an int return, instead of adding a new
_ctx variant (Maxime)
- Added drm_hdmi_mode_needs_scrambling() to centralise the above-340 MHz
decision (new patch 7)
- Made SCDC source version negotiation optional and moved it to a
dedicated patch "drm/display: hdmi: Advertise SCDC source version when
scrambling" (new patch 8), backed by a new
drm_scdc_set_source_version() helper in "drm/display: scdc-helper: Add
helper to set SCDC version information" (new patch 6)
- Added a fallback TMDS rate validation patch using the connector-level
max_tmds_char_rate when the driver provides no .tmds_char_rate_valid()
hook (new patch 9)
- Split scrambler_needed flag handling into its own hdmi-state-helper
dedicate change (new patch 11)
- VC4:
* Replaced vc4_hdmi_mode_needs_scrambling() with
drm_hdmi_mode_needs_scrambling() (new patch 30)
* Restored drm_dev_{enter,exit}() pairing around the converted
scrambling paths
* Removed now unused output_{bpc,color_format} fields from vc4_hdmi as
part of the SCDC conversion
- KUnit:
* Covered the caps-based connector init path: NULL caps, inferred
max_tmds_char_rate per supported_hdmi_ver, and override validation
(new patch 32)
* Switched drm_hdmi_state_helper_test to the caps-based init helper
and exposed it through
drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs() (new
patch 34)
* Added max_tmds_char_rate fallback coverage in
drm_hdmi_state_helper_test (new patch 35)
- Rebased onto latest drm-misc-next and dropped the already applied
"drm/fb-helper: Remove unused local variable in hotplug_event()" patch
- Link to v7: https://patch.msgid.link/20260602-dw-hdmi-qp-scramb-v7-0-445eb54ee1ed@collabora.com
Changes in v7:
- Split the scrambler_needed flag computation from the SCDC scrambling
helpers into a standalone hdmi_state_helper patch for clarity (new
patch 6)
- Added vc4 HDMI conversion to common TMDS char rate constants and SCDC
scrambling helpers as a proof of reuse (new patches 24-25)
- Added KUnit tests for connector scrambler_supported/callback
consistency validation (new patch 26)
- Added 4K@60Hz 600MHz TMDS test EDID for high-rate scrambling coverage
(new patch 27)
- Added KUnit tests for hdmi_state_helper scrambler_needed flag:
low-rate, high-rate, and source-no-support cases (new patch 28)
- Fixed EDID conformity issues (edid-decode v1.33.0 failures) in the
existing 1080p+4K YUV420 200MHz and 4K RGB/YUV 340MHz test EDIDs
without changing the capabilities used by existing tests (new patches
29-30)
- Rebased onto latest drm-misc-next
- Link to v6: https://patch.msgid.link/20260520-dw-hdmi-qp-scramb-v6-0-24b74603b782@collabora.com
Changes in v6:
- Collected R-b & A-b tags from Dmitry and Heiko
- Restructured the series from 10 into 22 patches, splitting the SCDC
scrambling helpers, connector infrastructure, bridge operations,
bridge_connector plumbing, dw-hdmi-qp implementation, and Rockchip
platform changes into distinct commits
- Added drm_scdc_dbg() macro to simplify debug messages (new patch)
- Added drm_scdc_start/stop/sync_status() helpers for full scrambling
lifecycle management (reworked from v5 patch 5)
- Added drm_atomic_helper_connector_hdmi_hotplug_ctx() to propagate
modeset acquire context for SCDC sync on hotplug (new patch)
- Added connector scrambler callbacks and SCDC work/flag infrastructure
as a separate patch (split from v5 patch 5)
- Added DRM_BRIDGE_OP_HDMI_SCRAMBLER bridge operation with
hdmi_scrambler_enable/disable callbacks (new patch)
- Implemented bridge_connector scrambler interface wiring (new patch)
- Added .enable_hpd()/.disable_hpd() PHY ops for dw-hdmi-qp bridge and
Rockchip platform drivers, replacing the obsolete .setup_hpd() op
- Added dw_hdmi_qp_hpd_notify() helper for targeted connector-only HPD
notification (split from v5 patch 10)
- Dropped drm_fb_helper_hotplug_event() unused variable (new cleanup)
- Dropped unused drm_simple_kms_helper.h include (new cleanup)
- Masked RK3576 HPD IRQ in io_init() for consistency with RK3588
- Rebased onto latest drm-misc-next
- Link to v5: https://patch.msgid.link/20260426-dw-hdmi-qp-scramb-v5-0-d778e70c317b@collabora.com
Changes in v5:
- Added new patches: 1/10, 3/10, 6/10, 7/10, 8/10
- Removed redundant no-op error check in drm_bridge_helper_reset_crtc()
(patch 1)
- Removed the EDEADLK retry loop from the bridge .detect_ctx() callback,
as that's already handled in the drm_bridge_detect_ctx() helper or by
the caller when ctx is provided (patch 2)
- Refactored drm_bridge_detect() to delegate to drm_bridge_detect_ctx()
and added a WARN_ON for unexpected negative return values (patch 2)
- Split the bridge-connector .detect_ctx() switch into a preparatory
patch to use cached connector status in .get_modes() (patch 3)
- Improved error handling in SCDC scrambling setup: roll back high TMDS
clock ratio on scrambling failure, reset scramb_enabled flag on
set_scramb failure, and add SCDC version read/write error checks
(patch 5)
- Annotated scramb_enabled with READ_ONCE/WRITE_ONCE for cross-context
access between modeset paths and the scrambling work item (patch 5)
- Renamed SCDC_MIN_SOURCE_VERSION to SCDC_MAX_SOURCE_VERSION (patch 5)
- Rate limited i2c error messages (patch 6)
- Added missing newlines in dev_err_probe() messages (patch 7)
- Replaced indirect device pointer accesses with local dev variable in
bind() (patch 8)
- Split the HPD connector restriction (formerly patch 4/4): register HPD
IRQ after connector setup first (patch 9), then restrict HPD event to
the affected connector (patch 10); also collected R-b from Heiko
- Rebased onto latest drm-misc-next
- Link to v4: https://lore.kernel.org/r/20260303-dw-hdmi-qp-scramb-v4-0-317d3b8bd219@collabora.com
Changes in v4:
- Fixed conflicts while rebasing onto latest drm-misc-next
- Link to v3: https://lore.kernel.org/r/20260119-dw-hdmi-qp-scramb-v3-0-bd8611730fc1@collabora.com
Changes in v3:
- Used drm_bridge_helper_reset_crtc() helper to reset the display
pipeline and got rid of some boilerplate code (Maxime)
- Rebased onto latest drm-misc-next
- Link to v2: https://lore.kernel.org/r/20260113-dw-hdmi-qp-scramb-v2-0-ae7b2c58d24d@collabora.com
Changes in v2:
- Collected Tested-by tags from Diederik and Maud
- Rebased onto latest drm-misc-next
- Ensured the recently introduced 'no-hpd' support for dealing with
unconnected/repurposed/broken HPD pin is limited to HDMI 1.4 rates
- Link to v1: https://lore.kernel.org/r/20251203-dw-hdmi-qp-scramb-v1-0-836fe7401a69@collabora.com
---
Cristian Ciocaltea (39):
video/hdmi: Introduce HDMI version enum
drm/connector: Add caps-based HDMI connector init helper
drm/display: bridge_connector: Pass HDMI capabilities through caps struct
drm/connector: Add HDMI 2.0 scrambler infrastructure
drm/display: scdc-helper: Add macro for connector-prefixed debug messages
drm/display: scdc-helper: Add helper to set SCDC version information
drm/display: hdmi: Add HDMI 2.0 scrambling management helpers
drm/display: hdmi: Advertise SCDC source version when scrambling
drm/display: hdmi-state-helper: Add fallback TMDS rate validation
drm/display: hdmi-state-helper: Sync SCDC state on hotplug
drm/display: hdmi-state-helper: Set HDMI scrambling requirement
drm/bridge: Remove redundant error check in drm_bridge_helper_reset_crtc()
drm/bridge: Add bridge ops for source-side HDMI 2.0 scrambling
drm/display: bridge_connector: Use cached connector status in .get_modes()
drm/display: bridge_connector: Switch to .detect_ctx() connector helper
drm/display: bridge_connector: Wire up HDMI 2.0 scrambler callbacks
drm/bridge: dw-hdmi-qp: Rate limit i2c read error messages
drm/bridge: dw-hdmi-qp: Provide .{enable|disable}_hpd() PHY ops
drm/bridge: dw-hdmi-qp: Add HDMI 2.0 SCDC scrambling support
drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper
drm/rockchip: dw_hdmi_qp: Add missing newlines in dev_err_probe() messages
drm/rockchip: dw_hdmi_qp: Use local dev variable consistently in bind()
drm/rockchip: dw_hdmi_qp: Drop unnecessary #include
drm/rockchip: dw_hdmi_qp: Defer HPD IRQ enable until after connector setup
drm/rockchip: dw_hdmi_qp: Mask RK3576 HPD IRQ in io_init
drm/rockchip: dw_hdmi_qp: Implement .{enable|disable}_hpd() PHY ops
drm/rockchip: dw_hdmi_qp: Use dw_hdmi_qp_hpd_notify() for HPD reports
drm/bridge: dw-hdmi-qp: Drop unused .setup_hpd() phy op
drm/vc4: hdmi: Use common TMDS char rate constants
drm/vc4: hdmi: Switch to drm_hdmi_mode_needs_scrambling()
drm/vc4: hdmi: Convert to common SCDC scrambling infrastructure
drm/tests: connector: Add HDMI caps-based init coverage
drm/tests: connector: Add HDMI source-side scrambler coverage
drm/tests: hdmi_state_helper: Use drmm_connector_hdmi_init_with_caps()
drm/tests: hdmi_state_helper: Add max_tmds_char_rate fallback tests
drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS
drm/tests: hdmi_state_helper: Cover source-side scrambling decision
drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID
drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 129 ++++++--
drivers/gpu/drm/display/drm_bridge_connector.c | 146 +++++----
drivers/gpu/drm/display/drm_hdmi_helper.c | 267 +++++++++++++++++
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 32 +-
drivers/gpu/drm/display/drm_scdc_helper.c | 70 ++++-
drivers/gpu/drm/drm_bridge_helper.c | 2 -
drivers/gpu/drm/drm_connector.c | 222 ++++++++++----
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 130 ++++----
drivers/gpu/drm/tests/drm_connector_test.c | 330 +++++++++++++++++++++
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 315 +++++++++++++++++++-
drivers/gpu/drm/tests/drm_kunit_edid.c | 251 +++++++++++++---
drivers/gpu/drm/tests/drm_kunit_edid.h | 1 +
drivers/gpu/drm/vc4/vc4_hdmi.c | 301 ++++---------------
drivers/gpu/drm/vc4/vc4_hdmi.h | 21 --
include/drm/bridge/dw_hdmi_qp.h | 4 +-
include/drm/display/drm_hdmi_helper.h | 15 +
include/drm/display/drm_hdmi_state_helper.h | 6 +-
include/drm/display/drm_scdc_helper.h | 2 +
include/drm/drm_bridge.h | 41 +++
include/drm/drm_connector.h | 132 +++++++++
include/linux/hdmi.h | 12 +
21 files changed, 1869 insertions(+), 560 deletions(-)
---
base-commit: 44d19b8a7548aa25cbc6ebd5f27e958f7142c36b
change-id: 20251203-dw-hdmi-qp-scramb-cdbd8b57ccf9
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v8 01/39] video/hdmi: Introduce HDMI version enum
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-03 13:55 ` Dmitry Baryshkov
2026-07-02 14:46 ` [PATCH v8 02/39] drm/connector: Add caps-based HDMI connector init helper Cristian Ciocaltea
` (38 subsequent siblings)
39 siblings, 1 reply; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Add an enum to represent HDMI specification versions. This will be used
by upcoming changes to associate HDMI connectors and bridges with a
maximum supported version and to simplify handling of version-dependent
features.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
include/linux/hdmi.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index 8dab78e1f61b..b80a5ee63bb2 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -27,6 +27,18 @@
#include <linux/types.h>
#include <linux/device.h>
+enum hdmi_version {
+ HDMI_VERSION_UNKNOWN,
+ HDMI_VERSION_1_0,
+ HDMI_VERSION_1_1,
+ HDMI_VERSION_1_2,
+ HDMI_VERSION_1_3,
+ HDMI_VERSION_1_4,
+ HDMI_VERSION_2_0,
+ HDMI_VERSION_2_1,
+ HDMI_VERSION_2_2,
+};
+
enum hdmi_packet_type {
HDMI_PACKET_TYPE_NULL = 0x00,
HDMI_PACKET_TYPE_AUDIO_CLOCK_REGEN = 0x01,
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 02/39] drm/connector: Add caps-based HDMI connector init helper
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 01/39] video/hdmi: Introduce HDMI version enum Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-03 14:05 ` Dmitry Baryshkov
2026-07-02 14:46 ` [PATCH v8 03/39] drm/display: bridge_connector: Pass HDMI capabilities through caps struct Cristian Ciocaltea
` (37 subsequent siblings)
39 siblings, 1 reply; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
In preparation for adding HDMI 2.x source capabilities, introduce struct
drm_connector_hdmi_caps and a new drmm_connector_hdmi_init_with_caps()
helper.
The existing drmm_connector_hdmi_init() helper currently takes
individual capability arguments such as supported_formats and max_bpc.
Adding more HDMI-specific arguments to that function would not scale
well, so move those values into a dedicated capabilities structure and
implement the existing helper as a wrapper around the new caps-based
interface.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/drm_connector.c | 202 +++++++++++++++++++++++++++-------------
include/drm/drm_connector.h | 55 +++++++++++
2 files changed, 193 insertions(+), 64 deletions(-)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 8b4baed060f3..c7ce6b7bd8b0 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -542,6 +542,137 @@ int drmm_connector_init(struct drm_device *dev,
}
EXPORT_SYMBOL(drmm_connector_init);
+/**
+ * drmm_connector_hdmi_init_with_caps - Init a preallocated HDMI connector
+ * @dev: DRM device
+ * @connector: A pointer to the HDMI connector to init
+ * @vendor: HDMI Controller Vendor name
+ * @product: HDMI Controller Product name
+ * @funcs: callbacks for this connector
+ * @hdmi_funcs: HDMI-related callbacks for this connector
+ * @connector_type: user visible type of the connector
+ * @ddc: optional pointer to the associated ddc adapter
+ * @caps: optional HDMI connector capabilities
+ *
+ * Initialises a preallocated HDMI connector. Connectors can be
+ * subclassed as part of driver connector objects.
+ *
+ * Cleanup is automatically handled with a call to
+ * drm_connector_cleanup() in a DRM-managed action.
+ *
+ * The connector structure should be allocated with drmm_kzalloc().
+ *
+ * The @drm_connector_funcs.destroy hook must be NULL.
+ *
+ * Returns:
+ * Zero on success, error code on failure.
+ */
+int drmm_connector_hdmi_init_with_caps(struct drm_device *dev,
+ struct drm_connector *connector,
+ const char *vendor, const char *product,
+ const struct drm_connector_funcs *funcs,
+ const struct drm_connector_hdmi_funcs *hdmi_funcs,
+ int connector_type,
+ struct i2c_adapter *ddc,
+ const struct drm_connector_hdmi_caps *caps)
+{
+ int ret;
+
+ if (!vendor || !product)
+ return -EINVAL;
+
+ if ((strlen(vendor) > DRM_CONNECTOR_HDMI_VENDOR_LEN) ||
+ (strlen(product) > DRM_CONNECTOR_HDMI_PRODUCT_LEN))
+ return -EINVAL;
+
+ if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
+ connector_type == DRM_MODE_CONNECTOR_HDMIB))
+ return -EINVAL;
+
+ if (!caps)
+ return -EINVAL;
+
+ if (!caps->supported_formats ||
+ !(caps->supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
+ return -EINVAL;
+
+ if (connector->ycbcr_420_allowed !=
+ !!(caps->supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
+ return -EINVAL;
+
+ if (!(caps->max_bpc == 8 || caps->max_bpc == 10 || caps->max_bpc == 12))
+ return -EINVAL;
+
+ if (!hdmi_funcs->avi.clear_infoframe ||
+ !hdmi_funcs->avi.write_infoframe ||
+ !hdmi_funcs->hdmi.clear_infoframe ||
+ !hdmi_funcs->hdmi.write_infoframe)
+ return -EINVAL;
+
+ ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc);
+ if (ret)
+ return ret;
+
+ connector->hdmi.supported_formats = caps->supported_formats;
+
+ /*
+ * The supported HDMI version can be used to infer the maximum TMDS
+ * character rate allowed by the specification. Some controllers,
+ * however, may support a lower rate than that version would imply.
+ *
+ * A non-zero caps->max_tmds_char_rate lets drivers override the
+ * inferred limit with the actual controller capability. A value of
+ * zero keeps the default limit inferred from supported_hdmi_ver.
+ */
+ if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0)
+ connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ;
+ else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3)
+ connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
+ else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0)
+ connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ;
+
+ if (caps->max_tmds_char_rate) {
+ if (caps->max_tmds_char_rate > connector->hdmi.max_tmds_char_rate)
+ return -EINVAL;
+ connector->hdmi.max_tmds_char_rate = caps->max_tmds_char_rate;
+ }
+
+ strtomem_pad(connector->hdmi.vendor, vendor, 0);
+ strtomem_pad(connector->hdmi.product, product, 0);
+
+ /*
+ * drm_connector_attach_max_bpc_property() requires the
+ * connector to have a state.
+ */
+ if (connector->funcs->atomic_create_state) {
+ struct drm_connector_state *state;
+
+ state = connector->funcs->atomic_create_state(connector);
+ if (IS_ERR(state))
+ return PTR_ERR(state);
+
+ connector->state = state;
+ } else if (connector->funcs->reset) {
+ connector->funcs->reset(connector);
+ }
+
+ drm_connector_attach_max_bpc_property(connector, 8, caps->max_bpc);
+ connector->max_bpc = caps->max_bpc;
+
+ if (caps->max_bpc > 8)
+ drm_connector_attach_hdr_output_metadata_property(connector);
+
+ ret = drm_connector_attach_color_format_property(connector,
+ caps->supported_formats);
+ if (ret)
+ return ret;
+
+ connector->hdmi.funcs = hdmi_funcs;
+
+ return 0;
+}
+EXPORT_SYMBOL(drmm_connector_hdmi_init_with_caps);
+
/**
* drmm_connector_hdmi_init - Init a preallocated HDMI connector
* @dev: DRM device
@@ -578,71 +709,14 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
unsigned long supported_formats,
unsigned int max_bpc)
{
- int ret;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_formats = supported_formats,
+ .max_bpc = max_bpc,
+ };
- if (!vendor || !product)
- return -EINVAL;
-
- if ((strlen(vendor) > DRM_CONNECTOR_HDMI_VENDOR_LEN) ||
- (strlen(product) > DRM_CONNECTOR_HDMI_PRODUCT_LEN))
- return -EINVAL;
-
- if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
- connector_type == DRM_MODE_CONNECTOR_HDMIB))
- return -EINVAL;
-
- if (!supported_formats || !(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
- return -EINVAL;
-
- if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
- return -EINVAL;
-
- if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
- return -EINVAL;
-
- if (!hdmi_funcs->avi.clear_infoframe ||
- !hdmi_funcs->avi.write_infoframe ||
- !hdmi_funcs->hdmi.clear_infoframe ||
- !hdmi_funcs->hdmi.write_infoframe)
- return -EINVAL;
-
- ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc);
- if (ret)
- return ret;
-
- connector->hdmi.supported_formats = supported_formats;
- strtomem_pad(connector->hdmi.vendor, vendor, 0);
- strtomem_pad(connector->hdmi.product, product, 0);
-
- /*
- * drm_connector_attach_max_bpc_property() requires the
- * connector to have a state.
- */
- if (connector->funcs->atomic_create_state) {
- struct drm_connector_state *state;
-
- state = connector->funcs->atomic_create_state(connector);
- if (IS_ERR(state))
- return PTR_ERR(state);
-
- connector->state = state;
- } else if (connector->funcs->reset) {
- connector->funcs->reset(connector);
- }
-
- drm_connector_attach_max_bpc_property(connector, 8, max_bpc);
- connector->max_bpc = max_bpc;
-
- if (max_bpc > 8)
- drm_connector_attach_hdr_output_metadata_property(connector);
-
- ret = drm_connector_attach_color_format_property(connector, supported_formats);
- if (ret)
- return ret;
-
- connector->hdmi.funcs = hdmi_funcs;
-
- return 0;
+ return drmm_connector_hdmi_init_with_caps(dev, connector, vendor,
+ product, funcs, hdmi_funcs,
+ connector_type, ddc, &caps);
}
EXPORT_SYMBOL(drmm_connector_hdmi_init);
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index af075c38f4db..961a729d0869 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -2029,6 +2029,47 @@ struct drm_connector_hdmi_audio {
int dai_port;
};
+/**
+ * struct drm_connector_hdmi_caps - HDMI capabilities structure
+ *
+ * This structure is required to initialize the connector using
+ * drmm_connector_hdmi_init_with_caps().
+ */
+struct drm_connector_hdmi_caps {
+ /**
+ * @supported_hdmi_ver:
+ *
+ * Maximum HDMI specification version supported by the controller side
+ * of this connector. This describes the controller capability only;
+ * the effective link capabilities may be further restricted by the
+ * sink, bridge, or mode validation.
+ *
+ * HDMI_VERSION_UNKNOWN means legacy/default behaviour.
+ */
+ enum hdmi_version supported_hdmi_ver;
+
+ /**
+ * @supported_formats:
+ *
+ * Bitmask of @drm_output_color_format listing supported output formats.
+ */
+ unsigned long supported_formats;
+
+ /**
+ * @max_tmds_char_rate:
+ *
+ * Maximum TMDS character rate supported by the source, in Hz.
+ * A value of 0 means the core should use the default limit implied by
+ * @supported_hdmi_ver.
+ */
+ unsigned long long max_tmds_char_rate;
+
+ /**
+ * @max_bpc: Maximum bits per char the HDMI connector supports.
+ */
+ unsigned int max_bpc;
+};
+
/*
* struct drm_connector_hdmi - DRM Connector HDMI-related structure
*/
@@ -2051,6 +2092,12 @@ struct drm_connector_hdmi {
*/
unsigned long supported_formats;
+ /**
+ * @max_tmds_char_rate: Maximum TMDS character rate, in Hz,
+ * supported by the controller.
+ */
+ unsigned long long max_tmds_char_rate;
+
/**
* @funcs: HDMI connector Control Functions
*/
@@ -2555,6 +2602,14 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
struct i2c_adapter *ddc,
unsigned long supported_formats,
unsigned int max_bpc);
+int drmm_connector_hdmi_init_with_caps(struct drm_device *dev,
+ struct drm_connector *connector,
+ const char *vendor, const char *product,
+ const struct drm_connector_funcs *funcs,
+ const struct drm_connector_hdmi_funcs *hdmi_funcs,
+ int connector_type,
+ struct i2c_adapter *ddc,
+ const struct drm_connector_hdmi_caps *caps);
void drm_connector_attach_edid_property(struct drm_connector *connector);
int drm_connector_register(struct drm_connector *connector);
int drm_connector_dynamic_register(struct drm_connector *connector);
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 03/39] drm/display: bridge_connector: Pass HDMI capabilities through caps struct
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 01/39] video/hdmi: Introduce HDMI version enum Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 02/39] drm/connector: Add caps-based HDMI connector init helper Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-03 14:19 ` Dmitry Baryshkov
2026-07-02 14:46 ` [PATCH v8 04/39] drm/connector: Add HDMI 2.0 scrambler infrastructure Cristian Ciocaltea
` (36 subsequent siblings)
39 siblings, 1 reply; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Switch drm_bridge_connector_init() to
drmm_connector_hdmi_init_with_caps(), collecting the bridge's HDMI
properties into a stack drm_connector_hdmi_caps so future HDMI 2.x
capabilities can be plumbed without growing the argument list.
Introduce struct drm_bridge::supported_hdmi_ver to let bridges declare
the HDMI specification version they are conformant with, and forward it
to the connector layer through the new caps struct so HDMI 2.x features
can be gated on real source capability rather than guesswork.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 29 ++++++++++++++------------
include/drm/drm_bridge.h | 6 ++++++
2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 92f8a2d7aab4..796069dbf1a1 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -823,8 +823,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
struct drm_connector *connector;
struct i2c_adapter *ddc = NULL;
struct drm_bridge *panel_bridge __free(drm_bridge_put) = NULL;
- unsigned int supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
- unsigned int max_bpc = 8;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ };
bool support_hdcp = false;
int connector_type;
int ret;
@@ -885,6 +887,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
if (bridge->ops & DRM_BRIDGE_OP_HDMI) {
if (bridge_connector->bridge_hdmi)
return ERR_PTR(-EBUSY);
+
if (!bridge->funcs->hdmi_write_avi_infoframe ||
!bridge->funcs->hdmi_clear_avi_infoframe ||
!bridge->funcs->hdmi_write_hdmi_infoframe ||
@@ -908,10 +911,12 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
bridge_connector->bridge_hdmi = drm_bridge_get(bridge);
+ if (bridge->supported_hdmi_ver)
+ caps.supported_hdmi_ver = bridge->supported_hdmi_ver;
if (bridge->supported_formats)
- supported_formats = bridge->supported_formats;
+ caps.supported_formats = bridge->supported_formats;
if (bridge->max_bpc)
- max_bpc = bridge->max_bpc;
+ caps.max_bpc = bridge->max_bpc;
}
if (bridge->ops & DRM_BRIDGE_OP_HDMI_AUDIO) {
@@ -994,7 +999,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
if (bridge_connector->bridge_hdmi) {
if (!connector->ycbcr_420_allowed)
- supported_formats &= ~BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
+ caps.supported_formats &= ~BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
bridge_connector->hdmi_funcs = drm_bridge_connector_hdmi_funcs;
@@ -1010,14 +1015,12 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
bridge_connector->hdmi_funcs.spd =
drm_bridge_connector_hdmi_spd_infoframe;
- ret = drmm_connector_hdmi_init(drm, connector,
- bridge_connector->bridge_hdmi->vendor,
- bridge_connector->bridge_hdmi->product,
- &drm_bridge_connector_funcs,
- &bridge_connector->hdmi_funcs,
- connector_type, ddc,
- supported_formats,
- max_bpc);
+ ret = drmm_connector_hdmi_init_with_caps(drm, connector,
+ bridge_connector->bridge_hdmi->vendor,
+ bridge_connector->bridge_hdmi->product,
+ &drm_bridge_connector_funcs,
+ &bridge_connector->hdmi_funcs,
+ connector_type, ddc, &caps);
if (ret)
return ERR_PTR(ret);
} else {
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index 18f3db367dc1..2d8b5e4c64ba 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -1176,6 +1176,12 @@ struct drm_bridge {
*/
const char *product;
+ /**
+ * @supported_hdmi_ver: HDMI version the bridge is conformant with.
+ * This is only relevant if @DRM_BRIDGE_OP_HDMI is set.
+ */
+ enum hdmi_version supported_hdmi_ver;
+
/**
* @supported_formats: Bitmask of @drm_output_color_format listing
* supported output formats. This is only relevant if
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 04/39] drm/connector: Add HDMI 2.0 scrambler infrastructure
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (2 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 03/39] drm/display: bridge_connector: Pass HDMI capabilities through caps struct Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-03 14:34 ` Dmitry Baryshkov
2026-07-02 14:46 ` [PATCH v8 05/39] drm/display: scdc-helper: Add macro for connector-prefixed debug messages Cristian Ciocaltea
` (35 subsequent siblings)
39 siblings, 1 reply; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Add the connector-level infrastructure to support HDMI 2.0 scrambling:
- A scrambler_supported flag to indicate whether the source supports the
scrambling capability, in which case the newly introduced
.scrambler_{enable|disable}() callbacks in drm_connector_hdmi_funcs
are mandatory
- A scrambler_needed flag to be managed by the hdmi state helpers based
on the negotiated TMDS character rate and the source/sink scrambling
capabilities
- A scrambler_enabled flag to track whether scrambling is currently
active
- A delayed work item (scdc_work) with an associated callback (scdc_cb)
to monitor sink-side scrambling status and retry the setup if the sink
resets it
These are intended to be used by SCDC scrambling helpers to coordinate
scrambling setup and teardown between the source driver and the DRM
core.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/drm_connector.c | 26 ++++++++++++--
include/drm/drm_connector.h | 77 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 100 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index c7ce6b7bd8b0..deecfc582f09 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -220,6 +220,19 @@ void drm_connector_free_work_fn(struct work_struct *work)
}
}
+static void drm_connector_hdmi_scdc_work(struct work_struct *work)
+{
+ struct drm_connector *connector;
+ struct drm_connector_hdmi *hdmi;
+
+ hdmi = container_of(to_delayed_work(work), struct drm_connector_hdmi,
+ scdc_work);
+ connector = container_of(hdmi, struct drm_connector, hdmi);
+
+ if (hdmi->scdc_cb)
+ hdmi->scdc_cb(connector);
+}
+
static int drm_connector_init_only(struct drm_device *dev,
struct drm_connector *connector,
const struct drm_connector_funcs *funcs,
@@ -285,6 +298,7 @@ static int drm_connector_init_only(struct drm_device *dev,
mutex_init(&connector->edid_override_mutex);
mutex_init(&connector->hdmi.infoframes.lock);
mutex_init(&connector->hdmi_audio.lock);
+ INIT_DELAYED_WORK(&connector->hdmi.scdc_work, drm_connector_hdmi_scdc_work);
connector->edid_blob_ptr = NULL;
connector->epoch_counter = 0;
connector->tile_blob_ptr = NULL;
@@ -624,12 +638,18 @@ int drmm_connector_hdmi_init_with_caps(struct drm_device *dev,
* inferred limit with the actual controller capability. A value of
* zero keeps the default limit inferred from supported_hdmi_ver.
*/
- if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0)
+ if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0) {
+ if (!hdmi_funcs->scrambler_enable ||
+ !hdmi_funcs->scrambler_disable)
+ return -EINVAL;
+
+ connector->hdmi.scrambler_supported = true;
connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ;
- else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3)
+ } else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3) {
connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
- else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0)
+ } else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0) {
connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ;
+ }
if (caps->max_tmds_char_rate) {
if (caps->max_tmds_char_rate > connector->hdmi.max_tmds_char_rate)
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 961a729d0869..c70b57963f28 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -28,6 +28,7 @@
#include <linux/ctype.h>
#include <linux/hdmi.h>
#include <linux/notifier.h>
+#include <linux/workqueue.h>
#include <drm/drm_mode_object.h>
#include <drm/drm_util.h>
#include <drm/drm_property.h>
@@ -1131,6 +1132,19 @@ struct drm_connector_hdmi_state {
* @tmds_char_rate: TMDS Character Rate, in Hz.
*/
unsigned long long tmds_char_rate;
+
+ /**
+ * @scrambler_needed: Whether HDMI 2.0 SCDC scrambling is required
+ * for the negotiated mode/bpc/format.
+ *
+ * Computed by drm_atomic_helper_connector_hdmi_check() from
+ * @tmds_char_rate and the source/sink scrambling capabilities.
+ *
+ * Per HDMI 2.0, scrambling is mandatory above 340 MHz TMDS
+ * character rate. Optional scrambling at lower rates is
+ * deliberately not requested by the helper.
+ */
+ bool scrambler_needed;
};
/**
@@ -1439,6 +1453,36 @@ struct drm_connector_hdmi_funcs {
*/
const struct drm_edid *(*read_edid)(struct drm_connector *connector);
+ /**
+ * @scrambler_enable:
+ *
+ * The callback is invoked via @drm_connector_hdmi_enable_scrambling
+ * during commit to setup SCDC scrambling and high TMDS clock ratio on
+ * the source side.
+ *
+ * The @scrambler_enable callback is mandatory if HDMI 2.0 is to be
+ * supported.
+ *
+ * Returns:
+ * 0 on success, a negative error code otherwise
+ */
+ int (*scrambler_enable)(struct drm_connector *connector);
+
+ /**
+ * @scrambler_disable:
+ *
+ * The callback is invoked via @drm_connector_hdmi_disable_scrambling
+ * during commit to tear down SCDC scrambling and high TMDS clock ratio
+ * on the source side.
+ *
+ * The @scrambler_disable callback is mandatory if HDMI 2.0 is to be
+ * supported.
+ *
+ * Returns:
+ * 0 on success, a negative error code otherwise
+ */
+ int (*scrambler_disable)(struct drm_connector *connector);
+
/**
* @avi:
*
@@ -2098,6 +2142,39 @@ struct drm_connector_hdmi {
*/
unsigned long long max_tmds_char_rate;
+ /**
+ * @scrambler_supported: Indicates whether the HDMI controller
+ * (source) supports HDMI 2.0 SCDC scrambling.
+ *
+ * This is set by the HDMI connector init helpers if the provided
+ * capabilities advertise HDMI_VERSION_2_0 support.
+ *
+ * When true, @drm_connector_hdmi_funcs.scrambler_enable and
+ * @drm_connector_hdmi_funcs.scrambler_disable are mandatory.
+ */
+ bool scrambler_supported;
+
+ /**
+ * @scrambler_enabled: Tracks whether HDMI 2.0 scrambler is currently enabled.
+ */
+ bool scrambler_enabled;
+
+ /**
+ * @scdc_work: Work item currently used to monitor sink-side scrambling
+ * status and retry setup if the sink resets it.
+ */
+ struct delayed_work scdc_work;
+
+ /** @scdc_cb: Callback to be invoked as part of @scdc_work.
+ *
+ * Currently used to monitor sink-side scrambling status and retry
+ * setup if the sink resets it.
+ *
+ * This is assigned by the framework when making use of
+ * drm_connector_hdmi_enable_scrambling() helper.
+ */
+ void (*scdc_cb)(struct drm_connector *connector);
+
/**
* @funcs: HDMI connector Control Functions
*/
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 05/39] drm/display: scdc-helper: Add macro for connector-prefixed debug messages
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (3 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 04/39] drm/connector: Add HDMI 2.0 scrambler infrastructure Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 06/39] drm/display: scdc-helper: Add helper to set SCDC version information Cristian Ciocaltea
` (34 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Introduce the drm_scdc_dbg() wrapper over drm_dbg_kms() to help getting
rid of the boilerplate around prefixing the debug messages with the
connector information.
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_scdc_helper.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_scdc_helper.c b/drivers/gpu/drm/display/drm_scdc_helper.c
index df878aad4a36..cb6632346aad 100644
--- a/drivers/gpu/drm/display/drm_scdc_helper.c
+++ b/drivers/gpu/drm/display/drm_scdc_helper.c
@@ -55,6 +55,10 @@
#define SCDC_I2C_SLAVE_ADDRESS 0x54
+#define drm_scdc_dbg(connector, fmt, ...) \
+ drm_dbg_kms((connector)->dev, "[CONNECTOR:%d:%s] " fmt, \
+ (connector)->base.id, (connector)->name, ##__VA_ARGS__)
+
/**
* drm_scdc_read - read a block of data from SCDC
* @adapter: I2C controller
@@ -158,9 +162,7 @@ bool drm_scdc_get_scrambling_status(struct drm_connector *connector)
ret = drm_scdc_readb(connector->ddc, SCDC_SCRAMBLER_STATUS, &status);
if (ret < 0) {
- drm_dbg_kms(connector->dev,
- "[CONNECTOR:%d:%s] Failed to read scrambling status: %d\n",
- connector->base.id, connector->name, ret);
+ drm_scdc_dbg(connector, "Failed to read scrambling status: %d\n", ret);
return false;
}
@@ -188,9 +190,7 @@ bool drm_scdc_set_scrambling(struct drm_connector *connector,
ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config);
if (ret < 0) {
- drm_dbg_kms(connector->dev,
- "[CONNECTOR:%d:%s] Failed to read TMDS config: %d\n",
- connector->base.id, connector->name, ret);
+ drm_scdc_dbg(connector, "Failed to read TMDS config: %d\n", ret);
return false;
}
@@ -201,9 +201,7 @@ bool drm_scdc_set_scrambling(struct drm_connector *connector,
ret = drm_scdc_writeb(connector->ddc, SCDC_TMDS_CONFIG, config);
if (ret < 0) {
- drm_dbg_kms(connector->dev,
- "[CONNECTOR:%d:%s] Failed to enable scrambling: %d\n",
- connector->base.id, connector->name, ret);
+ drm_scdc_dbg(connector, "Failed to enable scrambling: %d\n", ret);
return false;
}
@@ -248,9 +246,7 @@ bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector,
ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config);
if (ret < 0) {
- drm_dbg_kms(connector->dev,
- "[CONNECTOR:%d:%s] Failed to read TMDS config: %d\n",
- connector->base.id, connector->name, ret);
+ drm_scdc_dbg(connector, "Failed to read TMDS config: %d\n", ret);
return false;
}
@@ -261,9 +257,7 @@ bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector,
ret = drm_scdc_writeb(connector->ddc, SCDC_TMDS_CONFIG, config);
if (ret < 0) {
- drm_dbg_kms(connector->dev,
- "[CONNECTOR:%d:%s] Failed to set TMDS clock ratio: %d\n",
- connector->base.id, connector->name, ret);
+ drm_scdc_dbg(connector, "Failed to set TMDS clock ratio: %d\n", ret);
return false;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 06/39] drm/display: scdc-helper: Add helper to set SCDC version information
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (4 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 05/39] drm/display: scdc-helper: Add macro for connector-prefixed debug messages Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 07/39] drm/display: hdmi: Add HDMI 2.0 scrambling management helpers Cristian Ciocaltea
` (33 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
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.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_scdc_helper.c | 46 ++++++++++++++++++++++++++++++-
include/drm/display/drm_scdc_helper.h | 2 ++
2 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/display/drm_scdc_helper.c b/drivers/gpu/drm/display/drm_scdc_helper.c
index cb6632346aad..6d804ee19420 100644
--- a/drivers/gpu/drm/display/drm_scdc_helper.c
+++ b/drivers/gpu/drm/display/drm_scdc_helper.c
@@ -21,10 +21,11 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include <linux/delay.h>
#include <linux/export.h>
#include <linux/i2c.h>
+#include <linux/minmax.h>
#include <linux/slab.h>
-#include <linux/delay.h>
#include <drm/display/drm_scdc_helper.h>
#include <drm/drm_connector.h>
@@ -270,3 +271,46 @@ bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector,
return true;
}
EXPORT_SYMBOL(drm_scdc_set_high_tmds_clock_ratio);
+
+/**
+ * drm_scdc_set_source_version - set SCDC source version on the sink
+ * @connector: connector
+ * @ver: source version to advertise (per spec, 1)
+ *
+ * Reads the sink version for diagnostics and as a guard, then writes
+ * the source version unless the sink reports version 0.
+ *
+ * Returns:
+ * 0 on success or when skipped; a negative error code when either
+ * the read or the write failed.
+ */
+int drm_scdc_set_source_version(struct drm_connector *connector, u8 ver)
+{
+ u8 sink_ver;
+ int ret;
+
+ ret = drm_scdc_readb(connector->ddc, SCDC_SINK_VERSION, &sink_ver);
+ if (ret) {
+ drm_scdc_dbg(connector, "Failed to read SCDC_SINK_VERSION: %d\n", ret);
+ return ret;
+ }
+
+ drm_scdc_dbg(connector, "Sink reported SCDC ver. %u\n", sink_ver);
+
+ /*
+ * Only advertise our source version to sinks that report a
+ * non-zero sink version. A sink reporting version 0 is either
+ * not SCDC-version-aware or non-conformant; writing the source
+ * version gains nothing and may upset broken hardware.
+ */
+ if (sink_ver) {
+ ret = drm_scdc_writeb(connector->ddc, SCDC_SOURCE_VERSION,
+ min_t(u8, sink_ver, ver));
+ if (ret)
+ drm_scdc_dbg(connector,
+ "Failed to write SCDC_SOURCE_VERSION: %d\n", ret);
+ }
+
+ return ret;
+}
+EXPORT_SYMBOL(drm_scdc_set_source_version);
diff --git a/include/drm/display/drm_scdc_helper.h b/include/drm/display/drm_scdc_helper.h
index 34600476a1b9..90b0828364c2 100644
--- a/include/drm/display/drm_scdc_helper.h
+++ b/include/drm/display/drm_scdc_helper.h
@@ -77,4 +77,6 @@ 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);
+
#endif
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 07/39] drm/display: hdmi: Add HDMI 2.0 scrambling management helpers
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (5 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 06/39] drm/display: scdc-helper: Add helper to set SCDC version information Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 08/39] drm/display: hdmi: Advertise SCDC source version when scrambling Cristian Ciocaltea
` (32 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Add helpers to manage the full lifecycle of HDMI 2.0 SCDC scrambling on
both source and sink sides:
- drm_hdmi_mode_needs_scrambling(): checks whether a mode, bits per
component and output format combination requires scrambling, which is
needed when the resulting TMDS character rate exceeds the HDMI 1.3
maximum of 340 MHz
- drm_connector_hdmi_enable_scrambling(): configures SCDC scrambling and
high TMDS clock ratio and starts a periodic work item that monitors
the sink's SCDC scrambling status, retrying setup when the sink loses
state
- drm_connector_hdmi_disable_scrambling(): tears down scrambling on both
sides and cancels the monitoring work
- drm_connector_hdmi_sync_scdc(): triggers a CRTC reset on reconnection
to restore SCDC state lost during sink disconnects within an active
display pipeline
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_hdmi_helper.c | 260 ++++++++++++++++++++++++++++++
include/drm/display/drm_hdmi_helper.h | 15 ++
2 files changed, 275 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c
index 5cb0b033b171..7c96cccf683d 100644
--- a/drivers/gpu/drm/display/drm_hdmi_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_helper.c
@@ -4,12 +4,20 @@
#include <linux/module.h>
#include <drm/display/drm_hdmi_helper.h>
+#include <drm/display/drm_scdc_helper.h>
+
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
#include <drm/drm_connector.h>
+#include <drm/drm_crtc.h>
#include <drm/drm_edid.h>
#include <drm/drm_modes.h>
+#include <drm/drm_modeset_lock.h>
#include <drm/drm_print.h>
#include <drm/drm_property.h>
+#define DRM_HDMI_SCDC_POLL_DELAY_MS 1000
+
static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf)
{
return sink_eotf & BIT(output_eotf);
@@ -426,3 +434,255 @@ drm_hdmi_acr_get_n_cts(unsigned long long tmds_char_rate,
*out_cts = cts;
}
EXPORT_SYMBOL(drm_hdmi_acr_get_n_cts);
+
+/**
+ * drm_hdmi_mode_needs_scrambling() - Check if an HDMI mode requires scrambling
+ * @mode: Display mode to check
+ * @bpc: Bits per color component
+ * @fmt: Output pixel format
+ *
+ * Computes the TMDS character rate for the given mode, bits per component and
+ * output format, and checks whether it exceeds the HDMI 1.3 maximum TMDS
+ * character rate of 340 MHz.
+ *
+ * Returns:
+ * true if the mode requires scrambling, false otherwise.
+ */
+bool drm_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode,
+ unsigned int bpc,
+ enum drm_output_color_format fmt)
+{
+ unsigned long long tmds_char_rate;
+
+ tmds_char_rate = drm_hdmi_compute_mode_clock(mode, bpc, fmt);
+
+ return tmds_char_rate > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
+}
+EXPORT_SYMBOL(drm_hdmi_mode_needs_scrambling);
+
+static int drm_scdc_try_scrambling_setup(struct drm_connector *connector)
+{
+ bool done;
+
+ done = drm_scdc_set_high_tmds_clock_ratio(connector, true);
+ if (!done)
+ return -EIO;
+
+ done = drm_scdc_set_scrambling(connector, true);
+ if (!done)
+ return -EIO;
+
+ if (READ_ONCE(connector->hdmi.scrambler_enabled))
+ schedule_delayed_work(&connector->hdmi.scdc_work,
+ msecs_to_jiffies(DRM_HDMI_SCDC_POLL_DELAY_MS));
+
+ return 0;
+}
+
+static void drm_scdc_monitor_scrambler(struct drm_connector *connector)
+{
+ if (READ_ONCE(connector->hdmi.scrambler_enabled) &&
+ !drm_scdc_get_scrambling_status(connector))
+ drm_scdc_try_scrambling_setup(connector);
+}
+
+static bool drm_scdc_sink_supports_scrambling(struct drm_connector *connector)
+{
+ const struct drm_display_info *info = &connector->display_info;
+
+ return info->is_hdmi &&
+ info->hdmi.scdc.supported &&
+ info->hdmi.scdc.scrambling.supported;
+}
+
+/**
+ * drm_connector_hdmi_enable_scrambling - enable scrambling and monitor SCDC status
+ * @connector: connector
+ * @conn_state: connector state
+ *
+ * Enables scrambling and high TMDS clock ratio on both source and sink sides.
+ * Additionally, use a delayed work item to monitor the scrambling status on
+ * the sink side and retry the operation, as some displays refuse to set the
+ * scrambling bit right away.
+ *
+ * Returns:
+ * Zero if scrambling is set successfully, an error code otherwise.
+ */
+int drm_connector_hdmi_enable_scrambling(struct drm_connector *connector,
+ const struct drm_connector_state *conn_state)
+{
+ struct drm_connector_hdmi *hdmi = &connector->hdmi;
+ struct drm_device *dev = connector->dev;
+ int ret;
+
+ if (!conn_state)
+ return -EINVAL;
+
+ if (!conn_state->hdmi.scrambler_needed)
+ return 0;
+
+ if (!hdmi->scrambler_supported) {
+ drm_dbg_kms(dev, "Source doesn't support scrambling.\n");
+ return -EINVAL;
+ }
+
+ if (!drm_scdc_sink_supports_scrambling(connector)) {
+ drm_dbg_kms(dev, "Sink doesn't support scrambling.\n");
+ return -EINVAL;
+ }
+
+ drm_dbg_kms(dev, "Enabling scrambling\n");
+
+ hdmi->scdc_cb = drm_scdc_monitor_scrambler;
+ WRITE_ONCE(hdmi->scrambler_enabled, true);
+
+ ret = drm_scdc_try_scrambling_setup(connector);
+ if (!ret)
+ ret = hdmi->funcs->scrambler_enable(connector);
+
+ if (ret) {
+ WRITE_ONCE(hdmi->scrambler_enabled, false);
+ cancel_delayed_work_sync(&hdmi->scdc_work);
+ hdmi->scdc_cb = NULL;
+
+ drm_scdc_set_scrambling(connector, false);
+ drm_scdc_set_high_tmds_clock_ratio(connector, false);
+ }
+
+ return ret;
+}
+EXPORT_SYMBOL(drm_connector_hdmi_enable_scrambling);
+
+/**
+ * drm_connector_hdmi_disable_scrambling - disable scrambling and SCDC monitoring
+ * @connector: connector
+ *
+ * Disables scrambling and high TMDS clock ratio on both source and sink sides.
+ * Also cancels the SCDC status monitoring work item, if it is still pending.
+ *
+ * Returns:
+ * Zero if scrambling is reset successfully, an error code otherwise.
+ */
+int drm_connector_hdmi_disable_scrambling(struct drm_connector *connector)
+{
+ struct drm_connector_hdmi *hdmi = &connector->hdmi;
+ struct drm_device *dev = connector->dev;
+
+ if (!READ_ONCE(hdmi->scrambler_enabled))
+ return 0;
+
+ drm_dbg_kms(dev, "Disabling scrambling\n");
+
+ WRITE_ONCE(hdmi->scrambler_enabled, false);
+ cancel_delayed_work_sync(&hdmi->scdc_work);
+ hdmi->scdc_cb = NULL;
+
+ if (connector->status == connector_status_connected &&
+ drm_scdc_sink_supports_scrambling(connector)) {
+ drm_scdc_set_scrambling(connector, false);
+ drm_scdc_set_high_tmds_clock_ratio(connector, false);
+ }
+
+ return hdmi->funcs->scrambler_disable(connector);
+}
+EXPORT_SYMBOL(drm_connector_hdmi_disable_scrambling);
+
+/**
+ * drm_connector_hdmi_sync_scdc - resync the sink-side SCDC upon reconnect
+ * @connector: connector
+ * @plugged: connector plugged status event
+ * @ctx: initialized lock acquisition context
+ *
+ * When receiving hotplug disconnect/reconnect event, while the display is
+ * still active (CRTC enabled), the SCDC status on the sink side is reset
+ * and must be explicitly restored.
+ *
+ * The typical solution for this is to trigger an empty modeset in
+ * drm_connector_helper_funcs.detect_ctx(), which is what this helper does
+ * by triggering a CRTC reset on reconnection.
+ *
+ * When making use of the HDMI connector framework, this is automatically
+ * triggered via drm_atomic_helper_connector_hdmi_hotplug().
+ *
+ * Returns:
+ * Zero on success, an error code otherwise, including -EDEADLK.
+ */
+int drm_connector_hdmi_sync_scdc(struct drm_connector *connector, bool plugged,
+ struct drm_modeset_acquire_ctx *ctx)
+{
+ struct drm_connector_hdmi *hdmi = &connector->hdmi;
+ struct drm_device *dev = connector->dev;
+ struct drm_connector_state *conn_state;
+ struct drm_crtc *crtc;
+ u8 config;
+ int ret;
+
+ if (!connector || !plugged || !ctx)
+ return 0;
+
+ /*
+ * This is normally part of .detect_ctx() call path, which already holds
+ * connection_mutex through @ctx. However, re-acquiring it with the
+ * same context is a no-op and makes the helper safe under any caller.
+ */
+ ret = drm_modeset_lock(&connector->dev->mode_config.connection_mutex, ctx);
+ if (ret)
+ return ret;
+
+ /* TODO: Also handle HDMI 2.1 FRL link training */
+
+ if (!hdmi->scrambler_supported || !READ_ONCE(hdmi->scrambler_enabled))
+ return 0;
+
+ conn_state = connector->state;
+ if (!conn_state)
+ return 0;
+
+ crtc = connector->state->crtc;
+ if (!crtc)
+ return 0;
+
+ ret = drm_modeset_lock(&crtc->mutex, ctx);
+ if (ret)
+ return ret;
+
+ if (!crtc->state || !crtc->state->active)
+ return 0;
+
+ if (!drm_scdc_sink_supports_scrambling(connector))
+ return 0;
+
+ if (conn_state->commit &&
+ !try_wait_for_completion(&conn_state->commit->hw_done))
+ return 0;
+
+ ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config);
+ if (ret) {
+ drm_dbg_kms(dev, "Failed to read TMDS config: %d\n", ret);
+ return ret;
+ }
+
+ if (config & SCDC_SCRAMBLING_ENABLE)
+ return 0;
+
+ /*
+ * HDMI 2.0 requires that one should not send scrambled data prior
+ * to configuring the sink scrambling, and that TMDS clock/data
+ * transmission should be suspended when changing the TMDS clock rate
+ * in the sink. So let's just do a full modeset here, even though some
+ * sinks would be perfectly happy if were to just reconfigure the SCDC
+ * settings on the fly.
+ *
+ * The disable/re-enable cycle triggered by the reset should call
+ * drm_connector_hdmi_enable_scrambling() during re-enable, thus
+ * properly configuring the sink before data transmission resumes.
+ */
+ drm_dbg_kms(dev, "Resetting CRTC to restore SCDC status\n");
+
+ ret = drm_atomic_helper_reset_crtc(crtc, ctx);
+ if (ret && ret != -EDEADLK)
+ drm_dbg_kms(dev, "Failed to reset CRTC: %d\n", ret);
+
+ return ret;
+}
+EXPORT_SYMBOL(drm_connector_hdmi_sync_scdc);
diff --git a/include/drm/display/drm_hdmi_helper.h b/include/drm/display/drm_hdmi_helper.h
index 9c31ed90516b..2cdd6e3bc090 100644
--- a/include/drm/display/drm_hdmi_helper.h
+++ b/include/drm/display/drm_hdmi_helper.h
@@ -8,6 +8,7 @@
struct drm_connector;
struct drm_connector_state;
struct drm_display_mode;
+struct drm_modeset_acquire_ctx;
enum drm_output_color_format;
void
@@ -35,4 +36,18 @@ drm_hdmi_acr_get_n_cts(unsigned long long tmds_char_rate,
unsigned int *out_n,
unsigned int *out_cts);
+bool
+drm_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode,
+ unsigned int bpc, enum drm_output_color_format fmt);
+
+int
+drm_connector_hdmi_enable_scrambling(struct drm_connector *connector,
+ const struct drm_connector_state *conn_state);
+int
+drm_connector_hdmi_disable_scrambling(struct drm_connector *connector);
+
+int
+drm_connector_hdmi_sync_scdc(struct drm_connector *connector, bool plugged,
+ struct drm_modeset_acquire_ctx *ctx);
+
#endif
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 08/39] drm/display: hdmi: Advertise SCDC source version when scrambling
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (6 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 07/39] drm/display: hdmi: Add HDMI 2.0 scrambling management helpers Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 09/39] drm/display: hdmi-state-helper: Add fallback TMDS rate validation Cristian Ciocaltea
` (31 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
The HDMI 2.0 spec advises that compliant Source devices report their
SCDC version in the Source Version register. Do so when enabling
scrambling by calling drm_scdc_set_source_version().
Failures are non-fatal: SCDC version negotiation is purely informational
and does not gate scrambling or any high-bitrate functionality, so a
flaky DDC bus should not block scrambling setup.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_hdmi_helper.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c
index 7c96cccf683d..b8ed2a1e47f5 100644
--- a/drivers/gpu/drm/display/drm_hdmi_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_helper.c
@@ -16,6 +16,7 @@
#include <drm/drm_print.h>
#include <drm/drm_property.h>
+#define DRM_HDMI_SCDC_SOURCE_VERSION 1
#define DRM_HDMI_SCDC_POLL_DELAY_MS 1000
static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf)
@@ -531,6 +532,12 @@ int drm_connector_hdmi_enable_scrambling(struct drm_connector *connector,
return -EINVAL;
}
+ /*
+ * Advertise our SCDC source version. This is purely informational and
+ * does not gate scrambling, so failures are non-fatal.
+ */
+ drm_scdc_set_source_version(connector, DRM_HDMI_SCDC_SOURCE_VERSION);
+
drm_dbg_kms(dev, "Enabling scrambling\n");
hdmi->scdc_cb = drm_scdc_monitor_scrambler;
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 09/39] drm/display: hdmi-state-helper: Add fallback TMDS rate validation
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (7 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 08/39] drm/display: hdmi: Advertise SCDC source version when scrambling Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 10/39] drm/display: hdmi-state-helper: Sync SCDC state on hotplug Cristian Ciocaltea
` (30 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Validate the computed TMDS character rate against
connector->hdmi.max_tmds_char_rate when no driver-specific
tmds_char_rate_valid() hook is provided.
This gives HDMI connectors a common fallback for rejecting modes whose
TMDS character rate exceeds the connector limit, while still allowing
drivers with custom validation requirements to implement their own
tmds_char_rate_valid() callback.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index ce17eeefc2da..db76699093e8 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -566,6 +566,9 @@ hdmi_clock_valid(const struct drm_connector *connector,
status = funcs->tmds_char_rate_valid(connector, mode, clock);
if (status != MODE_OK)
return status;
+ } else if (connector->hdmi.max_tmds_char_rate) {
+ if (clock > connector->hdmi.max_tmds_char_rate)
+ return MODE_CLOCK_HIGH;
}
return MODE_OK;
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 10/39] drm/display: hdmi-state-helper: Sync SCDC state on hotplug
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (8 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 09/39] drm/display: hdmi-state-helper: Add fallback TMDS rate validation Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 11/39] drm/display: hdmi-state-helper: Set HDMI scrambling requirement Cristian Ciocaltea
` (29 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
drm_atomic_helper_connector_hdmi_hotplug() does not currently
synchronize SCDC status on hotplug events, leaving the scrambler state
potentially inconsistent after (re)connect.
Hook drm_connector_hdmi_sync_scdc() into both the connect and disconnect
paths, replacing the existing TODOs around missing scrambler handling.
SCDC synchronization may require a CRTC reset, which in turn needs a
modeset acquire context for correct locking. Therefore, extend
drm_atomic_helper_connector_hdmi_hotplug() and
drm_atomic_helper_connector_hdmi_update() to take a
drm_modeset_acquire_ctx argument. Additionally, change their return
type from void to int, allowing propagation of errors, such as -EDEADLK
from lock contention.
Update existing callers to pass NULL for the acquire context, preserving
current behavior.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 3 ++-
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 28 +++++++++++++++++--------
drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +-
include/drm/display/drm_hdmi_state_helper.h | 6 ++++--
4 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 796069dbf1a1..46104506fe32 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -221,7 +221,8 @@ drm_bridge_connector_detect(struct drm_connector *connector, bool force)
status = detect->funcs->detect(detect, connector);
if (hdmi)
- drm_atomic_helper_connector_hdmi_hotplug(connector, status);
+ drm_atomic_helper_connector_hdmi_hotplug(connector, status,
+ NULL);
drm_bridge_connector_hpd_notify(connector, status);
} else {
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index db76699093e8..69ccfbf123fe 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -1198,18 +1198,20 @@ drm_atomic_helper_connector_hdmi_clear_audio_infoframe(struct drm_connector *con
}
EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_clear_audio_infoframe);
-static void
+static int
drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
- enum drm_connector_status status)
+ enum drm_connector_status status,
+ struct drm_modeset_acquire_ctx *ctx)
{
const struct drm_edid *drm_edid;
+ int ret = 0;
if (status == connector_status_disconnected) {
- // TODO: also handle scramber, HDMI sink disconnected.
+ ret = drm_connector_hdmi_sync_scdc(connector, false, ctx);
drm_connector_hdmi_audio_plugged_notify(connector, false);
drm_edid_connector_update(connector, NULL);
drm_connector_cec_phys_addr_invalidate(connector);
- return;
+ return ret;
}
if (connector->hdmi.funcs->read_edid)
@@ -1222,24 +1224,32 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
drm_edid_free(drm_edid);
if (status == connector_status_connected) {
- // TODO: also handle scramber, HDMI sink is now connected.
+ ret = drm_connector_hdmi_sync_scdc(connector, true, ctx);
drm_connector_hdmi_audio_plugged_notify(connector, true);
drm_connector_cec_phys_addr_set(connector);
}
+
+ return ret;
}
/**
* drm_atomic_helper_connector_hdmi_hotplug - Handle the hotplug event for the HDMI connector
* @connector: A pointer to the HDMI connector
* @status: Connection status
+ * @ctx: Lock acquisition context to be used for resetting CRTC
*
* This function should be called as a part of the .detect() / .detect_ctx()
* callbacks for all status changes.
+ *
+ * Returns:
+ * Zero on success, error code on failure.
+ * If @ctx is set, it might also return -EDEADLK.
*/
-void drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector,
- enum drm_connector_status status)
+int drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector,
+ enum drm_connector_status status,
+ struct drm_modeset_acquire_ctx *ctx)
{
- drm_atomic_helper_connector_hdmi_update(connector, status);
+ return drm_atomic_helper_connector_hdmi_update(connector, status, ctx);
}
EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_hotplug);
@@ -1254,6 +1264,6 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_hotplug);
*/
void drm_atomic_helper_connector_hdmi_force(struct drm_connector *connector)
{
- drm_atomic_helper_connector_hdmi_update(connector, connector->status);
+ drm_atomic_helper_connector_hdmi_update(connector, connector->status, NULL);
}
EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_force);
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 74dce4be0c00..e165f604939b 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -375,7 +375,7 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi,
* the lock for now.
*/
- drm_atomic_helper_connector_hdmi_hotplug(connector, status);
+ drm_atomic_helper_connector_hdmi_hotplug(connector, status, NULL);
if (status != connector_status_connected)
return;
diff --git a/include/drm/display/drm_hdmi_state_helper.h b/include/drm/display/drm_hdmi_state_helper.h
index 13375bd0f4ae..0619cd7c435e 100644
--- a/include/drm/display/drm_hdmi_state_helper.h
+++ b/include/drm/display/drm_hdmi_state_helper.h
@@ -7,6 +7,7 @@ struct drm_atomic_commit;
struct drm_connector;
struct drm_connector_state;
struct drm_display_mode;
+struct drm_modeset_acquire_ctx;
struct hdmi_audio_infoframe;
enum drm_connector_status;
@@ -22,8 +23,9 @@ int drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector
int drm_atomic_helper_connector_hdmi_clear_audio_infoframe(struct drm_connector *connector);
int drm_atomic_helper_connector_hdmi_update_infoframes(struct drm_connector *connector,
struct drm_atomic_commit *state);
-void drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector,
- enum drm_connector_status status);
+int drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector,
+ enum drm_connector_status status,
+ struct drm_modeset_acquire_ctx *ctx);
void drm_atomic_helper_connector_hdmi_force(struct drm_connector *connector);
enum drm_mode_status
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 11/39] drm/display: hdmi-state-helper: Set HDMI scrambling requirement
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (9 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 10/39] drm/display: hdmi-state-helper: Sync SCDC state on hotplug Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 12/39] drm/bridge: Remove redundant error check in drm_bridge_helper_reset_crtc() Cristian Ciocaltea
` (28 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Set drm_connector_hdmi_state.scrambler_needed when the computed TMDS
character rate exceeds the HDMI 1.3 maximum TMDS character rate.
HDMI 2.0 requires scrambling above 340 MHz. Centralize that clock-based
requirement in the HDMI state helper so drivers do not need to open-code
the threshold check.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index 69ccfbf123fe..34e48e04d971 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -592,6 +592,7 @@ hdmi_compute_clock(const struct drm_connector *connector,
return -EINVAL;
conn_state->hdmi.tmds_char_rate = clock;
+ conn_state->hdmi.scrambler_needed = (clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ);
return 0;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 12/39] drm/bridge: Remove redundant error check in drm_bridge_helper_reset_crtc()
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (10 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 11/39] drm/display: hdmi-state-helper: Set HDMI scrambling requirement Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 13/39] drm/bridge: Add bridge ops for source-side HDMI 2.0 scrambling Cristian Ciocaltea
` (27 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Dmitry Baryshkov
Remove the no-op error check after drm_atomic_helper_reset_crtc() since
the goto target is the immediately following label and the return value
is already propagated correctly without it.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/drm_bridge_helper.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_bridge_helper.c b/drivers/gpu/drm/drm_bridge_helper.c
index 420f29cf3e54..0a3c8fee66b3 100644
--- a/drivers/gpu/drm/drm_bridge_helper.c
+++ b/drivers/gpu/drm/drm_bridge_helper.c
@@ -50,8 +50,6 @@ int drm_bridge_helper_reset_crtc(struct drm_bridge *bridge,
crtc = connector->state->crtc;
ret = drm_atomic_helper_reset_crtc(crtc, ctx);
- if (ret)
- goto out;
out:
drm_modeset_unlock(&dev->mode_config.connection_mutex);
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 13/39] drm/bridge: Add bridge ops for source-side HDMI 2.0 scrambling
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (11 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 12/39] drm/bridge: Remove redundant error check in drm_bridge_helper_reset_crtc() Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 14/39] drm/display: bridge_connector: Use cached connector status in .get_modes() Cristian Ciocaltea
` (26 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Bridges advertising HDMI 2.0 must be able to enable and disable
source-side scrambling and the high TMDS clock ratio when the configured
mode exceeds 340 MHz.
Add .hdmi_scrambler_{enable|disable}() callbacks covering the
source-side programming only; sink-side SCDC negotiation remains the job
of the HDMI connector helpers.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
include/drm/drm_bridge.h | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index 2d8b5e4c64ba..236d1cabe669 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -656,6 +656,41 @@ struct drm_bridge_funcs {
const struct drm_display_mode *mode,
unsigned long long tmds_rate);
+ /**
+ * @hdmi_scrambler_enable:
+ *
+ * Enable source-side scrambling and the high TMDS clock ratio for the
+ * mode currently being applied.
+ *
+ * This only programs the source side. Sink-side SCDC configuration is
+ * handled by the HDMI connector helpers.
+ *
+ * Mandatory for bridges that set the DRM_BRIDGE_OP_HDMI flag in their
+ * &drm_bridge->ops and advertise HDMI_VERSION_2_0 or later via
+ * &drm_bridge->supported_hdmi_ver; unused otherwise.
+ *
+ * Returns:
+ * 0 on success, a negative error code otherwise.
+ */
+ int (*hdmi_scrambler_enable)(struct drm_bridge *bridge);
+
+ /**
+ * @hdmi_scrambler_disable:
+ *
+ * Disable source-side scrambling and the high TMDS clock ratio.
+ *
+ * This only programs the source side. Sink-side SCDC configuration is
+ * handled by the HDMI connector helpers.
+ *
+ * Mandatory for bridges that set the DRM_BRIDGE_OP_HDMI flag in their
+ * &drm_bridge->ops and advertise HDMI_VERSION_2_0 or later via
+ * &drm_bridge->supported_hdmi_ver; unused otherwise.
+ *
+ * Returns:
+ * 0 on success, a negative error code otherwise.
+ */
+ int (*hdmi_scrambler_disable)(struct drm_bridge *bridge);
+
/**
* @hdmi_clear_avi_infoframe:
*
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 14/39] drm/display: bridge_connector: Use cached connector status in .get_modes()
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (12 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 13/39] drm/bridge: Add bridge ops for source-side HDMI 2.0 scrambling Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 15/39] drm/display: bridge_connector: Switch to .detect_ctx() connector helper Cristian Ciocaltea
` (25 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Dmitry Baryshkov
Replace the active drm_bridge_connector_detect() call in get_modes()
with a read of the already-cached connector->status.
The .get_modes() callback is only invoked from
drm_helper_probe_single_connector_modes(), which has already retrieved
the connector status. Calling detect again is redundant and triggers a
duplicate hotplug event. This is also a prerequisite for switching to
the .detect_ctx() hook, which requires a drm_modeset_acquire_ctx not
available in the .get_modes() path.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 46104506fe32..57238ba49d70 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -326,12 +326,10 @@ static const struct drm_connector_funcs drm_bridge_connector_funcs = {
static int drm_bridge_connector_get_modes_edid(struct drm_connector *connector,
struct drm_bridge *bridge)
{
- enum drm_connector_status status;
const struct drm_edid *drm_edid;
int n;
- status = drm_bridge_connector_detect(connector, false);
- if (status != connector_status_connected)
+ if (connector->status != connector_status_connected)
goto no_edid;
drm_edid = drm_bridge_edid_read(bridge, connector);
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 15/39] drm/display: bridge_connector: Switch to .detect_ctx() connector helper
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (13 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 14/39] drm/display: bridge_connector: Use cached connector status in .get_modes() Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 16/39] drm/display: bridge_connector: Wire up HDMI 2.0 scrambler callbacks Cristian Ciocaltea
` (24 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Diederik de Haas, Maud Spierings, Dmitry Baryshkov
Replace the .detect() connector_funcs callback with the atomic-aware
.detect_ctx() connector_helper_funcs hook.
This propagates the modeset acquire context through
drm_atomic_helper_connector_hdmi_hotplug() to the HDMI connector
framework, enabling SCDC state recovery via CRTC reset when the sink
reconnects during an active display pipeline.
Tested-by: Diederik de Haas <diederik@cknow-tech.com>
Tested-by: Maud Spierings <maud_spierings@hotmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 74 ++++++++++++++------------
1 file changed, 39 insertions(+), 35 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 57238ba49d70..17eb2548efad 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -208,40 +208,6 @@ static void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
* Bridge Connector Functions
*/
-static enum drm_connector_status
-drm_bridge_connector_detect(struct drm_connector *connector, bool force)
-{
- struct drm_bridge_connector *bridge_connector =
- to_drm_bridge_connector(connector);
- struct drm_bridge *detect = bridge_connector->bridge_detect;
- struct drm_bridge *hdmi = bridge_connector->bridge_hdmi;
- enum drm_connector_status status;
-
- if (detect) {
- status = detect->funcs->detect(detect, connector);
-
- if (hdmi)
- drm_atomic_helper_connector_hdmi_hotplug(connector, status,
- NULL);
-
- drm_bridge_connector_hpd_notify(connector, status);
- } else {
- switch (connector->connector_type) {
- case DRM_MODE_CONNECTOR_DPI:
- case DRM_MODE_CONNECTOR_LVDS:
- case DRM_MODE_CONNECTOR_DSI:
- case DRM_MODE_CONNECTOR_eDP:
- status = connector_status_connected;
- break;
- default:
- status = connector_status_unknown;
- break;
- }
- }
-
- return status;
-}
-
static void drm_bridge_connector_force(struct drm_connector *connector)
{
struct drm_bridge_connector *bridge_connector =
@@ -308,7 +274,6 @@ drm_bridge_connector_color_format(const struct drm_connector_state *conn_state)
}
static const struct drm_connector_funcs drm_bridge_connector_funcs = {
- .detect = drm_bridge_connector_detect,
.force = drm_bridge_connector_force,
.fill_modes = drm_helper_probe_single_connector_modes,
.atomic_create_state = drm_bridge_connector_create_state,
@@ -323,6 +288,44 @@ static const struct drm_connector_funcs drm_bridge_connector_funcs = {
* Bridge Connector Helper Functions
*/
+static int drm_bridge_connector_detect_ctx(struct drm_connector *connector,
+ struct drm_modeset_acquire_ctx *ctx,
+ bool force)
+{
+ struct drm_bridge_connector *bridge_connector =
+ to_drm_bridge_connector(connector);
+ struct drm_bridge *detect = bridge_connector->bridge_detect;
+ struct drm_bridge *hdmi = bridge_connector->bridge_hdmi;
+ enum drm_connector_status status;
+ int ret;
+
+ if (detect) {
+ status = detect->funcs->detect(detect, connector);
+
+ if (hdmi) {
+ ret = drm_atomic_helper_connector_hdmi_hotplug(connector, status, ctx);
+ if (ret == -EDEADLK)
+ return ret;
+ }
+
+ drm_bridge_connector_hpd_notify(connector, status);
+ } else {
+ switch (connector->connector_type) {
+ case DRM_MODE_CONNECTOR_DPI:
+ case DRM_MODE_CONNECTOR_LVDS:
+ case DRM_MODE_CONNECTOR_DSI:
+ case DRM_MODE_CONNECTOR_eDP:
+ status = connector_status_connected;
+ break;
+ default:
+ status = connector_status_unknown;
+ break;
+ }
+ }
+
+ return status;
+}
+
static int drm_bridge_connector_get_modes_edid(struct drm_connector *connector,
struct drm_bridge *bridge)
{
@@ -414,6 +417,7 @@ static int drm_bridge_connector_atomic_check(struct drm_connector *connector,
static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
.get_modes = drm_bridge_connector_get_modes,
+ .detect_ctx = drm_bridge_connector_detect_ctx,
.mode_valid = drm_bridge_connector_mode_valid,
.enable_hpd = drm_bridge_connector_enable_hpd,
.disable_hpd = drm_bridge_connector_disable_hpd,
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 16/39] drm/display: bridge_connector: Wire up HDMI 2.0 scrambler callbacks
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (14 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 15/39] drm/display: bridge_connector: Switch to .detect_ctx() connector helper Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 17/39] drm/bridge: dw-hdmi-qp: Rate limit i2c read error messages Cristian Ciocaltea
` (23 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Connect the bridge connector's .scrambler_{enable|disable} callbacks to
the underlying bridge's .hdmi_scrambler_{enable|disable} funcs when
HDMI 2.0 conformance is advertised.
This completes the bridge connector plumbing so that the SCDC
scrambling helpers can control source-side scrambling through the
bridge chain.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 40 +++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 17eb2548efad..ceb961a9adb5 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -578,6 +578,32 @@ static int drm_bridge_connector_write_spd_infoframe(struct drm_connector *connec
return bridge->funcs->hdmi_write_spd_infoframe(bridge, buffer, len);
}
+static int drm_bridge_connector_scrambler_enable(struct drm_connector *connector)
+{
+ struct drm_bridge_connector *bridge_connector =
+ to_drm_bridge_connector(connector);
+ struct drm_bridge *bridge;
+
+ bridge = bridge_connector->bridge_hdmi;
+ if (!bridge)
+ return -EINVAL;
+
+ return bridge->funcs->hdmi_scrambler_enable(bridge);
+}
+
+static int drm_bridge_connector_scrambler_disable(struct drm_connector *connector)
+{
+ struct drm_bridge_connector *bridge_connector =
+ to_drm_bridge_connector(connector);
+ struct drm_bridge *bridge;
+
+ bridge = bridge_connector->bridge_hdmi;
+ if (!bridge)
+ return -EINVAL;
+
+ return bridge->funcs->hdmi_scrambler_disable(bridge);
+}
+
static const struct drm_edid *
drm_bridge_connector_read_edid(struct drm_connector *connector)
{
@@ -603,7 +629,7 @@ static const struct drm_connector_hdmi_funcs drm_bridge_connector_hdmi_funcs = {
.clear_infoframe = drm_bridge_connector_clear_hdmi_infoframe,
.write_infoframe = drm_bridge_connector_write_hdmi_infoframe,
},
- /* audio, hdr_drm and spd are set dynamically during init */
+ /* scrambler, audio, hdr_drm and spd are set dynamically during init */
};
static const struct drm_connector_infoframe_funcs drm_bridge_connector_hdmi_audio_infoframe = {
@@ -912,6 +938,11 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
!bridge->funcs->hdmi_clear_spd_infoframe))
return ERR_PTR(-EINVAL);
+ if (bridge->supported_hdmi_ver >= HDMI_VERSION_2_0 &&
+ (!bridge->funcs->hdmi_scrambler_enable ||
+ !bridge->funcs->hdmi_scrambler_disable))
+ return ERR_PTR(-EINVAL);
+
bridge_connector->bridge_hdmi = drm_bridge_get(bridge);
if (bridge->supported_hdmi_ver)
@@ -1018,6 +1049,13 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
bridge_connector->hdmi_funcs.spd =
drm_bridge_connector_hdmi_spd_infoframe;
+ if (bridge_connector->bridge_hdmi->supported_hdmi_ver >= HDMI_VERSION_2_0) {
+ bridge_connector->hdmi_funcs.scrambler_enable =
+ drm_bridge_connector_scrambler_enable;
+ bridge_connector->hdmi_funcs.scrambler_disable =
+ drm_bridge_connector_scrambler_disable;
+ }
+
ret = drmm_connector_hdmi_init_with_caps(drm, connector,
bridge_connector->bridge_hdmi->vendor,
bridge_connector->bridge_hdmi->product,
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 17/39] drm/bridge: dw-hdmi-qp: Rate limit i2c read error messages
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (15 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 16/39] drm/display: bridge_connector: Wire up HDMI 2.0 scrambler callbacks Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 18/39] drm/bridge: dw-hdmi-qp: Provide .{enable|disable}_hpd() PHY ops Cristian Ciocaltea
` (22 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
During EDID reads, repeated i2c errors can flood the kernel log:
[ 25.361716] dwhdmiqp-rockchip fde80000.hdmi: i2c read error
[ 25.363376] dwhdmiqp-rockchip fde80000.hdmi: i2c read error
...
[ 25.368671] dwhdmiqp-rockchip fde80000.hdmi: i2c read error
[ 25.369440] dwhdmiqp-rockchip fde80000.hdmi: failed to get edid
Switch to dev_err_ratelimited() in dw_hdmi_qp_i2c_read() to reduce log
spam while still reporting the condition.
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index cfd1b18c06e6..7475b6b71836 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -561,7 +561,7 @@ static int dw_hdmi_qp_i2c_read(struct dw_hdmi_qp *hdmi,
dev_dbg_ratelimited(hdmi->dev,
"i2c read timed out\n");
else
- dev_err(hdmi->dev, "i2c read timed out\n");
+ dev_err_ratelimited(hdmi->dev, "i2c read timed out\n");
dw_hdmi_qp_write(hdmi, 0x01, I2CM_CONTROL0);
return -EAGAIN;
}
@@ -572,7 +572,7 @@ static int dw_hdmi_qp_i2c_read(struct dw_hdmi_qp *hdmi,
dev_dbg_ratelimited(hdmi->dev,
"i2c read error\n");
else
- dev_err(hdmi->dev, "i2c read error\n");
+ dev_err_ratelimited(hdmi->dev, "i2c read error\n");
dw_hdmi_qp_write(hdmi, 0x01, I2CM_CONTROL0);
return -EIO;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 18/39] drm/bridge: dw-hdmi-qp: Provide .{enable|disable}_hpd() PHY ops
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (16 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 17/39] drm/bridge: dw-hdmi-qp: Rate limit i2c read error messages Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 19/39] drm/bridge: dw-hdmi-qp: Add HDMI 2.0 SCDC scrambling support Cristian Ciocaltea
` (21 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Implement the .hpd_enable() and .hpd_disable() bridge callbacks and
extend dw_hdmi_qp_phy_ops with corresponding hooks.
This enables the DRM core to control when HPD interrupts are armed,
which is needed to prevent premature interrupt delivery before the
connector is fully initialized, and to properly quiesce HPD during
suspend.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 18 ++++++++++++++++++
include/drm/bridge/dw_hdmi_qp.h | 2 ++
2 files changed, 20 insertions(+)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index 7475b6b71836..a0613f0d2ebc 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -1189,6 +1189,22 @@ static int dw_hdmi_qp_cec_transmit(struct drm_bridge *bridge, u8 attempts,
#define dw_hdmi_qp_cec_transmit NULL
#endif /* CONFIG_DRM_DW_HDMI_QP_CEC */
+static void dw_hdmi_qp_bridge_hpd_enable(struct drm_bridge *bridge)
+{
+ struct dw_hdmi_qp *hdmi = bridge->driver_private;
+
+ if (hdmi->phy.ops->enable_hpd)
+ hdmi->phy.ops->enable_hpd(hdmi, hdmi->phy.data);
+}
+
+static void dw_hdmi_qp_bridge_hpd_disable(struct drm_bridge *bridge)
+{
+ struct dw_hdmi_qp *hdmi = bridge->driver_private;
+
+ if (hdmi->phy.ops->disable_hpd)
+ hdmi->phy.ops->disable_hpd(hdmi, hdmi->phy.data);
+}
+
static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = {
.atomic_get_output_bus_fmts = drm_atomic_helper_bridge_get_hdmi_output_bus_fmts,
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
@@ -1197,6 +1213,8 @@ static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = {
.atomic_enable = dw_hdmi_qp_bridge_atomic_enable,
.atomic_disable = dw_hdmi_qp_bridge_atomic_disable,
.detect = dw_hdmi_qp_bridge_detect,
+ .hpd_enable = dw_hdmi_qp_bridge_hpd_enable,
+ .hpd_disable = dw_hdmi_qp_bridge_hpd_disable,
.edid_read = dw_hdmi_qp_bridge_edid_read,
.hdmi_tmds_char_rate_valid = dw_hdmi_qp_bridge_tmds_char_rate_valid,
.hdmi_clear_avi_infoframe = dw_hdmi_qp_bridge_clear_avi_infoframe,
diff --git a/include/drm/bridge/dw_hdmi_qp.h b/include/drm/bridge/dw_hdmi_qp.h
index 6ea9c561cfef..b80fceffc315 100644
--- a/include/drm/bridge/dw_hdmi_qp.h
+++ b/include/drm/bridge/dw_hdmi_qp.h
@@ -17,6 +17,8 @@ struct dw_hdmi_qp_phy_ops {
void (*disable)(struct dw_hdmi_qp *hdmi, void *data);
enum drm_connector_status (*read_hpd)(struct dw_hdmi_qp *hdmi, void *data);
void (*setup_hpd)(struct dw_hdmi_qp *hdmi, void *data);
+ void (*enable_hpd)(struct dw_hdmi_qp *hdmi, void *data);
+ void (*disable_hpd)(struct dw_hdmi_qp *hdmi, void *data);
};
struct dw_hdmi_qp_plat_data {
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 19/39] drm/bridge: dw-hdmi-qp: Add HDMI 2.0 SCDC scrambling support
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (17 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 18/39] drm/bridge: dw-hdmi-qp: Provide .{enable|disable}_hpd() PHY ops Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 20/39] drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper Cristian Ciocaltea
` (20 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Diederik de Haas, Maud Spierings
Enable HDMI 2.0 display modes (e.g. 4K@60Hz) by implementing SCDC
scrambling and high TMDS clock ratio management for TMDS character
rates exceeding the 340 MHz HDMI 1.4b limit.
Reject modes requiring TMDS rates above 600 MHz since those require
HDMI 2.1 FRL which is not yet supported. In no_hpd configurations,
further restrict to 340 MHz because SCDC requires a connected sink.
Tested-by: Diederik de Haas <diederik@cknow-tech.com>
Tested-by: Maud Spierings <maud_spierings@hotmail.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 73 ++++++++++++++++++++--------
1 file changed, 54 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index a0613f0d2ebc..07b274f76e53 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -2,6 +2,7 @@
/*
* Copyright (c) 2021-2022 Rockchip Electronics Co., Ltd.
* Copyright (c) 2024 Collabora Ltd.
+ * Copyright (c) 2025 Amazon.com, Inc. or its affiliates.
*
* Author: Algea Cao <algea.cao@rock-chips.com>
* Author: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
@@ -15,7 +16,6 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
-#include <linux/workqueue.h>
#include <drm/bridge/dw_hdmi_qp.h>
#include <drm/display/drm_hdmi_helper.h>
@@ -38,8 +38,6 @@
#define DDC_CI_ADDR 0x37
#define DDC_SEGMENT_ADDR 0x30
-#define SCRAMB_POLL_DELAY_MS 3000
-
/*
* Unless otherwise noted, entries in this table are 100% optimization.
* Values can be obtained from dw_hdmi_qp_compute_n() but that function is
@@ -162,6 +160,7 @@ struct dw_hdmi_qp {
} phy;
unsigned long ref_clk_rate;
+ struct drm_connector *curr_conn;
struct regmap *regm;
int main_irq;
@@ -752,26 +751,33 @@ static void dw_hdmi_qp_bridge_atomic_enable(struct drm_bridge *bridge,
{
struct dw_hdmi_qp *hdmi = bridge->driver_private;
struct drm_connector_state *conn_state;
- struct drm_connector *connector;
unsigned int op_mode;
+ int ret;
- connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
- if (WARN_ON(!connector))
+ hdmi->curr_conn = drm_atomic_get_new_connector_for_encoder(state,
+ bridge->encoder);
+ if (WARN_ON(!hdmi->curr_conn))
return;
- conn_state = drm_atomic_get_new_connector_state(state, connector);
+ conn_state = drm_atomic_get_new_connector_state(state, hdmi->curr_conn);
if (WARN_ON(!conn_state))
return;
- if (connector->display_info.is_hdmi) {
- dev_dbg(hdmi->dev, "%s mode=HDMI %s rate=%llu bpc=%u\n", __func__,
- drm_hdmi_connector_get_output_format_name(conn_state->hdmi.output_format),
- conn_state->hdmi.tmds_char_rate, conn_state->hdmi.output_bpc);
+ if (hdmi->curr_conn->display_info.is_hdmi) {
op_mode = 0;
hdmi->tmds_char_rate = conn_state->hdmi.tmds_char_rate;
+
+ ret = drm_connector_hdmi_enable_scrambling(hdmi->curr_conn, conn_state);
+ if (ret)
+ dev_warn(hdmi->dev, "Failed to setup SCDC: %d\n", ret);
+
+ dev_dbg(hdmi->dev, "%s mode=HDMI %s rate=%llu bpc=%u scramb=%d\n", __func__,
+ drm_hdmi_connector_get_output_format_name(conn_state->hdmi.output_format),
+ conn_state->hdmi.tmds_char_rate, conn_state->hdmi.output_bpc,
+ hdmi->curr_conn->hdmi.scrambler_enabled);
} else {
- dev_dbg(hdmi->dev, "%s mode=DVI\n", __func__);
op_mode = OPMODE_DVI;
+ dev_dbg(hdmi->dev, "%s mode=DVI\n", __func__);
}
hdmi->phy.ops->init(hdmi, hdmi->phy.data);
@@ -779,7 +785,7 @@ static void dw_hdmi_qp_bridge_atomic_enable(struct drm_bridge *bridge,
dw_hdmi_qp_mod(hdmi, HDCP2_BYPASS, HDCP2_BYPASS, HDCP2LOGIC_CONFIG0);
dw_hdmi_qp_mod(hdmi, op_mode, OPMODE_DVI, LINK_CONFIG0);
- drm_atomic_helper_connector_hdmi_update_infoframes(connector, state);
+ drm_atomic_helper_connector_hdmi_update_infoframes(hdmi->curr_conn, state);
}
static void dw_hdmi_qp_bridge_atomic_disable(struct drm_bridge *bridge,
@@ -787,8 +793,14 @@ static void dw_hdmi_qp_bridge_atomic_disable(struct drm_bridge *bridge,
{
struct dw_hdmi_qp *hdmi = bridge->driver_private;
+ if (!hdmi->curr_conn)
+ return;
+
hdmi->tmds_char_rate = 0;
+ drm_connector_hdmi_disable_scrambling(hdmi->curr_conn);
+
+ hdmi->curr_conn = NULL;
hdmi->phy.ops->disable(hdmi, hdmi->phy.data);
}
@@ -830,12 +842,12 @@ dw_hdmi_qp_bridge_tmds_char_rate_valid(const struct drm_bridge *bridge,
{
struct dw_hdmi_qp *hdmi = bridge->driver_private;
- /*
- * TODO: when hdmi->no_hpd is 1 we must not support modes that
- * require scrambling, including every mode with a clock above
- * HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ.
- */
- if (rate > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ) {
+ if (hdmi->no_hpd && rate > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ) {
+ dev_dbg(hdmi->dev, "Unsupported TMDS char rate in no_hpd mode: %lld\n", rate);
+ return MODE_CLOCK_HIGH;
+ }
+
+ if (rate > HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ) {
dev_dbg(hdmi->dev, "Unsupported TMDS char rate: %lld\n", rate);
return MODE_CLOCK_HIGH;
}
@@ -843,6 +855,26 @@ dw_hdmi_qp_bridge_tmds_char_rate_valid(const struct drm_bridge *bridge,
return MODE_OK;
}
+static int dw_hdmi_qp_bridge_scrambler_enable(struct drm_bridge *bridge)
+{
+ struct dw_hdmi_qp *hdmi = bridge->driver_private;
+
+ dw_hdmi_qp_write(hdmi, 1, SCRAMB_CONFIG0);
+ dev_dbg(hdmi->dev, "scrambler enabled\n");
+
+ return 0;
+}
+
+static int dw_hdmi_qp_bridge_scrambler_disable(struct drm_bridge *bridge)
+{
+ struct dw_hdmi_qp *hdmi = bridge->driver_private;
+
+ dw_hdmi_qp_write(hdmi, 0, SCRAMB_CONFIG0);
+ dev_dbg(hdmi->dev, "scrambler disabled\n");
+
+ return 0;
+}
+
static int dw_hdmi_qp_bridge_clear_avi_infoframe(struct drm_bridge *bridge)
{
struct dw_hdmi_qp *hdmi = bridge->driver_private;
@@ -1217,6 +1249,8 @@ static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = {
.hpd_disable = dw_hdmi_qp_bridge_hpd_disable,
.edid_read = dw_hdmi_qp_bridge_edid_read,
.hdmi_tmds_char_rate_valid = dw_hdmi_qp_bridge_tmds_char_rate_valid,
+ .hdmi_scrambler_enable = dw_hdmi_qp_bridge_scrambler_enable,
+ .hdmi_scrambler_disable = dw_hdmi_qp_bridge_scrambler_disable,
.hdmi_clear_avi_infoframe = dw_hdmi_qp_bridge_clear_avi_infoframe,
.hdmi_write_avi_infoframe = dw_hdmi_qp_bridge_write_avi_infoframe,
.hdmi_clear_hdmi_infoframe = dw_hdmi_qp_bridge_clear_hdmi_infoframe,
@@ -1350,6 +1384,7 @@ struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
hdmi->bridge.vendor = "Synopsys";
hdmi->bridge.product = "DW HDMI QP TX";
+ hdmi->bridge.supported_hdmi_ver = HDMI_VERSION_2_0;
if (plat_data->supported_formats)
hdmi->bridge.supported_formats = plat_data->supported_formats;
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 20/39] drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (18 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 19/39] drm/bridge: dw-hdmi-qp: Add HDMI 2.0 SCDC scrambling support Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 21/39] drm/rockchip: dw_hdmi_qp: Add missing newlines in dev_err_probe() messages Cristian Ciocaltea
` (19 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Export dw_hdmi_qp_hpd_notify() for platform drivers to report hot-plug
detection events. Unlike drm_helper_hpd_irq_event() which polls all
connectors, this helper targets only the affected connector and ensures
.detect_ctx() is invoked on reconnection events to trigger SCDC state
recovery.
Note that this helper may sleep, so it must only be called from a
threaded HPD interrupt handler or a work function.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 31 ++++++++++++++++++++++++++++
include/drm/bridge/dw_hdmi_qp.h | 1 +
2 files changed, 32 insertions(+)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index 07b274f76e53..4d41ad7319a5 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -28,6 +28,7 @@
#include <drm/drm_edid.h>
#include <drm/drm_modes.h>
#include <drm/drm_print.h>
+#include <drm/drm_probe_helper.h>
#include <media/cec.h>
@@ -1429,6 +1430,36 @@ struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
}
EXPORT_SYMBOL_GPL(dw_hdmi_qp_bind);
+/**
+ * dw_hdmi_qp_hpd_notify() - Notify a hot-plug detection event
+ * @hdmi: pointer to the DW HDMI QP controller
+ *
+ * Platform drivers should call this from their threaded IRQ handler or work
+ * function to notify the bridge of a connection status change.
+ * The bridge's .read_hpd() phy_ops callback is used to read the current
+ * connection status.
+ */
+void dw_hdmi_qp_hpd_notify(struct dw_hdmi_qp *hdmi)
+{
+ enum drm_connector_status status;
+
+ status = hdmi->phy.ops->read_hpd(hdmi, hdmi->phy.data);
+ dev_dbg(hdmi->dev, "%s status=%d\n", __func__, status);
+
+ /*
+ * When the display pipeline has been already active, switch to
+ * drm_connector_helper_hpd_irq_event() to ensure .detect_ctx()
+ * gets invoked, i.e. via drm_helper_probe_detect(), because
+ * drm_bridge_hpd_notify() defers to a delayed hotplug path in
+ * this case.
+ */
+ if (hdmi->curr_conn && status == connector_status_connected)
+ drm_connector_helper_hpd_irq_event(hdmi->curr_conn);
+ else
+ drm_bridge_hpd_notify(&hdmi->bridge, status);
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_qp_hpd_notify);
+
void dw_hdmi_qp_suspend(struct device *dev, struct dw_hdmi_qp *hdmi)
{
disable_irq(hdmi->main_irq);
diff --git a/include/drm/bridge/dw_hdmi_qp.h b/include/drm/bridge/dw_hdmi_qp.h
index b80fceffc315..b4fb1c578a5b 100644
--- a/include/drm/bridge/dw_hdmi_qp.h
+++ b/include/drm/bridge/dw_hdmi_qp.h
@@ -36,6 +36,7 @@ struct dw_hdmi_qp_plat_data {
struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
struct drm_encoder *encoder,
const struct dw_hdmi_qp_plat_data *plat_data);
+void dw_hdmi_qp_hpd_notify(struct dw_hdmi_qp *hdmi);
void dw_hdmi_qp_suspend(struct device *dev, struct dw_hdmi_qp *hdmi);
void dw_hdmi_qp_resume(struct device *dev, struct dw_hdmi_qp *hdmi);
#endif /* __DW_HDMI_QP__ */
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 21/39] drm/rockchip: dw_hdmi_qp: Add missing newlines in dev_err_probe() messages
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (19 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 20/39] drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 22/39] drm/rockchip: dw_hdmi_qp: Use local dev variable consistently in bind() Cristian Ciocaltea
` (18 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Add the missing trailing newlines to a couple of dev_err_probe() calls
in dw_hdmi_qp_rockchip_bind().
Fixes: b6736a4ea3fa ("drm/rockchip: dw_hdmi_qp: Improve error handling with dev_err_probe()")
Fixes: e1f7b7cbd74c ("drm/rockchip: dw_hdmi_qp: Switch to drmm_encoder_init()")
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index 815f9ea7bcbe..7bd0f6dcbe5d 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -682,14 +682,14 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
drm_encoder_helper_add(encoder, &dw_hdmi_qp_rockchip_encoder_helper_funcs);
ret = drmm_encoder_init(drm, encoder, NULL, DRM_MODE_ENCODER_TMDS, NULL);
if (ret)
- return dev_err_probe(hdmi->dev, ret, "Failed to init encoder");
+ return dev_err_probe(hdmi->dev, ret, "Failed to init encoder\n");
platform_set_drvdata(pdev, hdmi);
hdmi->hdmi = dw_hdmi_qp_bind(pdev, encoder, &plat_data);
if (IS_ERR(hdmi->hdmi))
return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->hdmi),
- "Failed to bind dw-hdmi-qp");
+ "Failed to bind dw-hdmi-qp\n");
connector = drm_bridge_connector_init(drm, encoder);
if (IS_ERR(connector))
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 22/39] drm/rockchip: dw_hdmi_qp: Use local dev variable consistently in bind()
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (20 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 21/39] drm/rockchip: dw_hdmi_qp: Add missing newlines in dev_err_probe() messages Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 23/39] drm/rockchip: dw_hdmi_qp: Drop unnecessary #include Cristian Ciocaltea
` (17 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Replace indirect struct device accesses via hdmi->dev and pdev->dev with
the local dev parameter already available in dw_hdmi_qp_rockchip_bind(),
for consistency and readability.
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 33 +++++++++++++-------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index 7bd0f6dcbe5d..d2fcfa70ed16 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -564,7 +564,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
struct clk *ref_clk;
int ret, irq, i;
- if (!pdev->dev.of_node)
+ if (!dev->of_node)
return -ENODEV;
hdmi = drmm_kzalloc(drm, sizeof(*hdmi), GFP_KERNEL);
@@ -584,7 +584,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
return dev_err_probe(dev, -ENODEV, "Missing platform ctrl ops\n");
hdmi->ctrl_ops = cfg->ctrl_ops;
- hdmi->dev = &pdev->dev;
+ hdmi->dev = dev;
hdmi->port_id = -ENODEV;
/* Identify port ID by matching base IO address */
@@ -595,7 +595,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
}
}
if (hdmi->port_id < 0)
- return dev_err_probe(hdmi->dev, hdmi->port_id,
+ return dev_err_probe(dev, hdmi->port_id,
"Failed to match HDMI port ID\n");
plat_data.phy_ops = cfg->phy_ops;
@@ -623,37 +623,36 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
hdmi->regmap = syscon_regmap_lookup_by_phandle(dev->of_node,
"rockchip,grf");
if (IS_ERR(hdmi->regmap))
- return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->regmap),
+ return dev_err_probe(dev, PTR_ERR(hdmi->regmap),
"Unable to get rockchip,grf\n");
hdmi->vo_regmap = syscon_regmap_lookup_by_phandle(dev->of_node,
"rockchip,vo-grf");
if (IS_ERR(hdmi->vo_regmap))
- return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->vo_regmap),
+ return dev_err_probe(dev, PTR_ERR(hdmi->vo_regmap),
"Unable to get rockchip,vo-grf\n");
- ret = devm_clk_bulk_get_all_enabled(hdmi->dev, &clks);
+ ret = devm_clk_bulk_get_all_enabled(dev, &clks);
if (ret < 0)
- return dev_err_probe(hdmi->dev, ret, "Failed to get clocks\n");
+ return dev_err_probe(dev, ret, "Failed to get clocks\n");
- ref_clk = clk_get(hdmi->dev, "ref");
+ ref_clk = clk_get(dev, "ref");
if (IS_ERR(ref_clk))
- return dev_err_probe(hdmi->dev, PTR_ERR(ref_clk),
+ return dev_err_probe(dev, PTR_ERR(ref_clk),
"Failed to get ref clock\n");
plat_data.ref_clk_rate = clk_get_rate(ref_clk);
clk_put(ref_clk);
- hdmi->frl_enable_gpio = devm_gpiod_get_optional(hdmi->dev, "frl-enable",
+ hdmi->frl_enable_gpio = devm_gpiod_get_optional(dev, "frl-enable",
GPIOD_OUT_LOW);
if (IS_ERR(hdmi->frl_enable_gpio))
- return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->frl_enable_gpio),
+ return dev_err_probe(dev, PTR_ERR(hdmi->frl_enable_gpio),
"Failed to request FRL enable GPIO\n");
hdmi->phy = devm_of_phy_get_by_index(dev, dev->of_node, 0);
if (IS_ERR(hdmi->phy))
- return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->phy),
- "Failed to get phy\n");
+ return dev_err_probe(dev, PTR_ERR(hdmi->phy), "Failed to get phy\n");
cfg->ctrl_ops->io_init(hdmi);
@@ -671,7 +670,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
if (irq < 0)
return irq;
- ret = devm_request_threaded_irq(hdmi->dev, irq,
+ ret = devm_request_threaded_irq(dev, irq,
cfg->ctrl_ops->hardirq_callback,
cfg->ctrl_ops->irq_callback,
IRQF_SHARED, "dw-hdmi-qp-hpd",
@@ -682,18 +681,18 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
drm_encoder_helper_add(encoder, &dw_hdmi_qp_rockchip_encoder_helper_funcs);
ret = drmm_encoder_init(drm, encoder, NULL, DRM_MODE_ENCODER_TMDS, NULL);
if (ret)
- return dev_err_probe(hdmi->dev, ret, "Failed to init encoder\n");
+ return dev_err_probe(dev, ret, "Failed to init encoder\n");
platform_set_drvdata(pdev, hdmi);
hdmi->hdmi = dw_hdmi_qp_bind(pdev, encoder, &plat_data);
if (IS_ERR(hdmi->hdmi))
- return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->hdmi),
+ return dev_err_probe(dev, PTR_ERR(hdmi->hdmi),
"Failed to bind dw-hdmi-qp\n");
connector = drm_bridge_connector_init(drm, encoder);
if (IS_ERR(connector))
- return dev_err_probe(hdmi->dev, PTR_ERR(connector),
+ return dev_err_probe(dev, PTR_ERR(connector),
"Failed to init bridge connector\n");
return 0;
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 23/39] drm/rockchip: dw_hdmi_qp: Drop unnecessary #include
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (21 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 22/39] drm/rockchip: dw_hdmi_qp: Use local dev variable consistently in bind() Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 24/39] drm/rockchip: dw_hdmi_qp: Defer HPD IRQ enable until after connector setup Cristian Ciocaltea
` (16 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Remove superfluous drm_simple_kms_helper.h include, which has no users
in this file since commit e1f7b7cbd74c ("drm/rockchip: dw_hdmi_qp:
Switch to drmm_encoder_init()").
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index d2fcfa70ed16..33036f194e34 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -25,7 +25,6 @@
#include <drm/drm_managed.h>
#include <drm/drm_of.h>
#include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
#include "rockchip_drm_drv.h"
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 24/39] drm/rockchip: dw_hdmi_qp: Defer HPD IRQ enable until after connector setup
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (22 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 23/39] drm/rockchip: dw_hdmi_qp: Drop unnecessary #include Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 25/39] drm/rockchip: dw_hdmi_qp: Mask RK3576 HPD IRQ in io_init Cristian Ciocaltea
` (15 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Dmitry Baryshkov
Request the HPD IRQ early in bind() with IRQF_NO_AUTOEN, keeping it
disabled until all DRM resources are fully initialized, at which point
enable_irq() arms it. This prevents premature interrupt delivery
without forcing devm_request_threaded_irq() to the very end of the
initialization sequence, which would complicate error unwinding.
Note that IRQF_NO_AUTOEN is incompatible with IRQF_SHARED; the latter is
dropped as this IRQ has no other users.
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index 33036f194e34..3de4b3e6ea85 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -672,7 +672,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
ret = devm_request_threaded_irq(dev, irq,
cfg->ctrl_ops->hardirq_callback,
cfg->ctrl_ops->irq_callback,
- IRQF_SHARED, "dw-hdmi-qp-hpd",
+ IRQF_NO_AUTOEN, "dw-hdmi-qp-hpd",
hdmi);
if (ret)
return ret;
@@ -694,6 +694,8 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
return dev_err_probe(dev, PTR_ERR(connector),
"Failed to init bridge connector\n");
+ enable_irq(irq);
+
return 0;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 25/39] drm/rockchip: dw_hdmi_qp: Mask RK3576 HPD IRQ in io_init
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (23 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 24/39] drm/rockchip: dw_hdmi_qp: Defer HPD IRQ enable until after connector setup Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 26/39] drm/rockchip: dw_hdmi_qp: Implement .{enable|disable}_hpd() PHY ops Cristian Ciocaltea
` (14 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Start with HPD masked, matching RK3588, so the bridge framework controls
when interrupts are armed via hpd_enable().
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index 3de4b3e6ea85..11ca73ca4caf 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -427,7 +427,7 @@ static void dw_hdmi_qp_rk3576_io_init(struct rockchip_hdmi_qp *hdmi)
regmap_write(hdmi->vo_regmap, RK3576_VO0_GRF_SOC_CON14, val);
- val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 0);
+ val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1);
regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val);
}
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 26/39] drm/rockchip: dw_hdmi_qp: Implement .{enable|disable}_hpd() PHY ops
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (24 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 25/39] drm/rockchip: dw_hdmi_qp: Mask RK3576 HPD IRQ in io_init Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 27/39] drm/rockchip: dw_hdmi_qp: Use dw_hdmi_qp_hpd_notify() for HPD reports Cristian Ciocaltea
` (13 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Implement .enable_hpd() and .disable_hpd() phy ops for RK3576 and RK3588
SoCs, used by the corresponding bridge callbacks for HPD activation
control.
Consolidate the interrupt clear-and-unmask sequence into enable_hpd()
and the mask-only operation into disable_hpd(), replacing the open-coded
register writes in the interrupt handlers and io_init().
The .setup_hpd() phy op, which was previously called from
dw_hdmi_qp_init_hw(), is no longer needed and its users are removed.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 78 +++++++++++++-------------
1 file changed, 38 insertions(+), 40 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index 11ca73ca4caf..c8675f43c687 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -274,7 +274,7 @@ dw_hdmi_qp_rk3588_read_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
return val ? connector_status_connected : connector_status_disconnected;
}
-static void dw_hdmi_qp_rk3588_setup_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
+static void dw_hdmi_qp_rk3588_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
{
struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data;
u32 val;
@@ -289,11 +289,25 @@ static void dw_hdmi_qp_rk3588_setup_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val);
}
+static void dw_hdmi_qp_rk3588_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
+{
+ struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data;
+ u32 val;
+
+ if (hdmi->port_id)
+ val = FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_MSK, 1);
+ else
+ val = FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_MSK, 1);
+
+ regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val);
+}
+
static const struct dw_hdmi_qp_phy_ops rk3588_hdmi_phy_ops = {
.init = dw_hdmi_qp_rk3588_phy_init,
.disable = dw_hdmi_qp_rk3588_phy_disable,
.read_hpd = dw_hdmi_qp_rk3588_read_hpd,
- .setup_hpd = dw_hdmi_qp_rk3588_setup_hpd,
+ .enable_hpd = dw_hdmi_qp_rk3588_enable_hpd,
+ .disable_hpd = dw_hdmi_qp_rk3588_disable_hpd,
};
static enum drm_connector_status
@@ -308,7 +322,7 @@ dw_hdmi_qp_rk3576_read_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
connector_status_connected : connector_status_disconnected;
}
-static void dw_hdmi_qp_rk3576_setup_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
+static void dw_hdmi_qp_rk3576_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
{
struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data;
u32 val;
@@ -317,14 +331,22 @@ static void dw_hdmi_qp_rk3576_setup_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 0));
regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val);
- regmap_write(hdmi->regmap, 0xa404, 0xffff0102);
+}
+
+static void dw_hdmi_qp_rk3576_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data)
+{
+ struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data;
+
+ regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0,
+ FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1));
}
static const struct dw_hdmi_qp_phy_ops rk3576_hdmi_phy_ops = {
.init = dw_hdmi_qp_rk3588_phy_init,
.disable = dw_hdmi_qp_rk3588_phy_disable,
.read_hpd = dw_hdmi_qp_rk3576_read_hpd,
- .setup_hpd = dw_hdmi_qp_rk3576_setup_hpd,
+ .enable_hpd = dw_hdmi_qp_rk3576_enable_hpd,
+ .disable_hpd = dw_hdmi_qp_rk3576_disable_hpd,
};
static void dw_hdmi_qp_rk3588_hpd_work(struct work_struct *work)
@@ -345,13 +367,12 @@ static void dw_hdmi_qp_rk3588_hpd_work(struct work_struct *work)
static irqreturn_t dw_hdmi_qp_rk3576_hardirq(int irq, void *dev_id)
{
struct rockchip_hdmi_qp *hdmi = dev_id;
- u32 intr_stat, val;
+ u32 intr_stat;
regmap_read(hdmi->regmap, RK3576_IOC_HDMI_HPD_STATUS, &intr_stat);
- if (intr_stat) {
- val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1);
- regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val);
+ if (intr_stat) {
+ dw_hdmi_qp_rk3576_disable_hpd(NULL, hdmi);
return IRQ_WAKE_THREAD;
}
@@ -361,15 +382,11 @@ static irqreturn_t dw_hdmi_qp_rk3576_hardirq(int irq, void *dev_id)
static irqreturn_t dw_hdmi_qp_rk3576_irq(int irq, void *dev_id)
{
struct rockchip_hdmi_qp *hdmi = dev_id;
- u32 val;
- val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_CLR, 1);
- regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val);
mod_delayed_work(system_percpu_wq, &hdmi->hpd_work,
msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS));
- val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 0);
- regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val);
+ dw_hdmi_qp_rk3576_enable_hpd(NULL, hdmi);
return IRQ_HANDLED;
}
@@ -377,16 +394,12 @@ static irqreturn_t dw_hdmi_qp_rk3576_irq(int irq, void *dev_id)
static irqreturn_t dw_hdmi_qp_rk3588_hardirq(int irq, void *dev_id)
{
struct rockchip_hdmi_qp *hdmi = dev_id;
- u32 intr_stat, val;
+ u32 intr_stat;
regmap_read(hdmi->regmap, RK3588_GRF_SOC_STATUS1, &intr_stat);
if (intr_stat) {
- if (hdmi->port_id)
- val = FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_MSK, 1);
- else
- val = FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_MSK, 1);
- regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val);
+ dw_hdmi_qp_rk3588_disable_hpd(NULL, hdmi);
return IRQ_WAKE_THREAD;
}
@@ -396,22 +409,11 @@ static irqreturn_t dw_hdmi_qp_rk3588_hardirq(int irq, void *dev_id)
static irqreturn_t dw_hdmi_qp_rk3588_irq(int irq, void *dev_id)
{
struct rockchip_hdmi_qp *hdmi = dev_id;
- u32 val;
-
- if (hdmi->port_id)
- val = FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_CLR, 1);
- else
- val = FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_CLR, 1);
- regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val);
mod_delayed_work(system_percpu_wq, &hdmi->hpd_work,
msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS));
- if (hdmi->port_id)
- val |= FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_MSK, 0);
- else
- val |= FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_MSK, 0);
- regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val);
+ dw_hdmi_qp_rk3588_enable_hpd(NULL, hdmi);
return IRQ_HANDLED;
}
@@ -424,11 +426,11 @@ static void dw_hdmi_qp_rk3576_io_init(struct rockchip_hdmi_qp *hdmi)
FIELD_PREP_WM16(RK3576_SDAIN_MASK, 1) |
FIELD_PREP_WM16(RK3576_HDMI_GRANT_SEL, 1) |
FIELD_PREP_WM16(RK3576_I2S_SEL_MASK, 1);
-
regmap_write(hdmi->vo_regmap, RK3576_VO0_GRF_SOC_CON14, val);
- val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1);
- regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val);
+ regmap_write(hdmi->regmap, 0xa404, 0xffff0102);
+
+ dw_hdmi_qp_rk3576_disable_hpd(NULL, hdmi);
}
static void dw_hdmi_qp_rk3588_io_init(struct rockchip_hdmi_qp *hdmi)
@@ -453,11 +455,7 @@ static void dw_hdmi_qp_rk3588_io_init(struct rockchip_hdmi_qp *hdmi)
val = FIELD_PREP_WM16(RK3588_HDMI0_GRANT_SEL, 1);
regmap_write(hdmi->vo_regmap, RK3588_GRF_VO1_CON9, val);
- if (hdmi->port_id)
- val = FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_MSK, 1);
- else
- val = FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_MSK, 1);
- regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val);
+ dw_hdmi_qp_rk3588_disable_hpd(NULL, hdmi);
}
static void dw_hdmi_qp_rk3576_enc_init(struct rockchip_hdmi_qp *hdmi,
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 27/39] drm/rockchip: dw_hdmi_qp: Use dw_hdmi_qp_hpd_notify() for HPD reports
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (25 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 26/39] drm/rockchip: dw_hdmi_qp: Implement .{enable|disable}_hpd() PHY ops Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 28/39] drm/bridge: dw-hdmi-qp: Drop unused .setup_hpd() phy op Cristian Ciocaltea
` (12 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Notify only the affected connector instead of polling all of them, and
ensure .detect_ctx() runs on reconnect to recover SCDC state.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index c8675f43c687..9bced588c86c 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -24,7 +24,6 @@
#include <drm/drm_bridge_connector.h>
#include <drm/drm_managed.h>
#include <drm/drm_of.h>
-#include <drm/drm_probe_helper.h>
#include "rockchip_drm_drv.h"
@@ -354,14 +353,8 @@ static void dw_hdmi_qp_rk3588_hpd_work(struct work_struct *work)
struct rockchip_hdmi_qp *hdmi = container_of(work,
struct rockchip_hdmi_qp,
hpd_work.work);
- struct drm_device *drm = hdmi->encoder.encoder.dev;
- bool changed;
- if (drm) {
- changed = drm_helper_hpd_irq_event(drm);
- if (changed)
- dev_dbg(hdmi->dev, "connector status changed\n");
- }
+ dw_hdmi_qp_hpd_notify(hdmi->hdmi);
}
static irqreturn_t dw_hdmi_qp_rk3576_hardirq(int irq, void *dev_id)
@@ -738,8 +731,7 @@ static int __maybe_unused dw_hdmi_qp_rockchip_resume(struct device *dev)
dw_hdmi_qp_resume(dev, hdmi->hdmi);
- if (hdmi->encoder.encoder.dev)
- drm_helper_hpd_irq_event(hdmi->encoder.encoder.dev);
+ dw_hdmi_qp_hpd_notify(hdmi->hdmi);
return 0;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 28/39] drm/bridge: dw-hdmi-qp: Drop unused .setup_hpd() phy op
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (26 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 27/39] drm/rockchip: dw_hdmi_qp: Use dw_hdmi_qp_hpd_notify() for HPD reports Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 29/39] drm/vc4: hdmi: Use common TMDS char rate constants Cristian Ciocaltea
` (11 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
With the transition to .{enable|disable}_hpd() phy ops complete in both
the bridge and platform drivers, .setup_hpd() has no remaining callers.
Drop it.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 3 ---
include/drm/bridge/dw_hdmi_qp.h | 1 -
2 files changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index 4d41ad7319a5..8ce005673517 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -1314,9 +1314,6 @@ static void dw_hdmi_qp_init_hw(struct dw_hdmi_qp *hdmi)
/* Clear DONE and ERROR interrupts */
dw_hdmi_qp_write(hdmi, I2CM_OP_DONE_CLEAR | I2CM_NACK_RCVD_CLEAR,
MAINUNIT_1_INT_CLEAR);
-
- if (hdmi->phy.ops->setup_hpd)
- hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data);
}
struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
diff --git a/include/drm/bridge/dw_hdmi_qp.h b/include/drm/bridge/dw_hdmi_qp.h
index b4fb1c578a5b..ad33f9cafdeb 100644
--- a/include/drm/bridge/dw_hdmi_qp.h
+++ b/include/drm/bridge/dw_hdmi_qp.h
@@ -16,7 +16,6 @@ struct dw_hdmi_qp_phy_ops {
int (*init)(struct dw_hdmi_qp *hdmi, void *data);
void (*disable)(struct dw_hdmi_qp *hdmi, void *data);
enum drm_connector_status (*read_hpd)(struct dw_hdmi_qp *hdmi, void *data);
- void (*setup_hpd)(struct dw_hdmi_qp *hdmi, void *data);
void (*enable_hpd)(struct dw_hdmi_qp *hdmi, void *data);
void (*disable_hpd)(struct dw_hdmi_qp *hdmi, void *data);
};
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 29/39] drm/vc4: hdmi: Use common TMDS char rate constants
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (27 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 28/39] drm/bridge: dw-hdmi-qp: Drop unused .setup_hpd() phy op Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 30/39] drm/vc4: hdmi: Switch to drm_hdmi_mode_needs_scrambling() Cristian Ciocaltea
` (10 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Replace HDMI_14_MAX_TMDS_CLK defined locally with
HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ provided by linux/hdmi.h. Note this
incorrectly referenced HDMI 1.4, as the 340 MHz maximum TMDS character
rate was actually introduced in HDMI 1.3.
Similarly, use HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ instead of the 600000000
magic number.
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index e165f604939b..fbdb0448aa2b 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -45,6 +45,7 @@
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/gpio/consumer.h>
+#include <linux/hdmi.h>
#include <linux/i2c.h>
#include <linux/of.h>
#include <linux/of_address.h>
@@ -113,8 +114,6 @@
#define HSM_MIN_CLOCK_FREQ 120000000
#define CEC_CLOCK_FREQ 40000
-#define HDMI_14_MAX_TMDS_CLK (340 * 1000 * 1000)
-
static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi)
{
struct drm_display_info *display = &vc4_hdmi->connector.display_info;
@@ -137,7 +136,7 @@ static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode,
{
unsigned long long clock = drm_hdmi_compute_mode_clock(mode, bpc, fmt);
- return clock > HDMI_14_MAX_TMDS_CLK;
+ return clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
}
static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
@@ -1727,7 +1726,7 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector,
if (clock > vc4_hdmi->variant->max_pixel_clock)
return MODE_CLOCK_HIGH;
- if (!vc4->hvs->vc5_hdmi_enable_hdmi_20 && clock > HDMI_14_MAX_TMDS_CLK)
+ if (!vc4->hvs->vc5_hdmi_enable_hdmi_20 && clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ)
return MODE_CLOCK_HIGH;
/* 4096x2160@60 is not reliable without overclocking core */
@@ -3253,7 +3252,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
* vc4_hdmi_disable_scrambling() will thus run at boot, make
* sure it's disabled, and avoid any inconsistency.
*/
- if (variant->max_pixel_clock > HDMI_14_MAX_TMDS_CLK)
+ if (variant->max_pixel_clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ)
vc4_hdmi->scdc_enabled = true;
ret = variant->init_resources(drm, vc4_hdmi);
@@ -3383,7 +3382,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
.encoder_type = VC4_ENCODER_TYPE_HDMI0,
.debugfs_name = "hdmi0_regs",
.card_name = "vc4-hdmi-0",
- .max_pixel_clock = 600000000,
+ .max_pixel_clock = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ,
.registers = vc5_hdmi_hdmi0_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields),
.phy_lane_mapping = {
@@ -3412,7 +3411,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
.encoder_type = VC4_ENCODER_TYPE_HDMI1,
.debugfs_name = "hdmi1_regs",
.card_name = "vc4-hdmi-1",
- .max_pixel_clock = HDMI_14_MAX_TMDS_CLK,
+ .max_pixel_clock = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ,
.registers = vc5_hdmi_hdmi1_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi1_fields),
.phy_lane_mapping = {
@@ -3441,7 +3440,7 @@ static const struct vc4_hdmi_variant bcm2712_hdmi0_variant = {
.encoder_type = VC4_ENCODER_TYPE_HDMI0,
.debugfs_name = "hdmi0_regs",
.card_name = "vc4-hdmi-0",
- .max_pixel_clock = 600000000,
+ .max_pixel_clock = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ,
.registers = vc6_hdmi_hdmi0_fields,
.num_registers = ARRAY_SIZE(vc6_hdmi_hdmi0_fields),
.phy_lane_mapping = {
@@ -3468,7 +3467,7 @@ static const struct vc4_hdmi_variant bcm2712_hdmi1_variant = {
.encoder_type = VC4_ENCODER_TYPE_HDMI1,
.debugfs_name = "hdmi1_regs",
.card_name = "vc4-hdmi-1",
- .max_pixel_clock = 600000000,
+ .max_pixel_clock = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ,
.registers = vc6_hdmi_hdmi1_fields,
.num_registers = ARRAY_SIZE(vc6_hdmi_hdmi1_fields),
.phy_lane_mapping = {
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 30/39] drm/vc4: hdmi: Switch to drm_hdmi_mode_needs_scrambling()
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (28 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 29/39] drm/vc4: hdmi: Use common TMDS char rate constants Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 31/39] drm/vc4: hdmi: Convert to common SCDC scrambling infrastructure Cristian Ciocaltea
` (9 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
The VC4 HDMI driver has a local helper to check whether a mode requires
scrambling. It is equivalent to drm_hdmi_mode_needs_scrambling(), so
use the common helper instead.
No functional change intended.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index fbdb0448aa2b..e7b0f0f2e350 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -130,15 +130,6 @@ static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi)
return true;
}
-static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode,
- unsigned int bpc,
- enum drm_output_color_format fmt)
-{
- unsigned long long clock = drm_hdmi_compute_mode_clock(mode, bpc, fmt);
-
- return clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
-}
-
static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
{
struct drm_debugfs_entry *entry = m->private;
@@ -313,7 +304,7 @@ static int vc4_hdmi_reset_link(struct drm_connector *connector,
return 0;
}
- scrambling_needed = vc4_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode,
+ scrambling_needed = drm_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode,
vc4_hdmi->output_bpc,
vc4_hdmi->output_format);
if (!scrambling_needed) {
@@ -443,7 +434,8 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)
const struct drm_display_mode *mode;
list_for_each_entry(mode, &connector->probed_modes, head) {
- if (vc4_hdmi_mode_needs_scrambling(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444)) {
+ if (drm_hdmi_mode_needs_scrambling(mode, 8,
+ DRM_OUTPUT_COLOR_FORMAT_RGB444)) {
drm_warn_once(drm, "The core clock cannot reach frequencies high enough to support 4k @ 60Hz.");
drm_warn_once(drm, "Please change your config.txt file to add hdmi_enable_4kp60.");
}
@@ -802,7 +794,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
if (!vc4_hdmi_supports_scrambling(vc4_hdmi))
return;
- if (!vc4_hdmi_mode_needs_scrambling(mode,
+ if (!drm_hdmi_mode_needs_scrambling(mode,
vc4_hdmi->output_bpc,
vc4_hdmi->output_format))
return;
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 31/39] drm/vc4: hdmi: Convert to common SCDC scrambling infrastructure
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (29 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 30/39] drm/vc4: hdmi: Switch to drm_hdmi_mode_needs_scrambling() Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 32/39] drm/tests: connector: Add HDMI caps-based init coverage Cristian Ciocaltea
` (8 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Replace driver local scrambling logic with the newly introduced common
HDMI 2.0 scrambling support:
- Advertise source-side scrambling capability by setting supported HDMI
version based on the variant's max_pixel_clock.
- Provide minimal .scrambler_{enable|disable} connector callbacks that
only toggle the VC5 HDMI_SCRAMBLER_CTL register, while delegating
sink-side SCDC programming and periodic status monitoring to
drm_connector_hdmi_{enable|disable}_scrambling().
- Drop vc4_hdmi_reset_link() and vc4_hdmi_handle_hotplug(), switching
the .detect_ctx() path to drm_atomic_helper_connector_hdmi_hotplug()
which internally calls drm_connector_hdmi_sync_scdc() to trigger a
CRTC reset on reconnection.
- Drop the local scrambling_work delayed workqueue and scdc_enabled
flag, now tracked by the common drm_connector_hdmi layer, as well as
the now unused output_{bpc|color_format} driver data members.
No functional change intended.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 276 ++++++++---------------------------------
drivers/gpu/drm/vc4/vc4_hdmi.h | 21 ----
2 files changed, 49 insertions(+), 248 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index e7b0f0f2e350..81e0214f7e95 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -35,7 +35,6 @@
#include <drm/display/drm_hdmi_cec_helper.h>
#include <drm/display/drm_hdmi_helper.h>
#include <drm/display/drm_hdmi_state_helper.h>
-#include <drm/display/drm_scdc_helper.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_edid.h>
@@ -114,22 +113,6 @@
#define HSM_MIN_CLOCK_FREQ 120000000
#define CEC_CLOCK_FREQ 40000
-static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi)
-{
- struct drm_display_info *display = &vc4_hdmi->connector.display_info;
-
- lockdep_assert_held(&vc4_hdmi->mutex);
-
- if (!display->is_hdmi)
- return false;
-
- if (!display->hdmi.scdc.supported ||
- !display->hdmi.scdc.scrambling.supported)
- return false;
-
- return true;
-}
-
static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
{
struct drm_debugfs_entry *entry = m->private;
@@ -263,124 +246,6 @@ static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi)
static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) {}
#endif
-static int vc4_hdmi_reset_link(struct drm_connector *connector,
- struct drm_modeset_acquire_ctx *ctx)
-{
- struct drm_device *drm;
- struct vc4_hdmi *vc4_hdmi;
- struct drm_connector_state *conn_state;
- struct drm_crtc_state *crtc_state;
- struct drm_crtc *crtc;
- bool scrambling_needed;
- u8 config;
- int ret;
-
- if (!connector)
- return 0;
-
- drm = connector->dev;
- ret = drm_modeset_lock(&drm->mode_config.connection_mutex, ctx);
- if (ret)
- return ret;
-
- conn_state = connector->state;
- crtc = conn_state->crtc;
- if (!crtc)
- return 0;
-
- ret = drm_modeset_lock(&crtc->mutex, ctx);
- if (ret)
- return ret;
-
- crtc_state = crtc->state;
- if (!crtc_state->active)
- return 0;
-
- vc4_hdmi = connector_to_vc4_hdmi(connector);
- mutex_lock(&vc4_hdmi->mutex);
-
- if (!vc4_hdmi_supports_scrambling(vc4_hdmi)) {
- mutex_unlock(&vc4_hdmi->mutex);
- return 0;
- }
-
- scrambling_needed = drm_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode,
- vc4_hdmi->output_bpc,
- vc4_hdmi->output_format);
- if (!scrambling_needed) {
- mutex_unlock(&vc4_hdmi->mutex);
- return 0;
- }
-
- if (conn_state->commit &&
- !try_wait_for_completion(&conn_state->commit->hw_done)) {
- mutex_unlock(&vc4_hdmi->mutex);
- return 0;
- }
-
- ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config);
- if (ret < 0) {
- drm_err(drm, "Failed to read TMDS config: %d\n", ret);
- mutex_unlock(&vc4_hdmi->mutex);
- return 0;
- }
-
- if (!!(config & SCDC_SCRAMBLING_ENABLE) == scrambling_needed) {
- mutex_unlock(&vc4_hdmi->mutex);
- return 0;
- }
-
- mutex_unlock(&vc4_hdmi->mutex);
-
- /*
- * HDMI 2.0 says that one should not send scrambled data
- * prior to configuring the sink scrambling, and that
- * TMDS clock/data transmission should be suspended when
- * changing the TMDS clock rate in the sink. So let's
- * just do a full modeset here, even though some sinks
- * would be perfectly happy if were to just reconfigure
- * the SCDC settings on the fly.
- */
- return drm_atomic_helper_reset_crtc(crtc, ctx);
-}
-
-static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi,
- struct drm_modeset_acquire_ctx *ctx,
- enum drm_connector_status status)
-{
- struct drm_connector *connector = &vc4_hdmi->connector;
- int ret;
-
- /*
- * NOTE: This function should really be called with vc4_hdmi->mutex
- * held, but doing so results in reentrancy issues since
- * cec_s_phys_addr() might call .adap_enable, which leads to that
- * funtion being called with our mutex held.
- *
- * A similar situation occurs with vc4_hdmi_reset_link() that
- * will call into our KMS hooks if the scrambling was enabled.
- *
- * Concurrency isn't an issue at the moment since we don't share
- * any state with any of the other frameworks so we can ignore
- * the lock for now.
- */
-
- drm_atomic_helper_connector_hdmi_hotplug(connector, status, NULL);
-
- if (status != connector_status_connected)
- return;
-
- for (;;) {
- ret = vc4_hdmi_reset_link(connector, ctx);
- if (ret == -EDEADLK) {
- drm_modeset_backoff(ctx);
- continue;
- }
-
- break;
- }
-}
-
static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
struct drm_modeset_acquire_ctx *ctx,
bool force)
@@ -392,8 +257,8 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
/*
* NOTE: This function should really take vc4_hdmi->mutex, but
* doing so results in reentrancy issues since
- * vc4_hdmi_handle_hotplug() can call into other functions that
- * would take the mutex while it's held here.
+ * drm_atomic_helper_connector_hdmi_hotplug() can call into other
+ * functions that would take the mutex while it's held here.
*
* Concurrency isn't an issue at the moment since we don't share
* any state with any of the other frameworks so we can ignore
@@ -416,10 +281,11 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
status = connector_status_connected;
}
- vc4_hdmi_handle_hotplug(vc4_hdmi, ctx, status);
+ ret = drm_atomic_helper_connector_hdmi_hotplug(connector, status, ctx);
+
pm_runtime_put(&vc4_hdmi->pdev->dev);
- return status;
+ return ret == -EDEADLK ? ret : status;
}
static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)
@@ -526,22 +392,28 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
{
struct drm_connector *connector = &vc4_hdmi->connector;
struct drm_encoder *encoder = &vc4_hdmi->encoder.base;
- unsigned int max_bpc = 8;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+ BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
+ BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
+ .max_bpc = 8,
+ };
int ret;
if (vc4_hdmi->variant->supports_hdr)
- max_bpc = 12;
+ caps.max_bpc = 12;
- ret = drmm_connector_hdmi_init(dev, connector,
- "Broadcom", "Videocore",
- &vc4_hdmi_connector_funcs,
- &vc4_hdmi_hdmi_connector_funcs,
- DRM_MODE_CONNECTOR_HDMIA,
- vc4_hdmi->ddc,
- BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
- BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
- BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
- max_bpc);
+ if (vc4_hdmi->variant->max_pixel_clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ)
+ caps.supported_hdmi_ver = HDMI_VERSION_2_0;
+ else if (vc4_hdmi->variant->max_pixel_clock > HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ)
+ caps.supported_hdmi_ver = HDMI_VERSION_1_3;
+
+ ret = drmm_connector_hdmi_init_with_caps(dev, connector,
+ "Broadcom", "Videocore",
+ &vc4_hdmi_connector_funcs,
+ &vc4_hdmi_hdmi_connector_funcs,
+ DRM_MODE_CONNECTOR_HDMIA,
+ vc4_hdmi->ddc, &caps);
if (ret)
return ret;
@@ -553,6 +425,14 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
drm_connector_helper_add(connector, &vc4_hdmi_connector_helper_funcs);
+ /*
+ * Since we don't know the state of the controller and its
+ * display (if any), let's assume it's always enabled.
+ * drm_connector_hdmi_disable_scrambling() will thus run at boot,
+ * make sure it's disabled, and avoid any inconsistency.
+ */
+ connector->hdmi.scrambler_enabled = connector->hdmi.scrambler_supported;
+
/*
* Some of the properties below require access to state, like bpc.
* Allocate some default initial connector state with our reset helper.
@@ -778,32 +658,14 @@ static int vc4_hdmi_write_spd_infoframe(struct drm_connector *connector,
buffer, len);
}
-#define SCRAMBLING_POLLING_DELAY_MS 1000
-
-static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
+static int vc4_hdmi_scrambler_enable(struct drm_connector *connector)
{
- struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
- struct drm_connector *connector = &vc4_hdmi->connector;
- struct drm_device *drm = connector->dev;
- const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
+ struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
unsigned long flags;
int idx;
- lockdep_assert_held(&vc4_hdmi->mutex);
-
- if (!vc4_hdmi_supports_scrambling(vc4_hdmi))
- return;
-
- if (!drm_hdmi_mode_needs_scrambling(mode,
- vc4_hdmi->output_bpc,
- vc4_hdmi->output_format))
- return;
-
- if (!drm_dev_enter(drm, &idx))
- return;
-
- drm_scdc_set_high_tmds_clock_ratio(connector, true);
- drm_scdc_set_scrambling(connector, true);
+ if (!drm_dev_enter(connector->dev, &idx))
+ return -ENODEV;
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
HDMI_WRITE(HDMI_SCRAMBLER_CTL, HDMI_READ(HDMI_SCRAMBLER_CTL) |
@@ -812,59 +674,26 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
drm_dev_exit(idx);
- vc4_hdmi->scdc_enabled = true;
-
- queue_delayed_work(system_percpu_wq, &vc4_hdmi->scrambling_work,
- msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS));
+ return 0;
}
-static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder)
+static int vc4_hdmi_scrambler_disable(struct drm_connector *connector)
{
- struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
- struct drm_connector *connector = &vc4_hdmi->connector;
- struct drm_device *drm = connector->dev;
+ struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
unsigned long flags;
int idx;
- lockdep_assert_held(&vc4_hdmi->mutex);
-
- if (!vc4_hdmi->scdc_enabled)
- return;
-
- vc4_hdmi->scdc_enabled = false;
-
- if (delayed_work_pending(&vc4_hdmi->scrambling_work))
- cancel_delayed_work_sync(&vc4_hdmi->scrambling_work);
-
- if (!drm_dev_enter(drm, &idx))
- return;
+ if (!drm_dev_enter(connector->dev, &idx))
+ return -ENODEV;
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
HDMI_WRITE(HDMI_SCRAMBLER_CTL, HDMI_READ(HDMI_SCRAMBLER_CTL) &
~VC5_HDMI_SCRAMBLER_CTL_ENABLE);
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
- drm_scdc_set_scrambling(connector, false);
- drm_scdc_set_high_tmds_clock_ratio(connector, false);
-
drm_dev_exit(idx);
-}
-static void vc4_hdmi_scrambling_wq(struct work_struct *work)
-{
- struct vc4_hdmi *vc4_hdmi = container_of(to_delayed_work(work),
- struct vc4_hdmi,
- scrambling_work);
- struct drm_connector *connector = &vc4_hdmi->connector;
-
- if (drm_scdc_get_scrambling_status(connector))
- return;
-
- drm_scdc_set_high_tmds_clock_ratio(connector, true);
- drm_scdc_set_scrambling(connector, true);
-
- queue_delayed_work(system_percpu_wq, &vc4_hdmi->scrambling_work,
- msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS));
+ return 0;
}
static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder,
@@ -909,7 +738,7 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder,
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
}
- vc4_hdmi_disable_scrambling(encoder);
+ drm_connector_hdmi_disable_scrambling(&vc4_hdmi->connector);
drm_dev_exit(idx);
@@ -1617,6 +1446,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
struct drm_display_info *display = &vc4_hdmi->connector.display_info;
bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC;
bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC;
+ struct drm_connector_state *conn_state;
unsigned long flags;
int ret;
int idx;
@@ -1685,7 +1515,9 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
}
vc4_hdmi_recenter_fifo(vc4_hdmi);
- vc4_hdmi_enable_scrambling(encoder);
+
+ conn_state = drm_atomic_get_new_connector_state(state, connector);
+ drm_connector_hdmi_enable_scrambling(connector, conn_state);
drm_dev_exit(idx);
@@ -1702,8 +1534,6 @@ static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder,
mutex_lock(&vc4_hdmi->mutex);
drm_mode_copy(&vc4_hdmi->saved_adjusted_mode,
&crtc_state->adjusted_mode);
- vc4_hdmi->output_bpc = conn_state->hdmi.output_bpc;
- vc4_hdmi->output_format = conn_state->hdmi.output_format;
mutex_unlock(&vc4_hdmi->mutex);
}
@@ -1731,7 +1561,9 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector,
}
static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs = {
- .tmds_char_rate_valid = vc4_hdmi_connector_clock_valid,
+ .tmds_char_rate_valid = vc4_hdmi_connector_clock_valid,
+ .scrambler_enable = vc4_hdmi_scrambler_enable,
+ .scrambler_disable = vc4_hdmi_scrambler_disable,
.avi = {
.clear_infoframe = vc4_hdmi_clear_avi_infoframe,
.write_infoframe = vc4_hdmi_write_avi_infoframe,
@@ -3225,7 +3057,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
return ret;
spin_lock_init(&vc4_hdmi->hw_lock);
- INIT_DELAYED_WORK(&vc4_hdmi->scrambling_work, vc4_hdmi_scrambling_wq);
dev_set_drvdata(dev, vc4_hdmi);
encoder = &vc4_hdmi->encoder.base;
@@ -3238,15 +3069,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
vc4_hdmi->pdev = pdev;
vc4_hdmi->variant = variant;
- /*
- * Since we don't know the state of the controller and its
- * display (if any), let's assume it's always enabled.
- * vc4_hdmi_disable_scrambling() will thus run at boot, make
- * sure it's disabled, and avoid any inconsistency.
- */
- if (variant->max_pixel_clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ)
- vc4_hdmi->scdc_enabled = true;
-
ret = variant->init_resources(drm, vc4_hdmi);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h
index 29d461d4ee49..0e9797ffad30 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
@@ -118,8 +118,6 @@ struct vc4_hdmi {
struct vc4_encoder encoder;
struct drm_connector connector;
- struct delayed_work scrambling_work;
-
struct i2c_adapter *ddc;
void __iomem *hdmicore_regs;
void __iomem *hd_regs;
@@ -193,25 +191,6 @@ struct vc4_hdmi {
*/
bool packet_ram_enabled;
- /**
- * @scdc_enabled: Is the HDMI controller currently running with
- * the scrambler on? Protected by @mutex.
- */
- bool scdc_enabled;
-
- /**
- * @output_bpc: Copy of @drm_connector_state.hdmi.output_bpc for
- * use outside of KMS hooks. Protected by @mutex.
- */
- unsigned int output_bpc;
-
- /**
- * @output_format: Copy of
- * @drm_connector_state.hdmi.output_format for use outside of
- * KMS hooks. Protected by @mutex.
- */
- enum drm_output_color_format output_format;
-
/**
* @hdmi_jack: Represents the connection state of the HDMI plug, for
* ALSA jack detection.
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 32/39] drm/tests: connector: Add HDMI caps-based init coverage
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (30 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 31/39] drm/vc4: hdmi: Convert to common SCDC scrambling infrastructure Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 33/39] drm/tests: connector: Add HDMI source-side scrambler coverage Cristian Ciocaltea
` (7 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Add KUnit tests for drmm_connector_hdmi_init_with_caps() covering NULL
caps rejection, the max_tmds_char_rate inferred from each advertised
HDMI specification version, and the validation of a driver-provided
max_tmds_char_rate against the version-inferred limit: override below,
accept at, reject above, reject when no version is advertised.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/tests/drm_connector_test.c | 189 +++++++++++++++++++++++++++++
1 file changed, 189 insertions(+)
diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c
index beb1d50a6646..1fb1d83aec1a 100644
--- a/drivers/gpu/drm/tests/drm_connector_test.c
+++ b/drivers/gpu/drm/tests/drm_connector_test.c
@@ -1254,6 +1254,188 @@ KUNIT_ARRAY_PARAM(drm_connector_hdmi_init_type_invalid,
drm_connector_hdmi_init_type_invalid_tests,
drm_connector_hdmi_init_type_desc);
+/*
+ * Test that the registration of an HDMI connector with a NULL caps fails.
+ */
+static void drm_test_connector_hdmi_init_null_caps(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ NULL);
+ KUNIT_EXPECT_LT(test, ret, 0);
+}
+
+/*
+ * Test that the registration of an HDMI connector without an explicit max TMDS
+ * character rate being provided succeeds, and the connector limit is inferred
+ * from the advertised HDMI specification version.
+ */
+struct drm_connector_hdmi_init_max_tmds_rate_inferred_case {
+ const char *desc;
+ enum hdmi_version ver;
+ unsigned long long expected;
+};
+
+static void drm_test_connector_hdmi_init_max_tmds_rate_inferred(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ const struct drm_connector_hdmi_init_max_tmds_rate_inferred_case *param =
+ test->param_value;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = param->ver,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ };
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs_scrambler,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ &caps);
+ KUNIT_EXPECT_EQ(test, ret, 0);
+ KUNIT_EXPECT_EQ(test, priv->connector.hdmi.max_tmds_char_rate,
+ param->expected);
+}
+
+static const struct drm_connector_hdmi_init_max_tmds_rate_inferred_case
+drm_connector_hdmi_init_max_tmds_rate_inferred_tests[] = {
+ { "unknown", HDMI_VERSION_UNKNOWN, 0 },
+ { "1.0", HDMI_VERSION_1_0, HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ },
+ { "1.2", HDMI_VERSION_1_2, HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ },
+ { "1.3", HDMI_VERSION_1_3, HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ },
+ { "1.4", HDMI_VERSION_1_4, HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ },
+ { "2.0", HDMI_VERSION_2_0, HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ },
+};
+
+static void drm_connector_hdmi_init_max_tmds_rate_inferred_desc(
+ const struct drm_connector_hdmi_init_max_tmds_rate_inferred_case *t,
+ char *desc)
+{
+ strscpy(desc, t->desc, KUNIT_PARAM_DESC_SIZE);
+}
+
+KUNIT_ARRAY_PARAM(drm_connector_hdmi_init_max_tmds_rate_inferred,
+ drm_connector_hdmi_init_max_tmds_rate_inferred_tests,
+ drm_connector_hdmi_init_max_tmds_rate_inferred_desc);
+
+/*
+ * Test that the registration of an HDMI connector providing a max TMDS
+ * character rate strictly below the version-inferred limit succeeds, and
+ * the connector limit is overridden.
+ */
+static void drm_test_connector_hdmi_init_max_tmds_rate_override(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_2_0,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ .max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ,
+ };
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs_scrambler,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ &caps);
+ KUNIT_EXPECT_EQ(test, ret, 0);
+ KUNIT_EXPECT_EQ(test, priv->connector.hdmi.max_tmds_char_rate,
+ HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ);
+}
+
+/*
+ * Test that the registration of an HDMI connector providing a max TMDS
+ * character rate equal to the version-inferred limit succeeds.
+ */
+static void drm_test_connector_hdmi_init_max_tmds_rate_at_limit(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_2_0,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ .max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ,
+ };
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs_scrambler,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ &caps);
+ KUNIT_EXPECT_EQ(test, ret, 0);
+ KUNIT_EXPECT_EQ(test, priv->connector.hdmi.max_tmds_char_rate,
+ HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ);
+}
+
+/*
+ * Test that the registration of an HDMI connector providing a max TMDS
+ * character rate that exceeds the limit inferred from the advertised HDMI
+ * specification version fails.
+ */
+static void drm_test_connector_hdmi_init_max_tmds_rate_exceeds(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_1_4,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ .max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ,
+ };
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ &caps);
+ KUNIT_EXPECT_LT(test, ret, 0);
+}
+
+/*
+ * Test that the registration of an HDMI connector providing a non-zero max
+ * TMDS character rate without an HDMI specification version fails, as the
+ * version-inferred limit defaults to zero and any positive override would
+ * exceed it.
+ */
+static void drm_test_connector_hdmi_init_max_tmds_rate_no_version(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_UNKNOWN,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ .max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ,
+ };
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ &caps);
+ KUNIT_EXPECT_LT(test, ret, 0);
+}
+
static struct kunit_case drmm_connector_hdmi_init_tests[] = {
KUNIT_CASE(drm_test_connector_hdmi_init_valid),
KUNIT_CASE(drm_test_connector_hdmi_init_bpc_8),
@@ -1278,6 +1460,13 @@ static struct kunit_case drmm_connector_hdmi_init_tests[] = {
drm_connector_hdmi_init_type_valid_gen_params),
KUNIT_CASE_PARAM(drm_test_connector_hdmi_init_type_invalid,
drm_connector_hdmi_init_type_invalid_gen_params),
+ KUNIT_CASE(drm_test_connector_hdmi_init_null_caps),
+ KUNIT_CASE_PARAM(drm_test_connector_hdmi_init_max_tmds_rate_inferred,
+ drm_connector_hdmi_init_max_tmds_rate_inferred_gen_params),
+ KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_override),
+ KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_at_limit),
+ KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_exceeds),
+ KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_no_version),
{ }
};
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 33/39] drm/tests: connector: Add HDMI source-side scrambler coverage
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (31 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 32/39] drm/tests: connector: Add HDMI caps-based init coverage Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 34/39] drm/tests: hdmi_state_helper: Use drmm_connector_hdmi_init_with_caps() Cristian Ciocaltea
` (6 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Add KUnit tests for the HDMI source-side scrambling validation done by
drmm_connector_hdmi_init_with_caps().
Connector initialization derives the scrambler_supported flag from the
driver-provided supported_hdmi_ver capability. If it indicates
source-side scrambling support, both .scrambler_enable and
.scrambler_disable must be provided. Missing either callback is
rejected. If source-side scrambling is not supported, the callbacks are
ignored.
Test the valid and invalid callback combinations for both supported and
unsupported scrambling configurations.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/tests/drm_connector_test.c | 141 +++++++++++++++++++++++++++++
1 file changed, 141 insertions(+)
diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c
index 1fb1d83aec1a..98ccfaa0ee36 100644
--- a/drivers/gpu/drm/tests/drm_connector_test.c
+++ b/drivers/gpu/drm/tests/drm_connector_test.c
@@ -47,6 +47,41 @@ static const struct drm_connector_hdmi_funcs dummy_hdmi_funcs = {
},
};
+static int accept_scrambler_enable(struct drm_connector *connector)
+{
+ return 0;
+}
+
+static int accept_scrambler_disable(struct drm_connector *connector)
+{
+ return 0;
+}
+
+static const struct drm_connector_hdmi_funcs dummy_hdmi_funcs_scrambler = {
+ .scrambler_enable = accept_scrambler_enable,
+ .scrambler_disable = accept_scrambler_disable,
+ .avi = {
+ .clear_infoframe = accept_infoframe_clear_infoframe,
+ .write_infoframe = accept_infoframe_write_infoframe,
+ },
+ .hdmi = {
+ .clear_infoframe = accept_infoframe_clear_infoframe,
+ .write_infoframe = accept_infoframe_write_infoframe,
+ },
+};
+
+static const struct drm_connector_hdmi_funcs dummy_hdmi_funcs_scrambler_partial = {
+ .scrambler_enable = accept_scrambler_enable,
+ .avi = {
+ .clear_infoframe = accept_infoframe_clear_infoframe,
+ .write_infoframe = accept_infoframe_write_infoframe,
+ },
+ .hdmi = {
+ .clear_infoframe = accept_infoframe_clear_infoframe,
+ .write_infoframe = accept_infoframe_write_infoframe,
+ },
+};
+
static const struct drm_connector_funcs dummy_funcs = {
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
@@ -1436,6 +1471,108 @@ static void drm_test_connector_hdmi_init_max_tmds_rate_no_version(struct kunit *
KUNIT_EXPECT_LT(test, ret, 0);
}
+/*
+ * Test that the registration of an HDMI connector advertising source-side
+ * scrambling support succeeds when the .scrambler_{enable|disable} callbacks
+ * are provided.
+ */
+static void drm_test_connector_hdmi_init_scrambler_valid(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_2_0,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ };
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs_scrambler,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ &caps);
+ KUNIT_EXPECT_EQ(test, ret, 0);
+ KUNIT_EXPECT_EQ(test, priv->connector.hdmi.scrambler_supported, true);
+}
+
+/*
+ * Test that the registration of an HDMI connector advertising source-side
+ * scrambling support fails when the .scrambler_{enable|disable} callbacks
+ * are not provided.
+ */
+static void drm_test_connector_hdmi_init_scrambler_no_callbacks(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_2_0,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ };
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ &caps);
+ KUNIT_EXPECT_LT(test, ret, 0);
+}
+
+/*
+ * Test that the registration of an HDMI connector advertising source-side
+ * scrambling support fails when only one of the .scrambler_{enable|disable}
+ * callbacks are provided.
+ */
+static void drm_test_connector_hdmi_init_scrambler_partial_callbacks(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_2_0,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ };
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs_scrambler_partial,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ &caps);
+ KUNIT_EXPECT_LT(test, ret, 0);
+}
+
+/*
+ * Test that the registration of an HDMI connector not advertising source-side
+ * scrambling support succeeds, even when the .scrambler_{enable|disable}
+ * callbacks are provided, i.e. they are ignored.
+ */
+static void drm_test_connector_hdmi_init_scrambler_ignored_callbacks(struct kunit *test)
+{
+ struct drm_connector_init_priv *priv = test->priv;
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_1_4,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ };
+ int ret;
+
+ ret = drmm_connector_hdmi_init_with_caps(&priv->drm, &priv->connector,
+ "Vendor", "Product",
+ &dummy_funcs,
+ &dummy_hdmi_funcs_scrambler,
+ DRM_MODE_CONNECTOR_HDMIA,
+ &priv->ddc,
+ &caps);
+ KUNIT_EXPECT_EQ(test, ret, 0);
+ KUNIT_EXPECT_EQ(test, priv->connector.hdmi.scrambler_supported, false);
+}
+
static struct kunit_case drmm_connector_hdmi_init_tests[] = {
KUNIT_CASE(drm_test_connector_hdmi_init_valid),
KUNIT_CASE(drm_test_connector_hdmi_init_bpc_8),
@@ -1467,6 +1604,10 @@ static struct kunit_case drmm_connector_hdmi_init_tests[] = {
KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_at_limit),
KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_exceeds),
KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_no_version),
+ KUNIT_CASE(drm_test_connector_hdmi_init_scrambler_valid),
+ KUNIT_CASE(drm_test_connector_hdmi_init_scrambler_no_callbacks),
+ KUNIT_CASE(drm_test_connector_hdmi_init_scrambler_partial_callbacks),
+ KUNIT_CASE(drm_test_connector_hdmi_init_scrambler_ignored_callbacks),
{ }
};
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 34/39] drm/tests: hdmi_state_helper: Use drmm_connector_hdmi_init_with_caps()
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (32 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 33/39] drm/tests: connector: Add HDMI source-side scrambler coverage Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 35/39] drm/tests: hdmi_state_helper: Add max_tmds_char_rate fallback tests Cristian Ciocaltea
` (5 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Convert the internal __connector_hdmi_init() helper to take a
drm_connector_hdmi_caps struct rather than separate formats and max_bpc
parameters, and add a
drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs() macro that
exposes the full caps struct to tests.
This lets new tests exercise capability fields beyond formats and
max_bpc, notably supported_hdmi_ver and max_tmds_char_rate, without
further changes to the helper signature.
The legacy drm_kunit_helper_connector_hdmi_init_with_edid_funcs() macro
is kept as a thin wrapper so the bulk of the test suite is unaffected.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 35 ++++++++++++++--------
1 file changed, 22 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
index 353a261d42da..6a7dd2de002a 100644
--- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
@@ -231,8 +231,7 @@ static const struct drm_encoder_helper_funcs test_encoder_helper_funcs = {
static
struct drm_atomic_helper_connector_hdmi_priv *
__connector_hdmi_init(struct kunit *test,
- unsigned int formats,
- unsigned int max_bpc,
+ const struct drm_connector_hdmi_caps *caps,
const struct drm_connector_hdmi_funcs *hdmi_funcs,
const void *edid_data, size_t edid_len)
{
@@ -273,16 +272,16 @@ __connector_hdmi_init(struct kunit *test,
enc->possible_crtcs = drm_crtc_mask(priv->crtc);
conn = &priv->connector;
- conn->ycbcr_420_allowed = !!(formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420));
+ conn->ycbcr_420_allowed = !!(caps->supported_formats &
+ BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420));
- ret = drmm_connector_hdmi_init(drm, conn,
- "Vendor", "Product",
- &dummy_connector_funcs,
- hdmi_funcs,
- DRM_MODE_CONNECTOR_HDMIA,
- NULL,
- formats,
- max_bpc);
+ ret = drmm_connector_hdmi_init_with_caps(drm, conn,
+ "Vendor", "Product",
+ &dummy_connector_funcs,
+ hdmi_funcs,
+ DRM_MODE_CONNECTOR_HDMIA,
+ NULL,
+ caps);
KUNIT_ASSERT_EQ(test, ret, 0);
drm_connector_helper_add(conn, &dummy_connector_helper_funcs);
@@ -298,8 +297,18 @@ __connector_hdmi_init(struct kunit *test,
return priv;
}
-#define drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, formats, max_bpc, funcs, edid) \
- __connector_hdmi_init(test, formats, max_bpc, funcs, edid, ARRAY_SIZE(edid))
+#define drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, formats, \
+ bpc_max, funcs, edid) \
+({ \
+ struct drm_connector_hdmi_caps __caps = { \
+ .supported_formats = (formats), \
+ .max_bpc = (bpc_max), \
+ }; \
+ __connector_hdmi_init(test, &__caps, funcs, edid, ARRAY_SIZE(edid)); \
+})
+
+#define drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs(test, caps, funcs, edid) \
+ __connector_hdmi_init(test, caps, funcs, edid, ARRAY_SIZE(edid))
static
struct drm_atomic_helper_connector_hdmi_priv *
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 35/39] drm/tests: hdmi_state_helper: Add max_tmds_char_rate fallback tests
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (33 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 34/39] drm/tests: hdmi_state_helper: Use drmm_connector_hdmi_init_with_caps() Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 36/39] drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS Cristian Ciocaltea
` (4 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Cover the fallback in hdmi_clock_valid() that rejects modes whose TMDS
character rate exceeds connector->hdmi.max_tmds_char_rate when the
driver provides no .tmds_char_rate_valid() callback. Exercise both an
explicit limit set through drm_connector_hdmi_caps and the limit
inferred from caps.supported_hdmi_ver, and confirm that a driver hook
takes precedence over the connector limit.
The connector limit is installed via the new
drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs() helper so it
is in place before mode probing runs.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 120 +++++++++++++++++++++
1 file changed, 120 insertions(+)
diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
index 6a7dd2de002a..b8ae5fad2794 100644
--- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
@@ -174,6 +174,26 @@ static const struct drm_connector_hdmi_funcs reject_100mhz_connector_hdmi_funcs
},
};
+static enum drm_mode_status
+accept_connector_tmds_char_rate_valid(const struct drm_connector *connector,
+ const struct drm_display_mode *mode,
+ unsigned long long tmds_rate)
+{
+ return MODE_OK;
+}
+
+static const struct drm_connector_hdmi_funcs accept_connector_hdmi_funcs = {
+ .tmds_char_rate_valid = accept_connector_tmds_char_rate_valid,
+ .avi = {
+ .clear_infoframe = accept_infoframe_clear_infoframe,
+ .write_infoframe = accept_infoframe_write_infoframe,
+ },
+ .hdmi = {
+ .clear_infoframe = accept_infoframe_clear_infoframe,
+ .write_infoframe = accept_infoframe_write_infoframe,
+ },
+};
+
static int dummy_connector_get_modes(struct drm_connector *connector)
{
struct drm_atomic_helper_connector_hdmi_priv *priv =
@@ -2771,6 +2791,103 @@ static void drm_test_check_mode_valid_reject_max_clock(struct kunit *test)
KUNIT_EXPECT_EQ(test, preferred->clock, 25200);
}
+/*
+ * Test that a driver-provided .tmds_char_rate_valid() hook takes precedence
+ * over the connector->hdmi.max_tmds_char_rate fallback: the fallback must
+ * not be consulted when the hook is present.
+ */
+static void
+drm_test_check_mode_valid_driver_hook_overrides_max_tmds_char_rate(struct kunit *test)
+{
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_1_3,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ .max_tmds_char_rate = 100ULL * 1000 * 1000,
+ };
+ struct drm_atomic_helper_connector_hdmi_priv *priv;
+ struct drm_display_mode *preferred;
+
+ priv = drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs(test,
+ &caps,
+ &accept_connector_hdmi_funcs,
+ test_edid_hdmi_1080p_rgb_max_200mhz);
+ KUNIT_ASSERT_NOT_NULL(test, priv);
+
+ preferred = find_preferred_mode(&priv->connector);
+ KUNIT_ASSERT_NOT_NULL(test, preferred);
+ KUNIT_EXPECT_EQ(test, preferred->hdisplay, 1920);
+ KUNIT_EXPECT_EQ(test, preferred->vdisplay, 1080);
+ KUNIT_EXPECT_EQ(test, preferred->clock, 148500);
+}
+
+/*
+ * Test that drm_hdmi_connector_mode_valid() falls back to
+ * connector->hdmi.max_tmds_char_rate when the driver provides no
+ * .tmds_char_rate_valid() hook, rejecting modes whose computed TMDS character
+ * rate exceeds the connector limit.
+ */
+static void
+drm_test_check_mode_valid_reject_connector_max_tmds_char_rate(struct kunit *test)
+{
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_1_3,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ .max_tmds_char_rate = 100ULL * 1000 * 1000,
+ };
+ struct drm_atomic_helper_connector_hdmi_priv *priv;
+ struct drm_display_mode *preferred;
+
+ priv = drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs(test,
+ &caps,
+ &dummy_connector_hdmi_funcs,
+ test_edid_hdmi_1080p_rgb_max_200mhz);
+ KUNIT_ASSERT_NOT_NULL(test, priv);
+
+ preferred = find_preferred_mode(&priv->connector);
+ KUNIT_ASSERT_NOT_NULL(test, preferred);
+ KUNIT_EXPECT_EQ(test, preferred->hdisplay, 640);
+ KUNIT_EXPECT_EQ(test, preferred->vdisplay, 480);
+ KUNIT_EXPECT_EQ(test, preferred->clock, 25200);
+}
+
+/*
+ * Test that the max_tmds_char_rate inferred from caps.supported_hdmi_ver
+ * is applied as a mode-filtering limit: with an HDMI 1.3 connector
+ * (340 MHz inferred cap) and no driver hook, modes whose RGB444/8bpc TMDS
+ * rate exceeds 340 MHz must be filtered out even though the sink itself
+ * advertises a higher limit.
+ */
+static void
+drm_test_check_mode_valid_reject_inferred_max_tmds_char_rate(struct kunit *test)
+{
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_1_3,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ };
+ struct drm_atomic_helper_connector_hdmi_priv *priv;
+ struct drm_display_mode *preferred;
+ unsigned long long rate;
+
+ priv = drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs(test,
+ &caps,
+ &dummy_connector_hdmi_funcs,
+ test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz);
+ KUNIT_ASSERT_NOT_NULL(test, priv);
+
+ KUNIT_ASSERT_EQ(test, priv->connector.hdmi.max_tmds_char_rate,
+ HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ);
+
+ preferred = find_preferred_mode(&priv->connector);
+ KUNIT_ASSERT_NOT_NULL(test, preferred);
+
+ rate = drm_hdmi_compute_mode_clock(preferred, 8,
+ DRM_OUTPUT_COLOR_FORMAT_RGB444);
+ KUNIT_EXPECT_LE(test, rate, HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ);
+}
+
/*
* Test that drm_hdmi_connector_mode_valid() will accept modes that require a
* 4:2:0 chroma subsampling, even if said mode would violate maximum clock
@@ -2865,6 +2982,9 @@ static struct kunit_case drm_atomic_helper_connector_hdmi_mode_valid_tests[] = {
KUNIT_CASE(drm_test_check_mode_valid_reject),
KUNIT_CASE(drm_test_check_mode_valid_reject_rate),
KUNIT_CASE(drm_test_check_mode_valid_reject_max_clock),
+ KUNIT_CASE(drm_test_check_mode_valid_driver_hook_overrides_max_tmds_char_rate),
+ KUNIT_CASE(drm_test_check_mode_valid_reject_connector_max_tmds_char_rate),
+ KUNIT_CASE(drm_test_check_mode_valid_reject_inferred_max_tmds_char_rate),
KUNIT_CASE(drm_test_check_mode_valid_yuv420_only_max_clock),
KUNIT_CASE(drm_test_check_mode_valid_reject_yuv420_only_connector),
KUNIT_CASE(drm_test_check_mode_valid_accept_yuv420_also_connector_rgb),
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 36/39] drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (34 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 35/39] drm/tests: hdmi_state_helper: Add max_tmds_char_rate fallback tests Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 37/39] drm/tests: hdmi_state_helper: Cover source-side scrambling decision Cristian Ciocaltea
` (3 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Add a new test EDID advertising the following capabilities:
Max resolution: 3840x2160@60Hz with RGB, YUV444, YUV422, YUV420
Max BPC: 16
Max TMDS clock: 600 MHz
This is needed to exercise the new HDMI infrastructure that decides
whether scrambling needs to be enabled for a given display mode and
to validate that high-rate modes are properly rejected/accepted
depending on the source/sink scrambling capability.
The EDID is derived from test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz
with the following changes:
- Upgraded the first DTD from 3840x2160@30 (297 MHz) to 3840x2160@60
(594 MHz). The H/V totals (4400x2250) and porches already match the
HDMI 2.0 4K@60Hz standard timing, so only the pixel clock had to be
bumped.
- Widened Display Range Limits descriptor to cover the new timing, i.e.
24-140 kHz H, max dotclock 600 MHz.
- Updated CTA-861 Video Data Block to advertise VIC 97 (4K@60Hz) instead
of VIC 95 (4k30).
- Bumped HF-VSDB Max TMDS Character Rate to 600 MHz, keeping
SCDC_Present set so that the sink advertises scrambling support.
- Cleared HDMI VSDB Max TMDS clock byte, as required by HDMI 2.0 when
the HF-VSDB declares a Max TMDS Character Rate above 340 MHz.
- Provided a Video Capability Data Block advertising selectable RGB and
YCC quantization range plus underscan for IT/CE formats; also set the
'IT Video Formats Underscanned' bit in the CTA-861 extension header to
match.
- Aligned base block image size with the DTD (160x90 cm) and replaced
the bogus 'Week of Manufacture = 0xff' with the Model Year code, both
fixing inherited EDID conformity warnings.
- Dropped the empty YCbCr 4:2:0 Video Data Block inherited from the
parent EDID, which is flagged as a failure by edid-decode v1.33.0
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/tests/drm_kunit_edid.c | 129 +++++++++++++++++++++++++++++++++
drivers/gpu/drm/tests/drm_kunit_edid.h | 1 +
2 files changed, 130 insertions(+)
diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.c b/drivers/gpu/drm/tests/drm_kunit_edid.c
index c807ae0d9faa..673a0ea8c2ae 100644
--- a/drivers/gpu/drm/tests/drm_kunit_edid.c
+++ b/drivers/gpu/drm/tests/drm_kunit_edid.c
@@ -990,6 +990,135 @@ const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz[] = {
};
EXPORT_SYMBOL(test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz);
+/*
+ * Max resolution: 3840x2160@60Hz with RGB, YUV444, YUV422, YUV420
+ * Max BPC: 16 for all modes
+ * Max TMDS clock: 600 MHz
+ *
+ * edid-decode (hex):
+ *
+ * 00 ff ff ff ff ff ff 00 31 d8 34 00 00 00 00 00
+ * 00 23 01 03 80 a0 5a 78 0f ee 91 a3 54 4c 99 26
+ * 0f 50 54 20 00 00 01 01 01 01 01 01 01 01 01 01
+ * 01 01 01 01 01 01 08 e8 00 30 f2 70 5a 80 b0 58
+ * 8a 00 40 84 63 00 00 1e 00 00 00 fc 00 54 65 73
+ * 74 20 45 44 49 44 0a 20 20 20 00 00 00 fd 00 18
+ * 55 18 8c 3c 00 0a 20 20 20 20 20 20 00 00 00 10
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 a9
+ *
+ * 02 03 28 b1 41 61 6c 03 0c 00 10 00 78 00 20 00
+ * 00 01 03 6d d8 5d c4 01 78 80 07 00 00 00 00 00
+ * 00 e2 00 ca e3 0f 01 00 00 00 00 00 00 00 00 00
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54
+ *
+ * ----------------
+ *
+ * Block 0, Base EDID:
+ * EDID Structure Version & Revision: 1.3
+ * Vendor & Product Identification:
+ * Manufacturer: LNX
+ * Model: 52
+ * Made in: 2025
+ * Basic Display Parameters & Features:
+ * Digital display
+ * Maximum image size: 160 cm x 90 cm
+ * Gamma: 2.20
+ * RGB color display
+ * Default (sRGB) color space is primary color space
+ * First detailed timing is the preferred timing
+ * Supports GTF timings within operating range
+ * Color Characteristics:
+ * Red : 0.6396, 0.3300
+ * Green: 0.2998, 0.5996
+ * Blue : 0.1503, 0.0595
+ * White: 0.3125, 0.3291
+ * Established Timings I & II:
+ * DMT 0x04: 640x480 59.940476 Hz 4:3 31.469 kHz 25.175000 MHz
+ * Standard Timings: none
+ * Detailed Timing Descriptors:
+ * DTD 1: 3840x2160 60.000000 Hz 16:9 135.000 kHz 594.000000 MHz (1600 mm x 900 mm)
+ * Hfront 176 Hsync 88 Hback 296 Hpol P
+ * Vfront 8 Vsync 10 Vback 72 Vpol P
+ * Display Product Name: 'Test EDID'
+ * Display Range Limits:
+ * Monitor ranges (GTF): 24-85 Hz V, 24-140 kHz H, max dotclock 600 MHz
+ * Dummy Descriptor:
+ * Extension blocks: 1
+ * Checksum: 0xa9
+ *
+ * ----------------
+ *
+ * Block 1, CTA-861 Extension Block:
+ * Revision: 3
+ * Underscans IT Video Formats by default
+ * Supports YCbCr 4:4:4
+ * Supports YCbCr 4:2:2
+ * Native detailed modes: 1
+ * Video Data Block:
+ * VIC 97: 3840x2160 60.000000 Hz 16:9 135.000 kHz 594.000000 MHz
+ * Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
+ * Source physical address: 1.0.0.0
+ * DC_48bit
+ * DC_36bit
+ * DC_30bit
+ * DC_Y444
+ * Maximum TMDS clock: 0 MHz
+ * Extended HDMI video details:
+ * Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8:
+ * Version: 1
+ * Maximum TMDS Character Rate: 600 MHz
+ * SCDC Present
+ * Supports 16-bits/component Deep Color 4:2:0 Pixel Encoding
+ * Supports 12-bits/component Deep Color 4:2:0 Pixel Encoding
+ * Supports 10-bits/component Deep Color 4:2:0 Pixel Encoding
+ * VRRmin: 0 Hz
+ * VRRmax: 0 Hz
+ * Video Capability Data Block:
+ * YCbCr quantization: Selectable (via AVI YQ)
+ * RGB quantization: Selectable (via AVI Q)
+ * PT scan behavior: No Data
+ * IT scan behavior: Always Underscanned
+ * CE scan behavior: Always Underscanned
+ * YCbCr 4:2:0 Capability Map Data Block:
+ * VIC 97: 3840x2160 60.000000 Hz 16:9 135.000 kHz 594.000000 MHz
+ * Checksum: 0x54 Unused space in Extension Block: 87 bytes
+ *
+ * ----------------
+ *
+ * edid-decode 1.33.0
+ *
+ * EDID conformity: PASS
+ */
+const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz[] = {
+ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x31, 0xd8, 0x34, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x01, 0x03, 0x80, 0xa0, 0x5a, 0x78,
+ 0x0f, 0xee, 0x91, 0xa3, 0x54, 0x4c, 0x99, 0x26, 0x0f, 0x50, 0x54, 0x20,
+ 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0xe8, 0x00, 0x30, 0xf2, 0x70,
+ 0x5a, 0x80, 0xb0, 0x58, 0x8a, 0x00, 0x40, 0x84, 0x63, 0x00, 0x00, 0x1e,
+ 0x00, 0x00, 0x00, 0xfc, 0x00, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x44,
+ 0x49, 0x44, 0x0a, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x18,
+ 0x55, 0x18, 0x8c, 0x3c, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa9, 0x02, 0x03, 0x28, 0xb1,
+ 0x41, 0x61, 0x6c, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x78, 0x00, 0x20, 0x00,
+ 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x78, 0x80, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0xca, 0xe3, 0x0f, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x54,
+};
+EXPORT_SYMBOL(test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz);
+
MODULE_AUTHOR("Maxime Ripard <mripard@kernel.org>");
MODULE_DESCRIPTION("EDID Definitions for KUnit tests");
MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.h b/drivers/gpu/drm/tests/drm_kunit_edid.h
index 28b4df93a555..fb5b0295e35e 100644
--- a/drivers/gpu/drm/tests/drm_kunit_edid.h
+++ b/drivers/gpu/drm/tests/drm_kunit_edid.h
@@ -12,5 +12,6 @@ extern const unsigned char test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz[256];
extern const unsigned char test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz[256];
extern const unsigned char test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz[256];
extern const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz[256];
+extern const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz[256];
#endif // DRM_KUNIT_EDID_H_
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 37/39] drm/tests: hdmi_state_helper: Cover source-side scrambling decision
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (35 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 36/39] drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 38/39] drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID Cristian Ciocaltea
` (2 subsequent siblings)
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Add two atomic-check cases that initialise an HDMI 2.0 connector via
drm_connector_hdmi_caps (so the core infers scrambler_supported and the
600 MHz TMDS limit) and assert that conn_state->hdmi.scrambler_needed
stays clear for a 1080p@60 CEA mode (~148.5 MHz TMDS) and is set for the
4K@60 RGB preferred mode (~594 MHz TMDS), straddling the 340 MHz
threshold.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 160 +++++++++++++++++++++
1 file changed, 160 insertions(+)
diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
index b8ae5fad2794..7cd6bd422b0b 100644
--- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
@@ -20,6 +20,8 @@
#include <drm/display/drm_hdmi_helper.h>
#include <drm/display/drm_hdmi_state_helper.h>
+#include <linux/hdmi.h>
+
#include "../drm_crtc_internal.h"
#include <kunit/test.h>
@@ -194,6 +196,29 @@ static const struct drm_connector_hdmi_funcs accept_connector_hdmi_funcs = {
},
};
+static int accept_scrambler_enable(struct drm_connector *connector)
+{
+ return 0;
+}
+
+static int accept_scrambler_disable(struct drm_connector *connector)
+{
+ return 0;
+}
+
+static const struct drm_connector_hdmi_funcs scrambler_connector_hdmi_funcs = {
+ .scrambler_enable = accept_scrambler_enable,
+ .scrambler_disable = accept_scrambler_disable,
+ .avi = {
+ .clear_infoframe = accept_infoframe_clear_infoframe,
+ .write_infoframe = accept_infoframe_write_infoframe,
+ },
+ .hdmi = {
+ .clear_infoframe = accept_infoframe_clear_infoframe,
+ .write_infoframe = accept_infoframe_write_infoframe,
+ },
+};
+
static int dummy_connector_get_modes(struct drm_connector *connector)
{
struct drm_atomic_helper_connector_hdmi_priv *priv =
@@ -2265,6 +2290,139 @@ static void drm_test_check_disable_connector(struct kunit *test)
drm_modeset_acquire_fini(&ctx);
}
+/*
+ * Test that on an HDMI connector with source+sink scrambling support, driving
+ * a sub-340 MHz CEA mode, we end up with scrambler_needed cleared.
+ */
+static void drm_test_check_scrambler_needed_low_rate(struct kunit *test)
+{
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_2_0,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ };
+ struct drm_atomic_helper_connector_hdmi_priv *priv;
+ struct drm_modeset_acquire_ctx ctx;
+ struct drm_connector_state *conn_state;
+ struct drm_display_info *info;
+ struct drm_display_mode *low_rate_mode;
+ struct drm_connector *conn;
+ struct drm_device *drm;
+ struct drm_crtc *crtc;
+ unsigned long long rate;
+ int ret;
+
+ priv = drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs(test,
+ &caps,
+ &scrambler_connector_hdmi_funcs,
+ test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz);
+ KUNIT_ASSERT_NOT_NULL(test, priv);
+
+ drm = &priv->drm;
+ crtc = priv->crtc;
+ conn = &priv->connector;
+ info = &conn->display_info;
+ KUNIT_ASSERT_TRUE(test, conn->hdmi.scrambler_supported);
+ KUNIT_ASSERT_TRUE(test, info->is_hdmi);
+ KUNIT_ASSERT_TRUE(test, info->hdmi.scdc.supported);
+ KUNIT_ASSERT_TRUE(test, info->hdmi.scdc.scrambling.supported);
+
+ low_rate_mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
+ KUNIT_ASSERT_NOT_NULL(test, low_rate_mode);
+
+ rate = drm_hdmi_compute_mode_clock(low_rate_mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444);
+ KUNIT_ASSERT_LT(test, rate, HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ);
+
+ drm_modeset_acquire_init(&ctx, 0);
+
+retry_conn_enable:
+ ret = drm_kunit_helper_enable_crtc_connector(test, drm, crtc, conn,
+ low_rate_mode, &ctx);
+ if (ret == -EDEADLK) {
+ ret = drm_modeset_backoff(&ctx);
+ if (!ret)
+ goto retry_conn_enable;
+ }
+ KUNIT_ASSERT_EQ(test, ret, 0);
+
+ conn_state = conn->state;
+ KUNIT_ASSERT_NOT_NULL(test, conn_state);
+
+ KUNIT_EXPECT_LE(test, conn_state->hdmi.tmds_char_rate,
+ HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ);
+ KUNIT_EXPECT_FALSE(test, conn_state->hdmi.scrambler_needed);
+
+ drm_modeset_drop_locks(&ctx);
+ drm_modeset_acquire_fini(&ctx);
+}
+
+/*
+ * Test that on an HDMI connector with source+sink scrambling support, driving
+ * the 4K@60 RGB preferred mode (~594 MHz TMDS, above the 340 MHz threshold),
+ * we end up with scrambler_needed set.
+ */
+static void drm_test_check_scrambler_needed_high_rate(struct kunit *test)
+{
+ struct drm_connector_hdmi_caps caps = {
+ .supported_hdmi_ver = HDMI_VERSION_2_0,
+ .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
+ .max_bpc = 8,
+ };
+ struct drm_atomic_helper_connector_hdmi_priv *priv;
+ struct drm_modeset_acquire_ctx ctx;
+ struct drm_connector_state *conn_state;
+ struct drm_display_info *info;
+ struct drm_display_mode *preferred;
+ struct drm_connector *conn;
+ struct drm_device *drm;
+ struct drm_crtc *crtc;
+ unsigned long long rate;
+ int ret;
+
+ priv = drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs(test,
+ &caps,
+ &scrambler_connector_hdmi_funcs,
+ test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz);
+ KUNIT_ASSERT_NOT_NULL(test, priv);
+
+ drm = &priv->drm;
+ crtc = priv->crtc;
+ conn = &priv->connector;
+ info = &conn->display_info;
+ KUNIT_ASSERT_TRUE(test, conn->hdmi.scrambler_supported);
+ KUNIT_ASSERT_TRUE(test, info->is_hdmi);
+ KUNIT_ASSERT_TRUE(test, info->hdmi.scdc.supported);
+ KUNIT_ASSERT_TRUE(test, info->hdmi.scdc.scrambling.supported);
+
+ preferred = find_preferred_mode(conn);
+ KUNIT_ASSERT_NOT_NULL(test, preferred);
+
+ rate = drm_hdmi_compute_mode_clock(preferred, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444);
+ KUNIT_ASSERT_GT(test, rate, HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ);
+
+ drm_modeset_acquire_init(&ctx, 0);
+
+retry_conn_enable:
+ ret = drm_kunit_helper_enable_crtc_connector(test, drm, crtc, conn,
+ preferred, &ctx);
+ if (ret == -EDEADLK) {
+ ret = drm_modeset_backoff(&ctx);
+ if (!ret)
+ goto retry_conn_enable;
+ }
+ KUNIT_ASSERT_EQ(test, ret, 0);
+
+ conn_state = conn->state;
+ KUNIT_ASSERT_NOT_NULL(test, conn_state);
+
+ KUNIT_EXPECT_GT(test, conn_state->hdmi.tmds_char_rate,
+ HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ);
+ KUNIT_EXPECT_TRUE(test, conn_state->hdmi.scrambler_needed);
+
+ drm_modeset_drop_locks(&ctx);
+ drm_modeset_acquire_fini(&ctx);
+}
+
struct color_format_test_param {
enum drm_connector_color_format fmt;
enum drm_output_color_format expected;
@@ -2505,6 +2663,8 @@ static struct kunit_case drm_atomic_helper_connector_hdmi_check_tests[] = {
KUNIT_CASE(drm_test_check_tmds_char_rate_rgb_8bpc),
KUNIT_CASE(drm_test_check_tmds_char_rate_rgb_10bpc),
KUNIT_CASE(drm_test_check_tmds_char_rate_rgb_12bpc),
+ KUNIT_CASE(drm_test_check_scrambler_needed_low_rate),
+ KUNIT_CASE(drm_test_check_scrambler_needed_high_rate),
KUNIT_CASE_PARAM(drm_test_check_hdmi_color_format,
check_hdmi_color_format_gen_params),
KUNIT_CASE_PARAM(drm_test_check_hdmi_color_format_420_only,
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 38/39] drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (36 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 37/39] drm/tests: hdmi_state_helper: Cover source-side scrambling decision Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 39/39] drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID Cristian Ciocaltea
2026-07-02 15:31 ` [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
The test EDID added by commit 58fe1d78605e ("drm/tests: hdmi: Provide
EDID supporting 4K@30Hz with YUV420 only") fails 'edid-decode --check'
(v1.33.0) with the following issues:
Warnings:
Block 1, CTA-861 Extension Block:
IT Video Formats are overscanned by default, but normally this should be underscanned.
YCbCr 4:2:0 Video Data Block: Some YCbCr 4:2:0 timings are invalid for HDMI 2.1
(which requires an RGB timings pixel rate >= 590 MHz).
EDID:
Base EDID: Some timings are out of range of the Monitor Ranges:
Maximum Clock: 297.000 MHz (Monitor: 170.000 MHz)
CTA-861: Multiple native progressive timings are defined.
Failures:
Block 0, Base EDID:
Vendor & Product Identification: EDID 1.3 does not support week 0xff.
Block 1, CTA-861 Extension Block:
Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8: Max TMDS rate is > 0 and <= 340 or > 600.
YCbCr 4:2:0 Capability Map Data Block: Empty Capability Map.
YCbCr 4:2:0 Video Data Block: YCbCr 4:2:0-only VIC 95 is also a regular VIC.
Missing VCDB, needed for Set Selectable RGB Quantization to avoid interop issues.
EDID:
CTA-861: The maximum HDMI TMDS clock is 200000 kHz, but one or more video timings go up to 297000 kHz.
Address them while preserving the advertised maximum resolutions, BPC
and TMDS clock used by the existing KUnit tests:
- Week 0xff is not valid for EDID 1.3; set it to 0x00 so that the Model
year field becomes a regular Year of Manufacture.
- The HDMI Forum VSDB Max TMDS Character Rate must be 0 when no rate
above 340 MHz is supported. The HDMI VSDB still advertises 200 MHz as
Max TMDS Clock.
- VIC 95 (3840x2160@30Hz) was reported as YUV420-only but was listed in
both the regular Video Data Block and the YCbCr 4:2:0 Video Data
Block. Drop it from the regular VDB (so it stays advertised in the
4:2:0 VDB only) and remove the now unnecessary empty YCbCr 4:2:0
Capability Map Data Block.
- Add a Video Capability Data Block advertising selectable RGB and YCC
quantization range plus underscan for IT/CE formats; also set the 'IT
Video Formats Underscanned' bit in the CTA-861 extension header to
match.
- Bump the Display Range Limits max pixel clock from 170 MHz to 300 MHz
so it covers the 297 MHz pixel rate of VIC 95.
- Drop the 'native' flag from VIC 16 in the Video Data Block so it is no
longer flagged as a second native progressive timing alongside the
preferred DTD.
The only remaining warning is HDMI 2.1 related and can be ignored, as it
requires that any mode listed in the YCbCr 4:2:0 Video Data Block must
have a corresponding RGB pixel clock >= 590 MHz.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/tests/drm_kunit_edid.c | 65 +++++++++++++++++++++-------------
1 file changed, 41 insertions(+), 24 deletions(-)
diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.c b/drivers/gpu/drm/tests/drm_kunit_edid.c
index 673a0ea8c2ae..4dff28fff796 100644
--- a/drivers/gpu/drm/tests/drm_kunit_edid.c
+++ b/drivers/gpu/drm/tests/drm_kunit_edid.c
@@ -766,22 +766,22 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz);
* edid-decode (hex):
*
* 00 ff ff ff ff ff ff 00 31 d8 34 00 00 00 00 00
- * ff 23 01 03 80 60 36 78 0f ee 91 a3 54 4c 99 26
+ * 00 23 01 03 80 60 36 78 0f ee 91 a3 54 4c 99 26
* 0f 50 54 20 00 00 01 01 01 01 01 01 01 01 01 01
* 01 01 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c
* 45 00 c0 1c 32 00 00 1e 00 00 00 fc 00 54 65 73
* 74 20 45 44 49 44 0a 20 20 20 00 00 00 fd 00 18
- * 55 18 5e 11 00 0a 20 20 20 20 20 20 00 00 00 10
- * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 bb
+ * 55 18 5e 1e 00 0a 20 20 20 20 20 20 00 00 00 10
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ad
*
- * 02 03 29 31 42 90 5f 6c 03 0c 00 10 00 78 28 20
- * 00 00 01 03 6d d8 5d c4 01 28 80 07 00 00 00 00
- * 00 00 e3 0f 00 00 e2 0e 5f 00 00 00 00 00 00 00
+ * 02 03 27 b1 41 10 6c 03 0c 00 10 00 78 28 20 00
+ * 00 01 03 6d d8 5d c4 01 00 80 07 00 00 00 00 00
+ * 00 e2 00 ca e2 0e 5f 00 00 00 00 00 00 00 00 00
* 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
* 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
* 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
* 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ca
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9a
*
* ----------------
*
@@ -790,7 +790,7 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz);
* Vendor & Product Identification:
* Manufacturer: LNX
* Model: 52
- * Model year: 2025
+ * Made in: 2025
* Basic Display Parameters & Features:
* Digital display
* Maximum image size: 96 cm x 54 cm
@@ -813,21 +813,21 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz);
* Vfront 4 Vsync 5 Vback 36 Vpol P
* Display Product Name: 'Test EDID'
* Display Range Limits:
- * Monitor ranges (GTF): 24-85 Hz V, 24-94 kHz H, max dotclock 170 MHz
+ * Monitor ranges (GTF): 24-85 Hz V, 24-94 kHz H, max dotclock 300 MHz
* Dummy Descriptor:
* Extension blocks: 1
- * Checksum: 0xbb
+ * Checksum: 0xad
*
* ----------------
*
* Block 1, CTA-861 Extension Block:
* Revision: 3
+ * Underscans IT Video Formats by default
* Supports YCbCr 4:4:4
* Supports YCbCr 4:2:2
* Native detailed modes: 1
* Video Data Block:
- * VIC 16: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.500000 MHz (native)
- * VIC 95: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz
+ * VIC 16: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.500000 MHz
* Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
* Source physical address: 1.0.0.0
* DC_48bit
@@ -838,40 +838,57 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz);
* Extended HDMI video details:
* Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8:
* Version: 1
- * Maximum TMDS Character Rate: 200 MHz
* SCDC Present
* Supports 16-bits/component Deep Color 4:2:0 Pixel Encoding
* Supports 12-bits/component Deep Color 4:2:0 Pixel Encoding
* Supports 10-bits/component Deep Color 4:2:0 Pixel Encoding
- * YCbCr 4:2:0 Capability Map Data Block:
- * Empty Capability Map
+ * VRRmin: 0 Hz
+ * VRRmax: 0 Hz
+ * Video Capability Data Block:
+ * YCbCr quantization: Selectable (via AVI YQ)
+ * RGB quantization: Selectable (via AVI Q)
+ * PT scan behavior: No Data
+ * IT scan behavior: Always Underscanned
+ * CE scan behavior: Always Underscanned
* YCbCr 4:2:0 Video Data Block:
* VIC 95: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz
- * Checksum: 0xca
+ * Checksum: 0x9a Unused space in Extension Block: 88 bytes
+ *
+ * ----------------
+ *
+ * edid-decode 1.33.0
+ *
+ * Warnings:
+ *
+ * Block 1, CTA-861 Extension Block:
+ * YCbCr 4:2:0 Video Data Block: Some YCbCr 4:2:0 timings are invalid for HDMI 2.1
+ * (which requires an RGB timings pixel rate >= 590 MHz).
+ *
+ * EDID conformity: PASS
*/
const unsigned char test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz[] = {
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x31, 0xd8, 0x34, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0x23, 0x01, 0x03, 0x80, 0x60, 0x36, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x01, 0x03, 0x80, 0x60, 0x36, 0x78,
0x0f, 0xee, 0x91, 0xa3, 0x54, 0x4c, 0x99, 0x26, 0x0f, 0x50, 0x54, 0x20,
0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3a, 0x80, 0x18, 0x71, 0x38,
0x2d, 0x40, 0x58, 0x2c, 0x45, 0x00, 0xc0, 0x1c, 0x32, 0x00, 0x00, 0x1e,
0x00, 0x00, 0x00, 0xfc, 0x00, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x44,
0x49, 0x44, 0x0a, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x18,
- 0x55, 0x18, 0x5e, 0x11, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x55, 0x18, 0x5e, 0x1e, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbb, 0x02, 0x03, 0x29, 0x31,
- 0x42, 0x90, 0x5f, 0x6c, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x78, 0x28, 0x20,
- 0x00, 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x28, 0x80, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x0f, 0x00, 0x00, 0xe2, 0x0e,
- 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xad, 0x02, 0x03, 0x27, 0xb1,
+ 0x41, 0x10, 0x6c, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x78, 0x28, 0x20, 0x00,
+ 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x00, 0x80, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0xca, 0xe2, 0x0e, 0x5f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xca
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x9a,
};
EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz);
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH v8 39/39] drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (37 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 38/39] drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID Cristian Ciocaltea
@ 2026-07-02 14:46 ` Cristian Ciocaltea
2026-07-02 15:31 ` [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 14:46 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
The test EDID added by commit 54a5f1c4d5f8 ("drm/tests: hdmi: Provide
EDID supporting 4K@30Hz with RGB/YUV") fails 'edid-decode --check'
(v1.33.0) with the following issues:
Warnings:
Block 1, CTA-861 Extension Block:
IT Video Formats are overscanned by default, but normally this should be underscanned.
YCbCr 4:2:0 Capability Map Data Block: Some YCbCr 4:2:0 timings are invalid for HDMI 2.1
(which requires an RGB timings pixel rate >= 590 MHz).
Failures:
Block 0, Base EDID:
Vendor & Product Identification: EDID 1.3 does not support week 0xff.
Detailed Timing Descriptor #1: Mismatch of image size 1600x900 mm vs display size 960x540 mm.
Block 1, CTA-861 Extension Block:
Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8: Max TMDS rate is > 0 and <= 340 or > 600.
YCbCr 4:2:0 Video Data Block: This Data Block is empty.
Missing VCDB, needed for Set Selectable RGB Quantization to avoid interop issues.
EDID:
Base EDID: The DTD max image size is 1600x900mm, which is larger than the display size 960.0x540.0mm.
Address them while preserving the advertised maximum resolution, BPC and
TMDS clock used by the existing KUnit tests:
- Week 0xff is not valid for EDID 1.3; set it to 0x00 so that the Model
year field becomes a regular Year of Manufacture.
- Align the DTD image size with the Basic Display Parameters maximum
image size (96 cm x 54 cm).
- The HDMI Forum VSDB Max TMDS Character Rate must be 0 when no rate
above 340 MHz is supported. The HDMI VSDB still advertises 340 MHz as
Max TMDS Clock.
- Drop the empty YCbCr 4:2:0 Video Data Block. VIC 95 (3840x2160@30Hz)
remains advertised as YUV420-capable via the YCbCr 4:2:0 Capability
Map Data Block, which references the corresponding entry in the
regular Video Data Block.
- Add a Video Capability Data Block advertising selectable RGB and YCC
quantization range plus underscan for IT/CE formats; also set the 'IT
Video Formats Underscanned' bit in the CTA-861 extension header to
match.
The only remaining warning is HDMI 2.1 related and can be ignored, as it
requires that any mode listed in the YCbCr 4:2:0 Video Data Block must
have a corresponding RGB pixel clock >= 590 MHz.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/tests/drm_kunit_edid.c | 57 ++++++++++++++++++++++------------
1 file changed, 38 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.c b/drivers/gpu/drm/tests/drm_kunit_edid.c
index 4dff28fff796..a6c5e8d6077a 100644
--- a/drivers/gpu/drm/tests/drm_kunit_edid.c
+++ b/drivers/gpu/drm/tests/drm_kunit_edid.c
@@ -900,22 +900,22 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz);
* edid-decode (hex):
*
* 00 ff ff ff ff ff ff 00 31 d8 34 00 00 00 00 00
- * ff 23 01 03 80 60 36 78 0f ee 91 a3 54 4c 99 26
+ * 00 23 01 03 80 60 36 78 0f ee 91 a3 54 4c 99 26
* 0f 50 54 20 00 00 01 01 01 01 01 01 01 01 01 01
* 01 01 01 01 01 01 04 74 00 30 f2 70 5a 80 b0 58
- * 8a 00 40 84 63 00 00 1e 00 00 00 fc 00 54 65 73
+ * 8a 00 c0 1c 32 00 00 1e 00 00 00 fc 00 54 65 73
* 74 20 45 44 49 44 0a 20 20 20 00 00 00 fd 00 18
* 55 18 5e 22 00 0a 20 20 20 20 20 20 00 00 00 10
- * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ce
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 e6
*
- * 02 03 27 31 41 5f 6c 03 0c 00 10 00 78 44 20 00
- * 00 01 03 6d d8 5d c4 01 44 80 07 00 00 00 00 00
- * 00 e3 0f 01 00 e1 0e 00 00 00 00 00 00 00 00 00
+ * 02 03 28 b1 41 5f 6c 03 0c 00 10 00 78 44 20 00
+ * 00 01 03 6d d8 5d c4 01 00 80 07 00 00 00 00 00
+ * 00 e2 00 ca e3 0f 01 00 00 00 00 00 00 00 00 00
* 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
* 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
* 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
* 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84
+ * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 8a
*
* ----------------
*
@@ -924,7 +924,7 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz);
* Vendor & Product Identification:
* Manufacturer: LNX
* Model: 52
- * Model year: 2025
+ * Made in: 2025
* Basic Display Parameters & Features:
* Digital display
* Maximum image size: 96 cm x 54 cm
@@ -942,7 +942,7 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz);
* DMT 0x04: 640x480 59.940476 Hz 4:3 31.469 kHz 25.175000 MHz
* Standard Timings: none
* Detailed Timing Descriptors:
- * DTD 1: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz (1600 mm x 900 mm)
+ * DTD 1: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz (960 mm x 540 mm)
* Hfront 176 Hsync 88 Hback 296 Hpol P
* Vfront 8 Vsync 10 Vback 72 Vpol P
* Display Product Name: 'Test EDID'
@@ -950,12 +950,13 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz);
* Monitor ranges (GTF): 24-85 Hz V, 24-94 kHz H, max dotclock 340 MHz
* Dummy Descriptor:
* Extension blocks: 1
- * Checksum: 0xce
+ * Checksum: 0xe6
*
* ----------------
*
* Block 1, CTA-861 Extension Block:
* Revision: 3
+ * Underscans IT Video Formats by default
* Supports YCbCr 4:4:4
* Supports YCbCr 4:2:2
* Native detailed modes: 1
@@ -971,31 +972,49 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz);
* Extended HDMI video details:
* Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8:
* Version: 1
- * Maximum TMDS Character Rate: 340 MHz
* SCDC Present
* Supports 16-bits/component Deep Color 4:2:0 Pixel Encoding
* Supports 12-bits/component Deep Color 4:2:0 Pixel Encoding
* Supports 10-bits/component Deep Color 4:2:0 Pixel Encoding
+ * VRRmin: 0 Hz
+ * VRRmax: 0 Hz
+ * Video Capability Data Block:
+ * YCbCr quantization: Selectable (via AVI YQ)
+ * RGB quantization: Selectable (via AVI Q)
+ * PT scan behavior: No Data
+ * IT scan behavior: Always Underscanned
+ * CE scan behavior: Always Underscanned
* YCbCr 4:2:0 Capability Map Data Block:
* VIC 95: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz
- * YCbCr 4:2:0 Video Data Block:
- * Checksum: 0x84
+ * Checksum: 0x8a Unused space in Extension Block: 87 bytes
+ *
+ * ----------------
+ *
+ * edid-decode 1.33.0
+ *
+ * Warnings:
+ *
+ * Block 1, CTA-861 Extension Block:
+ * YCbCr 4:2:0 Capability Map Data Block: Some YCbCr 4:2:0 timings are invalid for HDMI 2.1
+ * (which requires an RGB timings pixel rate >= 590 MHz).
+ *
+ * EDID conformity: PASS
*/
const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz[] = {
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x31, 0xd8, 0x34, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0x23, 0x01, 0x03, 0x80, 0x60, 0x36, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x01, 0x03, 0x80, 0x60, 0x36, 0x78,
0x0f, 0xee, 0x91, 0xa3, 0x54, 0x4c, 0x99, 0x26, 0x0f, 0x50, 0x54, 0x20,
0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x74, 0x00, 0x30, 0xf2, 0x70,
- 0x5a, 0x80, 0xb0, 0x58, 0x8a, 0x00, 0x40, 0x84, 0x63, 0x00, 0x00, 0x1e,
+ 0x5a, 0x80, 0xb0, 0x58, 0x8a, 0x00, 0xc0, 0x1c, 0x32, 0x00, 0x00, 0x1e,
0x00, 0x00, 0x00, 0xfc, 0x00, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x44,
0x49, 0x44, 0x0a, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x18,
0x55, 0x18, 0x5e, 0x22, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xce, 0x02, 0x03, 0x27, 0x31,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe6, 0x02, 0x03, 0x28, 0xb1,
0x41, 0x5f, 0x6c, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x78, 0x44, 0x20, 0x00,
- 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x44, 0x80, 0x07, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x0f, 0x01, 0x00, 0xe1, 0x0e, 0x00,
+ 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x00, 0x80, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0xca, 0xe3, 0x0f, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1003,7 +1022,7 @@ const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x84
+ 0x00, 0x00, 0x00, 0x8a,
};
EXPORT_SYMBOL(test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz);
--
2.54.0
^ permalink raw reply related [flat|nested] 48+ messages in thread
* Re: [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
` (38 preceding siblings ...)
2026-07-02 14:46 ` [PATCH v8 39/39] drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID Cristian Ciocaltea
@ 2026-07-02 15:31 ` Cristian Ciocaltea
39 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-02 15:31 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance
Cc: kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Dmitry Baryshkov, Diederik de Haas, Maud Spierings
Hi,
I've just realized I missed updating the part of the cover letter that
describes the patch structure. Please find the corrected content below.
Regards,
Cristian
On 7/2/26 5:46 PM, Cristian Ciocaltea wrote:
> Enable HDMI 2.0 display modes (e.g. 4K@60Hz) on the Synopsys DW HDMI QP
> TX controller, as found in Rockchip RK3576 & RK3588 SoCs, by adding SCDC
> management for high TMDS clock ratio and scrambling.
Since SCDC state is lost on sink disconnects, the bridge driver needs to
trigger a CRTC reset during connector detection. To support this, the
series first introduces the HDMI version enum and the caps-based HDMI
connector init helper (patches 1-3), then builds the connector and
bridge scrambling infrastructure on top of it - the connector scrambler
support, the scdc-helper additions (connector-prefixed debug macro and
SCDC version helper), and the HDMI scrambling management helpers
including SCDC source-version advertisement (patches 4-8).
It then wires this up through the hdmi-state-helper and bridge connector
layers: fallback TMDS rate validation, hotplug SCDC state sync and the
scrambling requirement (patches 9-11), a bridge cleanup and the new
source-side scrambling bridge ops (patches 12-13), the switch to a
cached-status, atomic-aware .detect_ctx() connector helper (patches
14-15), and finally hooking up the HDMI 2.0 scrambler callbacks (patch
16).
The SCDC scrambling feature itself is implemented in the DW HDMI QP
bridge driver, alongside i2c error-message rate limiting,
.enable_hpd()/.disable_hpd() PHY ops and a dw_hdmi_qp_hpd_notify()
helper (patches 17-20).
Patches 21-28 cover the Rockchip platform driver and HPD handling: minor
cleanups (newlines in dev_err_probe(), consistent local dev variable,
dropping an unnecessary include), deferring HPD IRQ enable until after
connector setup, masking the RK3576 HPD IRQ in io_init, implementing the
.{enable|disable}_hpd() PHY ops, switching HPD reports to
dw_hdmi_qp_hpd_notify() to restrict events to the affected connector,
and dropping the now-unused .setup_hpd() PHY op.
Patches 29-31 convert vc4 HDMI to the common infrastructure as a proof
of reuse: adopting the shared TMDS char rate constants, switching to
drm_hdmi_mode_needs_scrambling(), and replacing the driver-local
scrambling implementation with the common SCDC scrambling helpers.
Patches 32-39 add KUnit tests: HDMI caps-based init coverage and
source-side scrambler validation for the connector, conversion of
hdmi_state_helper to drmm_connector_hdmi_init_with_caps() with
max_tmds_char_rate fallback tests, a new 4K@60Hz 600MHz TMDS EDID,
source-side scrambling decision coverage, and conformity fixes for the
existing 1080p+4K YUV420 200MHz and 4K RGB/YUV 340MHz test EDID blobs.
>
> This has been tested on the following boards:
>
> * Radxa ROCK 5B (RK3588)
> * Radxa ROCK 4D (RK3576)
> * Raspberry Pi 5 Model B Rev 1.1 (BCM2712 D0)
>
> Note that commit d87773de9efe1 ("clocksource/drivers/arm_arch_timer:
> Default to EL2 virtual timer when running VHE"), introduced in v7.2-rc1,
> causes Raspberry Pi 5 to hang during boot. Reverting the commit
> restores normal boot. This issue has already been reported in [1];
> alternatively, the workaround proposed in [2] can be applied.
>
> Regards,
> Cristian
>
> [1] https://lore.kernel.org/all/ea15cce1-b393-43f6-8d58-3d6f90f0c0cd@samsung.com/
> [2] https://lore.kernel.org/all/20260619204832.586079-1-dan@reactivated.net/
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> Changes in v8:
> - Added an enum hdmi_version under video/hdmi to describe the HDMI
> specification version a source/sink supports (new patch 1)
> - Introduced HDMI connector capabilities API and reworked the
> infrastructure patches on top of it: drmm_connector_hdmi_init() now
> takes a drm_connector_hdmi_caps struct that carries supported_formats,
> max_bpc, supported_hdmi_ver and max_tmds_char_rate (new patches 2-3)
> - Moved all the new SCDC helpers covering both source and sink to
> display/drm_hdmi_helper.c
> - Renamed drm_scdc_{start,stop}_scrambling() to
> drm_connector_hdmi_{enable,disable}_scrambling() and added a
> connector-state argument so the scrambler_needed flag is checked
> centrally instead of in every driver
> - Renamed drm_scdc_sync_status() to drm_connector_hdmi_sync_scdc(),
> aligned its lifecycle with vc4_hdmi_reset_link(), and removed the
> internal drm_scdc_reset_crtc() helper; it now also gates on CRTC state
> and an in-flight commit (Maxime)
> - Changed the prototype of drm_atomic_helper_connector_hdmi_hotplug() to
> take an acquire context and an int return, instead of adding a new
> _ctx variant (Maxime)
> - Added drm_hdmi_mode_needs_scrambling() to centralise the above-340 MHz
> decision (new patch 7)
> - Made SCDC source version negotiation optional and moved it to a
> dedicated patch "drm/display: hdmi: Advertise SCDC source version when
> scrambling" (new patch 8), backed by a new
> drm_scdc_set_source_version() helper in "drm/display: scdc-helper: Add
> helper to set SCDC version information" (new patch 6)
> - Added a fallback TMDS rate validation patch using the connector-level
> max_tmds_char_rate when the driver provides no .tmds_char_rate_valid()
> hook (new patch 9)
> - Split scrambler_needed flag handling into its own hdmi-state-helper
> dedicate change (new patch 11)
> - VC4:
> * Replaced vc4_hdmi_mode_needs_scrambling() with
> drm_hdmi_mode_needs_scrambling() (new patch 30)
> * Restored drm_dev_{enter,exit}() pairing around the converted
> scrambling paths
> * Removed now unused output_{bpc,color_format} fields from vc4_hdmi as
> part of the SCDC conversion
> - KUnit:
> * Covered the caps-based connector init path: NULL caps, inferred
> max_tmds_char_rate per supported_hdmi_ver, and override validation
> (new patch 32)
> * Switched drm_hdmi_state_helper_test to the caps-based init helper
> and exposed it through
> drm_kunit_helper_connector_hdmi_init_with_caps_edid_funcs() (new
> patch 34)
> * Added max_tmds_char_rate fallback coverage in
> drm_hdmi_state_helper_test (new patch 35)
> - Rebased onto latest drm-misc-next and dropped the already applied
> "drm/fb-helper: Remove unused local variable in hotplug_event()" patch
> - Link to v7: https://patch.msgid.link/20260602-dw-hdmi-qp-scramb-v7-0-445eb54ee1ed@collabora.com
[...]
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH v8 01/39] video/hdmi: Introduce HDMI version enum
2026-07-02 14:46 ` [PATCH v8 01/39] video/hdmi: Introduce HDMI version enum Cristian Ciocaltea
@ 2026-07-03 13:55 ` Dmitry Baryshkov
0 siblings, 0 replies; 48+ messages in thread
From: Dmitry Baryshkov @ 2026-07-03 13:55 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
On Thu, Jul 02, 2026 at 05:46:14PM +0300, Cristian Ciocaltea wrote:
> Add an enum to represent HDMI specification versions. This will be used
> by upcoming changes to associate HDMI connectors and bridges with a
> maximum supported version and to simplify handling of version-dependent
> features.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> include/linux/hdmi.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH v8 02/39] drm/connector: Add caps-based HDMI connector init helper
2026-07-02 14:46 ` [PATCH v8 02/39] drm/connector: Add caps-based HDMI connector init helper Cristian Ciocaltea
@ 2026-07-03 14:05 ` Dmitry Baryshkov
2026-07-03 19:31 ` Cristian Ciocaltea
0 siblings, 1 reply; 48+ messages in thread
From: Dmitry Baryshkov @ 2026-07-03 14:05 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
On Thu, Jul 02, 2026 at 05:46:15PM +0300, Cristian Ciocaltea wrote:
> In preparation for adding HDMI 2.x source capabilities, introduce struct
> drm_connector_hdmi_caps and a new drmm_connector_hdmi_init_with_caps()
> helper.
>
> The existing drmm_connector_hdmi_init() helper currently takes
> individual capability arguments such as supported_formats and max_bpc.
> Adding more HDMI-specific arguments to that function would not scale
> well, so move those values into a dedicated capabilities structure and
> implement the existing helper as a wrapper around the new caps-based
> interface.
I think, it was an intention of Maxime: make sure that every driver is
forced to provide some values here. With the struct-based init it is
easy to overlook or to ommit a value.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> drivers/gpu/drm/drm_connector.c | 202 +++++++++++++++++++++++++++-------------
> include/drm/drm_connector.h | 55 +++++++++++
> 2 files changed, 193 insertions(+), 64 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 8b4baed060f3..c7ce6b7bd8b0 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -542,6 +542,137 @@ int drmm_connector_init(struct drm_device *dev,
> }
> EXPORT_SYMBOL(drmm_connector_init);
>
> +/**
> + * drmm_connector_hdmi_init_with_caps - Init a preallocated HDMI connector
> + * @dev: DRM device
> + * @connector: A pointer to the HDMI connector to init
> + * @vendor: HDMI Controller Vendor name
> + * @product: HDMI Controller Product name
> + * @funcs: callbacks for this connector
> + * @hdmi_funcs: HDMI-related callbacks for this connector
> + * @connector_type: user visible type of the connector
> + * @ddc: optional pointer to the associated ddc adapter
> + * @caps: optional HDMI connector capabilities
> + *
> + * Initialises a preallocated HDMI connector. Connectors can be
> + * subclassed as part of driver connector objects.
> + *
> + * Cleanup is automatically handled with a call to
> + * drm_connector_cleanup() in a DRM-managed action.
> + *
> + * The connector structure should be allocated with drmm_kzalloc().
> + *
> + * The @drm_connector_funcs.destroy hook must be NULL.
> + *
> + * Returns:
> + * Zero on success, error code on failure.
> + */
> +int drmm_connector_hdmi_init_with_caps(struct drm_device *dev,
> + struct drm_connector *connector,
> + const char *vendor, const char *product,
> + const struct drm_connector_funcs *funcs,
> + const struct drm_connector_hdmi_funcs *hdmi_funcs,
> + int connector_type,
> + struct i2c_adapter *ddc,
> + const struct drm_connector_hdmi_caps *caps)
> +{
> + int ret;
> +
> + if (!vendor || !product)
> + return -EINVAL;
> +
> + if ((strlen(vendor) > DRM_CONNECTOR_HDMI_VENDOR_LEN) ||
> + (strlen(product) > DRM_CONNECTOR_HDMI_PRODUCT_LEN))
> + return -EINVAL;
> +
> + if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> + connector_type == DRM_MODE_CONNECTOR_HDMIB))
> + return -EINVAL;
> +
> + if (!caps)
> + return -EINVAL;
> +
> + if (!caps->supported_formats ||
> + !(caps->supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
> + return -EINVAL;
> +
> + if (connector->ycbcr_420_allowed !=
> + !!(caps->supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
> + return -EINVAL;
> +
> + if (!(caps->max_bpc == 8 || caps->max_bpc == 10 || caps->max_bpc == 12))
> + return -EINVAL;
> +
> + if (!hdmi_funcs->avi.clear_infoframe ||
> + !hdmi_funcs->avi.write_infoframe ||
> + !hdmi_funcs->hdmi.clear_infoframe ||
> + !hdmi_funcs->hdmi.write_infoframe)
> + return -EINVAL;
> +
> + ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc);
> + if (ret)
> + return ret;
> +
> + connector->hdmi.supported_formats = caps->supported_formats;
> +
> + /*
> + * The supported HDMI version can be used to infer the maximum TMDS
> + * character rate allowed by the specification. Some controllers,
> + * however, may support a lower rate than that version would imply.
> + *
> + * A non-zero caps->max_tmds_char_rate lets drivers override the
> + * inferred limit with the actual controller capability. A value of
> + * zero keeps the default limit inferred from supported_hdmi_ver.
> + */
> + if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0)
> + connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ;
> + else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3)
> + connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
> + else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0)
> + connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ;
> +
> + if (caps->max_tmds_char_rate) {
> + if (caps->max_tmds_char_rate > connector->hdmi.max_tmds_char_rate)
> + return -EINVAL;
> + connector->hdmi.max_tmds_char_rate = caps->max_tmds_char_rate;
> + }
Here I'd totally suggest something simpler:
if (!caps->max_tmds_char_rate) {
if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0)
connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ;
else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3)
connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0)
connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ;
}
> +
> + strtomem_pad(connector->hdmi.vendor, vendor, 0);
> + strtomem_pad(connector->hdmi.product, product, 0);
> +
> + /*
> + * drm_connector_attach_max_bpc_property() requires the
> + * connector to have a state.
> + */
> + if (connector->funcs->atomic_create_state) {
> + struct drm_connector_state *state;
> +
> + state = connector->funcs->atomic_create_state(connector);
> + if (IS_ERR(state))
> + return PTR_ERR(state);
> +
> + connector->state = state;
> + } else if (connector->funcs->reset) {
> + connector->funcs->reset(connector);
> + }
> +
> + drm_connector_attach_max_bpc_property(connector, 8, caps->max_bpc);
> + connector->max_bpc = caps->max_bpc;
If you don't like the max_bpc argument, let's do it other way:
if (connector->max_bpc < 8)
return -EINVAL;
if (connector->max_bpc > 8)
drm_connector_attach_hdr_output_metadata_property(connector);
> +
> + if (caps->max_bpc > 8)
> + drm_connector_attach_hdr_output_metadata_property(connector);
> +
> + ret = drm_connector_attach_color_format_property(connector,
> + caps->supported_formats);
> + if (ret)
> + return ret;
> +
> + connector->hdmi.funcs = hdmi_funcs;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(drmm_connector_hdmi_init_with_caps);
> +
> /**
> * drmm_connector_hdmi_init - Init a preallocated HDMI connector
> * @dev: DRM device
> @@ -578,71 +709,14 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
> unsigned long supported_formats,
> unsigned int max_bpc)
> {
> - int ret;
> + struct drm_connector_hdmi_caps caps = {
> + .supported_formats = supported_formats,
> + .max_bpc = max_bpc,
> + };
>
> - if (!vendor || !product)
> - return -EINVAL;
> -
> - if ((strlen(vendor) > DRM_CONNECTOR_HDMI_VENDOR_LEN) ||
> - (strlen(product) > DRM_CONNECTOR_HDMI_PRODUCT_LEN))
> - return -EINVAL;
> -
> - if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> - connector_type == DRM_MODE_CONNECTOR_HDMIB))
> - return -EINVAL;
> -
> - if (!supported_formats || !(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
> - return -EINVAL;
> -
> - if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
> - return -EINVAL;
> -
> - if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
> - return -EINVAL;
> -
> - if (!hdmi_funcs->avi.clear_infoframe ||
> - !hdmi_funcs->avi.write_infoframe ||
> - !hdmi_funcs->hdmi.clear_infoframe ||
> - !hdmi_funcs->hdmi.write_infoframe)
> - return -EINVAL;
> -
> - ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc);
> - if (ret)
> - return ret;
> -
> - connector->hdmi.supported_formats = supported_formats;
> - strtomem_pad(connector->hdmi.vendor, vendor, 0);
> - strtomem_pad(connector->hdmi.product, product, 0);
> -
> - /*
> - * drm_connector_attach_max_bpc_property() requires the
> - * connector to have a state.
> - */
> - if (connector->funcs->atomic_create_state) {
> - struct drm_connector_state *state;
> -
> - state = connector->funcs->atomic_create_state(connector);
> - if (IS_ERR(state))
> - return PTR_ERR(state);
> -
> - connector->state = state;
> - } else if (connector->funcs->reset) {
> - connector->funcs->reset(connector);
> - }
> -
> - drm_connector_attach_max_bpc_property(connector, 8, max_bpc);
> - connector->max_bpc = max_bpc;
> -
> - if (max_bpc > 8)
> - drm_connector_attach_hdr_output_metadata_property(connector);
> -
> - ret = drm_connector_attach_color_format_property(connector, supported_formats);
> - if (ret)
> - return ret;
> -
> - connector->hdmi.funcs = hdmi_funcs;
> -
> - return 0;
> + return drmm_connector_hdmi_init_with_caps(dev, connector, vendor,
> + product, funcs, hdmi_funcs,
> + connector_type, ddc, &caps);
> }
> EXPORT_SYMBOL(drmm_connector_hdmi_init);
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index af075c38f4db..961a729d0869 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -2029,6 +2029,47 @@ struct drm_connector_hdmi_audio {
> int dai_port;
> };
>
> +/**
> + * struct drm_connector_hdmi_caps - HDMI capabilities structure
> + *
> + * This structure is required to initialize the connector using
> + * drmm_connector_hdmi_init_with_caps().
> + */
> +struct drm_connector_hdmi_caps {
> + /**
> + * @supported_hdmi_ver:
> + *
> + * Maximum HDMI specification version supported by the controller side
> + * of this connector. This describes the controller capability only;
> + * the effective link capabilities may be further restricted by the
> + * sink, bridge, or mode validation.
> + *
> + * HDMI_VERSION_UNKNOWN means legacy/default behaviour.
What would it actually mean here? Every chip has some version of HDMI
standard it conforms to.
> + */
> + enum hdmi_version supported_hdmi_ver;
> +
> + /**
> + * @supported_formats:
> + *
> + * Bitmask of @drm_output_color_format listing supported output formats.
> + */
> + unsigned long supported_formats;
> +
> + /**
> + * @max_tmds_char_rate:
> + *
> + * Maximum TMDS character rate supported by the source, in Hz.
> + * A value of 0 means the core should use the default limit implied by
> + * @supported_hdmi_ver.
> + */
> + unsigned long long max_tmds_char_rate;
> +
> + /**
> + * @max_bpc: Maximum bits per char the HDMI connector supports.
> + */
> + unsigned int max_bpc;
> +};
> +
> /*
> * struct drm_connector_hdmi - DRM Connector HDMI-related structure
> */
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH v8 03/39] drm/display: bridge_connector: Pass HDMI capabilities through caps struct
2026-07-02 14:46 ` [PATCH v8 03/39] drm/display: bridge_connector: Pass HDMI capabilities through caps struct Cristian Ciocaltea
@ 2026-07-03 14:19 ` Dmitry Baryshkov
2026-07-03 19:55 ` Cristian Ciocaltea
0 siblings, 1 reply; 48+ messages in thread
From: Dmitry Baryshkov @ 2026-07-03 14:19 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
On Thu, Jul 02, 2026 at 05:46:16PM +0300, Cristian Ciocaltea wrote:
> Switch drm_bridge_connector_init() to
> drmm_connector_hdmi_init_with_caps(), collecting the bridge's HDMI
> properties into a stack drm_connector_hdmi_caps so future HDMI 2.x
> capabilities can be plumbed without growing the argument list.
>
> Introduce struct drm_bridge::supported_hdmi_ver to let bridges declare
> the HDMI specification version they are conformant with, and forward it
> to the connector layer through the new caps struct so HDMI 2.x features
> can be gated on real source capability rather than guesswork.
And it's left uninitialized by the bridges, which doesn't mean anything.
If you don't want to touch all bridge drivers in one commit, please
provide some migration path and hopefully get rid of it by the end of
the series. At least, there should be a drm_warn() if the version in
unsspecified.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> drivers/gpu/drm/display/drm_bridge_connector.c | 29 ++++++++++++++------------
> include/drm/drm_bridge.h | 6 ++++++
> 2 files changed, 22 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> index 92f8a2d7aab4..796069dbf1a1 100644
> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> @@ -823,8 +823,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> struct drm_connector *connector;
> struct i2c_adapter *ddc = NULL;
> struct drm_bridge *panel_bridge __free(drm_bridge_put) = NULL;
> - unsigned int supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
> - unsigned int max_bpc = 8;
> + struct drm_connector_hdmi_caps caps = {
> + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
> + .max_bpc = 8,
> + };
I'm really not sure that we need separate caps. But if we do, it would
make sense to embed it as is in the drm_bridge instead of having the
scattered fields.
> bool support_hdcp = false;
> int connector_type;
> int ret;
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> index 18f3db367dc1..2d8b5e4c64ba 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -1176,6 +1176,12 @@ struct drm_bridge {
> */
> const char *product;
>
> + /**
> + * @supported_hdmi_ver: HDMI version the bridge is conformant with.
> + * This is only relevant if @DRM_BRIDGE_OP_HDMI is set.
> + */
> + enum hdmi_version supported_hdmi_ver;
> +
> /**
> * @supported_formats: Bitmask of @drm_output_color_format listing
> * supported output formats. This is only relevant if
>
> --
> 2.54.0
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH v8 04/39] drm/connector: Add HDMI 2.0 scrambler infrastructure
2026-07-02 14:46 ` [PATCH v8 04/39] drm/connector: Add HDMI 2.0 scrambler infrastructure Cristian Ciocaltea
@ 2026-07-03 14:34 ` Dmitry Baryshkov
2026-07-03 20:54 ` Cristian Ciocaltea
0 siblings, 1 reply; 48+ messages in thread
From: Dmitry Baryshkov @ 2026-07-03 14:34 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
On Thu, Jul 02, 2026 at 05:46:17PM +0300, Cristian Ciocaltea wrote:
> Add the connector-level infrastructure to support HDMI 2.0 scrambling:
>
> - A scrambler_supported flag to indicate whether the source supports the
> scrambling capability, in which case the newly introduced
> .scrambler_{enable|disable}() callbacks in drm_connector_hdmi_funcs
> are mandatory
Do we need a flag? What would it mean if the flag is set, but the
callbacks are not? Can we drop the flag and use the presence of the
callbacks as a way to identify that scrambler is enabled?
> - A scrambler_needed flag to be managed by the hdmi state helpers based
> on the negotiated TMDS character rate and the source/sink scrambling
> capabilities
> - A scrambler_enabled flag to track whether scrambling is currently
> active
> - A delayed work item (scdc_work) with an associated callback (scdc_cb)
> to monitor sink-side scrambling status and retry the setup if the sink
> resets it
>
> These are intended to be used by SCDC scrambling helpers to coordinate
> scrambling setup and teardown between the source driver and the DRM
> core.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> drivers/gpu/drm/drm_connector.c | 26 ++++++++++++--
> include/drm/drm_connector.h | 77 +++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 100 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index c7ce6b7bd8b0..deecfc582f09 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -220,6 +220,19 @@ void drm_connector_free_work_fn(struct work_struct *work)
> }
> }
>
> +static void drm_connector_hdmi_scdc_work(struct work_struct *work)
> +{
> + struct drm_connector *connector;
> + struct drm_connector_hdmi *hdmi;
> +
> + hdmi = container_of(to_delayed_work(work), struct drm_connector_hdmi,
> + scdc_work);
> + connector = container_of(hdmi, struct drm_connector, hdmi);
> +
> + if (hdmi->scdc_cb)
> + hdmi->scdc_cb(connector);
> +}
> +
> static int drm_connector_init_only(struct drm_device *dev,
> struct drm_connector *connector,
> const struct drm_connector_funcs *funcs,
> @@ -285,6 +298,7 @@ static int drm_connector_init_only(struct drm_device *dev,
> mutex_init(&connector->edid_override_mutex);
> mutex_init(&connector->hdmi.infoframes.lock);
> mutex_init(&connector->hdmi_audio.lock);
> + INIT_DELAYED_WORK(&connector->hdmi.scdc_work, drm_connector_hdmi_scdc_work);
> connector->edid_blob_ptr = NULL;
> connector->epoch_counter = 0;
> connector->tile_blob_ptr = NULL;
> @@ -624,12 +638,18 @@ int drmm_connector_hdmi_init_with_caps(struct drm_device *dev,
> * inferred limit with the actual controller capability. A value of
> * zero keeps the default limit inferred from supported_hdmi_ver.
> */
Here we need to check that the driver doesn't set only one callback of
the pair.
> - if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0)
> + if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0) {
> + if (!hdmi_funcs->scrambler_enable ||
> + !hdmi_funcs->scrambler_disable)
> + return -EINVAL;
> +
> + connector->hdmi.scrambler_supported = true;
> connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ;
> - else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3)
> + } else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3) {
> connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
> - else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0)
> + } else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0) {
> connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ;
> + }
>
> if (caps->max_tmds_char_rate) {
> if (caps->max_tmds_char_rate > connector->hdmi.max_tmds_char_rate)
> +
> + /** @scdc_cb: Callback to be invoked as part of @scdc_work.
> + *
> + * Currently used to monitor sink-side scrambling status and retry
> + * setup if the sink resets it.
> + *
> + * This is assigned by the framework when making use of
> + * drm_connector_hdmi_enable_scrambling() helper.
No such helper. Also, please explain in the commit message, why do we
need to keep it configurable. Why the default is not enough?
> + */
> + void (*scdc_cb)(struct drm_connector *connector);
> +
> /**
> * @funcs: HDMI connector Control Functions
> */
>
> --
> 2.54.0
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH v8 02/39] drm/connector: Add caps-based HDMI connector init helper
2026-07-03 14:05 ` Dmitry Baryshkov
@ 2026-07-03 19:31 ` Cristian Ciocaltea
0 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-03 19:31 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
Hi Dmitry,
Thanks for your quick review!
On 7/3/26 5:05 PM, Dmitry Baryshkov wrote:
> On Thu, Jul 02, 2026 at 05:46:15PM +0300, Cristian Ciocaltea wrote:
>> In preparation for adding HDMI 2.x source capabilities, introduce struct
>> drm_connector_hdmi_caps and a new drmm_connector_hdmi_init_with_caps()
>> helper.
>>
>> The existing drmm_connector_hdmi_init() helper currently takes
>> individual capability arguments such as supported_formats and max_bpc.
>> Adding more HDMI-specific arguments to that function would not scale
>> well, so move those values into a dedicated capabilities structure and
>> implement the existing helper as a wrapper around the new caps-based
>> interface.
>
> I think, it was an intention of Maxime: make sure that every driver is
> forced to provide some values here. With the struct-based init it is
> easy to overlook or to ommit a value.
Agreed that the struct-based init loses the compile-time guarantee that every
argument is explicitly provided - that's a real downside.
I'd argue it's recoverable, though: the init helper validates the mandatory
fields, so a driver that omits a required value gets rejected at init time
rather than silently misconfigured. The "you must provide sane values" property
is expected to be preserved, just enforced at runtime instead of by the
compiler.
The main motivation for the struct is scalability/maintainability as we add HDMI
2.x capabilities: new fields go into the struct rather than growing the helper's
argument list, so existing callers don't need churny signature updates on every
extension.
FWIW, in the previous revision we discussed addressing the concern with a
callback instead. Sadly, I had to discard that approach, as it proved not
flexible enough, e.g. drm_bridge_connector_init() computes caps dynamically, and
would have required either stateful callbacks, or storing redundant/temporary
cap data in driver-private structures just to satisfy the callback.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>> drivers/gpu/drm/drm_connector.c | 202 +++++++++++++++++++++++++++-------------
>> include/drm/drm_connector.h | 55 +++++++++++
>> 2 files changed, 193 insertions(+), 64 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
>> index 8b4baed060f3..c7ce6b7bd8b0 100644
>> --- a/drivers/gpu/drm/drm_connector.c
>> +++ b/drivers/gpu/drm/drm_connector.c
>> @@ -542,6 +542,137 @@ int drmm_connector_init(struct drm_device *dev,
>> }
>> EXPORT_SYMBOL(drmm_connector_init);
>>
>> +/**
>> + * drmm_connector_hdmi_init_with_caps - Init a preallocated HDMI connector
>> + * @dev: DRM device
>> + * @connector: A pointer to the HDMI connector to init
>> + * @vendor: HDMI Controller Vendor name
>> + * @product: HDMI Controller Product name
>> + * @funcs: callbacks for this connector
>> + * @hdmi_funcs: HDMI-related callbacks for this connector
>> + * @connector_type: user visible type of the connector
>> + * @ddc: optional pointer to the associated ddc adapter
>> + * @caps: optional HDMI connector capabilities
>> + *
>> + * Initialises a preallocated HDMI connector. Connectors can be
>> + * subclassed as part of driver connector objects.
>> + *
>> + * Cleanup is automatically handled with a call to
>> + * drm_connector_cleanup() in a DRM-managed action.
>> + *
>> + * The connector structure should be allocated with drmm_kzalloc().
>> + *
>> + * The @drm_connector_funcs.destroy hook must be NULL.
>> + *
>> + * Returns:
>> + * Zero on success, error code on failure.
>> + */
>> +int drmm_connector_hdmi_init_with_caps(struct drm_device *dev,
>> + struct drm_connector *connector,
>> + const char *vendor, const char *product,
>> + const struct drm_connector_funcs *funcs,
>> + const struct drm_connector_hdmi_funcs *hdmi_funcs,
>> + int connector_type,
>> + struct i2c_adapter *ddc,
>> + const struct drm_connector_hdmi_caps *caps)
>> +{
>> + int ret;
>> +
>> + if (!vendor || !product)
>> + return -EINVAL;
>> +
>> + if ((strlen(vendor) > DRM_CONNECTOR_HDMI_VENDOR_LEN) ||
>> + (strlen(product) > DRM_CONNECTOR_HDMI_PRODUCT_LEN))
>> + return -EINVAL;
>> +
>> + if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
>> + connector_type == DRM_MODE_CONNECTOR_HDMIB))
>> + return -EINVAL;
>> +
>> + if (!caps)
>> + return -EINVAL;
>> +
>> + if (!caps->supported_formats ||
>> + !(caps->supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
>> + return -EINVAL;
>> +
>> + if (connector->ycbcr_420_allowed !=
>> + !!(caps->supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
>> + return -EINVAL;
>> +
>> + if (!(caps->max_bpc == 8 || caps->max_bpc == 10 || caps->max_bpc == 12))
>> + return -EINVAL;
>> +
>> + if (!hdmi_funcs->avi.clear_infoframe ||
>> + !hdmi_funcs->avi.write_infoframe ||
>> + !hdmi_funcs->hdmi.clear_infoframe ||
>> + !hdmi_funcs->hdmi.write_infoframe)
>> + return -EINVAL;
>> +
>> + ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc);
>> + if (ret)
>> + return ret;
>> +
>> + connector->hdmi.supported_formats = caps->supported_formats;
>> +
>> + /*
>> + * The supported HDMI version can be used to infer the maximum TMDS
>> + * character rate allowed by the specification. Some controllers,
>> + * however, may support a lower rate than that version would imply.
>> + *
>> + * A non-zero caps->max_tmds_char_rate lets drivers override the
>> + * inferred limit with the actual controller capability. A value of
>> + * zero keeps the default limit inferred from supported_hdmi_ver.
>> + */
>> + if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0)
>> + connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ;
>> + else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3)
>> + connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
>> + else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0)
>> + connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ;
>> +
>> + if (caps->max_tmds_char_rate) {
>> + if (caps->max_tmds_char_rate > connector->hdmi.max_tmds_char_rate)
>> + return -EINVAL;
>> + connector->hdmi.max_tmds_char_rate = caps->max_tmds_char_rate;
>> + }
>
> Here I'd totally suggest something simpler:
>
> if (!caps->max_tmds_char_rate) {
> if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0)
> connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ;
> else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3)
> connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
> else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0)
> connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ;
> }
My intention was to check that a driver-supplied caps->max_tmds_char_rate
doesn't exceed the spec-permitted maximum for the declared supported_hdmi_ver.
With the simplified form, a driver could declare e.g. HDMI 1.4 but pass a
2.0-level char rate, and we'd silently accept it.
Also, we'd still need to handle the supplied value in the non-zero case:
} else {
connector->hdmi.max_tmds_char_rate = caps->max_tmds_char_rate;
}
So the net reduction is smaller than it looks.
>> +
>> + strtomem_pad(connector->hdmi.vendor, vendor, 0);
>> + strtomem_pad(connector->hdmi.product, product, 0);
>> +
>> + /*
>> + * drm_connector_attach_max_bpc_property() requires the
>> + * connector to have a state.
>> + */
>> + if (connector->funcs->atomic_create_state) {
>> + struct drm_connector_state *state;
>> +
>> + state = connector->funcs->atomic_create_state(connector);
>> + if (IS_ERR(state))
>> + return PTR_ERR(state);
>> +
>> + connector->state = state;
>> + } else if (connector->funcs->reset) {
>> + connector->funcs->reset(connector);
>> + }
>> +
>> + drm_connector_attach_max_bpc_property(connector, 8, caps->max_bpc);
>> + connector->max_bpc = caps->max_bpc;
>
> If you don't like the max_bpc argument, let's do it other way:
>
> if (connector->max_bpc < 8)
> return -EINVAL;
If I follow correctly, you suggest dropping max_bpc from the caps struct and
letting drivers set connector->max_bpc before calling the init helper, leaving
the core to only do the reject.
Also note we actually have a more restricted check above:
if (!(caps->max_bpc == 8 || caps->max_bpc == 10 || caps->max_bpc == 12))
return -EINVAL;
I'd still keep max_bpc in the struct, assuming we can move further with the
caps approach.
> if (connector->max_bpc > 8)
> drm_connector_attach_hdr_output_metadata_property(connector);
>
>
>> +
>> + if (caps->max_bpc > 8)
>> + drm_connector_attach_hdr_output_metadata_property(connector);
>> +
>> + ret = drm_connector_attach_color_format_property(connector,
>> + caps->supported_formats);
>> + if (ret)
>> + return ret;
>> +
>> + connector->hdmi.funcs = hdmi_funcs;
>> +
>> + return 0;
>> +}
>> +EXPORT_SYMBOL(drmm_connector_hdmi_init_with_caps);
>> +
>> /**
>> * drmm_connector_hdmi_init - Init a preallocated HDMI connector
>> * @dev: DRM device
>> @@ -578,71 +709,14 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
>> unsigned long supported_formats,
>> unsigned int max_bpc)
>> {
>> - int ret;
>> + struct drm_connector_hdmi_caps caps = {
>> + .supported_formats = supported_formats,
>> + .max_bpc = max_bpc,
>> + };
>>
>> - if (!vendor || !product)
>> - return -EINVAL;
>> -
>> - if ((strlen(vendor) > DRM_CONNECTOR_HDMI_VENDOR_LEN) ||
>> - (strlen(product) > DRM_CONNECTOR_HDMI_PRODUCT_LEN))
>> - return -EINVAL;
>> -
>> - if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
>> - connector_type == DRM_MODE_CONNECTOR_HDMIB))
>> - return -EINVAL;
>> -
>> - if (!supported_formats || !(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
>> - return -EINVAL;
>> -
>> - if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
>> - return -EINVAL;
>> -
>> - if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
>> - return -EINVAL;
>> -
>> - if (!hdmi_funcs->avi.clear_infoframe ||
>> - !hdmi_funcs->avi.write_infoframe ||
>> - !hdmi_funcs->hdmi.clear_infoframe ||
>> - !hdmi_funcs->hdmi.write_infoframe)
>> - return -EINVAL;
>> -
>> - ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc);
>> - if (ret)
>> - return ret;
>> -
>> - connector->hdmi.supported_formats = supported_formats;
>> - strtomem_pad(connector->hdmi.vendor, vendor, 0);
>> - strtomem_pad(connector->hdmi.product, product, 0);
>> -
>> - /*
>> - * drm_connector_attach_max_bpc_property() requires the
>> - * connector to have a state.
>> - */
>> - if (connector->funcs->atomic_create_state) {
>> - struct drm_connector_state *state;
>> -
>> - state = connector->funcs->atomic_create_state(connector);
>> - if (IS_ERR(state))
>> - return PTR_ERR(state);
>> -
>> - connector->state = state;
>> - } else if (connector->funcs->reset) {
>> - connector->funcs->reset(connector);
>> - }
>> -
>> - drm_connector_attach_max_bpc_property(connector, 8, max_bpc);
>> - connector->max_bpc = max_bpc;
>> -
>> - if (max_bpc > 8)
>> - drm_connector_attach_hdr_output_metadata_property(connector);
>> -
>> - ret = drm_connector_attach_color_format_property(connector, supported_formats);
>> - if (ret)
>> - return ret;
>> -
>> - connector->hdmi.funcs = hdmi_funcs;
>> -
>> - return 0;
>> + return drmm_connector_hdmi_init_with_caps(dev, connector, vendor,
>> + product, funcs, hdmi_funcs,
>> + connector_type, ddc, &caps);
>> }
>> EXPORT_SYMBOL(drmm_connector_hdmi_init);
>>
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index af075c38f4db..961a729d0869 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -2029,6 +2029,47 @@ struct drm_connector_hdmi_audio {
>> int dai_port;
>> };
>>
>> +/**
>> + * struct drm_connector_hdmi_caps - HDMI capabilities structure
>> + *
>> + * This structure is required to initialize the connector using
>> + * drmm_connector_hdmi_init_with_caps().
>> + */
>> +struct drm_connector_hdmi_caps {
>> + /**
>> + * @supported_hdmi_ver:
>> + *
>> + * Maximum HDMI specification version supported by the controller side
>> + * of this connector. This describes the controller capability only;
>> + * the effective link capabilities may be further restricted by the
>> + * sink, bridge, or mode validation.
>> + *
>> + * HDMI_VERSION_UNKNOWN means legacy/default behaviour.
>
> What would it actually mean here? Every chip has some version of HDMI
> standard it conforms to.
HDMI_VERSION_UNKNOWN only exists for the legacy drmm_connector_hdmi_init()
wrapper, which doesn't pass a version - in that case the code keeps the
pre-existing behaviour (no version-inferred TMDS limit). Once all callers
migrate to the caps-based API, supported_hdmi_ver becomes mandatory.
Given that, I'd simply drop the "legacy/default behaviour" statement, unless you
have a better suggestion.
>> + */
>> + enum hdmi_version supported_hdmi_ver;
>> +
>> + /**
>> + * @supported_formats:
>> + *
>> + * Bitmask of @drm_output_color_format listing supported output formats.
>> + */
>> + unsigned long supported_formats;
>> +
>> + /**
>> + * @max_tmds_char_rate:
>> + *
>> + * Maximum TMDS character rate supported by the source, in Hz.
>> + * A value of 0 means the core should use the default limit implied by
>> + * @supported_hdmi_ver.
>> + */
>> + unsigned long long max_tmds_char_rate;
>> +
>> + /**
>> + * @max_bpc: Maximum bits per char the HDMI connector supports.
>> + */
>> + unsigned int max_bpc;
>> +};
>> +
>> /*
>> * struct drm_connector_hdmi - DRM Connector HDMI-related structure
>> */
>
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH v8 03/39] drm/display: bridge_connector: Pass HDMI capabilities through caps struct
2026-07-03 14:19 ` Dmitry Baryshkov
@ 2026-07-03 19:55 ` Cristian Ciocaltea
0 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-03 19:55 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
On 7/3/26 5:19 PM, Dmitry Baryshkov wrote:
> On Thu, Jul 02, 2026 at 05:46:16PM +0300, Cristian Ciocaltea wrote:
>> Switch drm_bridge_connector_init() to
>> drmm_connector_hdmi_init_with_caps(), collecting the bridge's HDMI
>> properties into a stack drm_connector_hdmi_caps so future HDMI 2.x
>> capabilities can be plumbed without growing the argument list.
>>
>> Introduce struct drm_bridge::supported_hdmi_ver to let bridges declare
>> the HDMI specification version they are conformant with, and forward it
>> to the connector layer through the new caps struct so HDMI 2.x features
>> can be gated on real source capability rather than guesswork.
>
> And it's left uninitialized by the bridges, which doesn't mean anything.
> If you don't want to touch all bridge drivers in one commit, please
> provide some migration path and hopefully get rid of it by the end of
> the series.
Sure, one question though: at the end of the migration, would it be fine to
stick with drmm_connector_hdmi_init_with_caps() and just drop
drmm_connector_hdmi_init()? Otherwise I'll rename it back.
> At least, there should be a drm_warn() if the version in
> unsspecified.
I’ll double-check if any use cases remain that can't be covered by this series.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>> drivers/gpu/drm/display/drm_bridge_connector.c | 29 ++++++++++++++------------
>> include/drm/drm_bridge.h | 6 ++++++
>> 2 files changed, 22 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
>> index 92f8a2d7aab4..796069dbf1a1 100644
>> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
>> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
>> @@ -823,8 +823,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>> struct drm_connector *connector;
>> struct i2c_adapter *ddc = NULL;
>> struct drm_bridge *panel_bridge __free(drm_bridge_put) = NULL;
>> - unsigned int supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
>> - unsigned int max_bpc = 8;
>> + struct drm_connector_hdmi_caps caps = {
>> + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
>> + .max_bpc = 8,
>> + };
>
> I'm really not sure that we need separate caps. But if we do, it would
> make sense to embed it as is in the drm_bridge instead of having the
> scattered fields.
Ack.
>
>> bool support_hdcp = false;
>> int connector_type;
>> int ret;
>> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
>> index 18f3db367dc1..2d8b5e4c64ba 100644
>> --- a/include/drm/drm_bridge.h
>> +++ b/include/drm/drm_bridge.h
>> @@ -1176,6 +1176,12 @@ struct drm_bridge {
>> */
>> const char *product;
>>
>> + /**
>> + * @supported_hdmi_ver: HDMI version the bridge is conformant with.
>> + * This is only relevant if @DRM_BRIDGE_OP_HDMI is set.
>> + */
>> + enum hdmi_version supported_hdmi_ver;
>> +
>> /**
>> * @supported_formats: Bitmask of @drm_output_color_format listing
>> * supported output formats. This is only relevant if
>>
>> --
>> 2.54.0
>>
>
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH v8 04/39] drm/connector: Add HDMI 2.0 scrambler infrastructure
2026-07-03 14:34 ` Dmitry Baryshkov
@ 2026-07-03 20:54 ` Cristian Ciocaltea
0 siblings, 0 replies; 48+ messages in thread
From: Cristian Ciocaltea @ 2026-07-03 20:54 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Sandy Huang, Heiko Stübner, Andy Yan, Daniel Stone,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
kernel, dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip
On 7/3/26 5:34 PM, Dmitry Baryshkov wrote:
> On Thu, Jul 02, 2026 at 05:46:17PM +0300, Cristian Ciocaltea wrote:
>> Add the connector-level infrastructure to support HDMI 2.0 scrambling:
>>
>> - A scrambler_supported flag to indicate whether the source supports the
>> scrambling capability, in which case the newly introduced
>> .scrambler_{enable|disable}() callbacks in drm_connector_hdmi_funcs
>> are mandatory
>
> Do we need a flag? What would it mean if the flag is set, but the
> callbacks are not? Can we drop the flag and use the presence of the
> callbacks as a way to identify that scrambler is enabled?
The flag is intended to be set only within drmm_connector_hdmi_init_with_caps()
when drivers advertise HDMI 2.x capability, in which case it also ensures the
callbacks are provided.
We could drop the flag and instead have the init helper clear the callbacks if
they were provided for HDMI 1.x. This might slightly reduce code readability,
as it relies on checking the presence of individual callbacks - especially since
we plan to extend this further with HDMI 2.1 support, providing four or five
additional FRL-specific callbacks.
That said, I don’t have a strong opinion on this.
>> - A scrambler_needed flag to be managed by the hdmi state helpers based
>> on the negotiated TMDS character rate and the source/sink scrambling
>> capabilities
>> - A scrambler_enabled flag to track whether scrambling is currently
>> active
>> - A delayed work item (scdc_work) with an associated callback (scdc_cb)
>> to monitor sink-side scrambling status and retry the setup if the sink
>> resets it
>>
>> These are intended to be used by SCDC scrambling helpers to coordinate
>> scrambling setup and teardown between the source driver and the DRM
>> core.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>> drivers/gpu/drm/drm_connector.c | 26 ++++++++++++--
>> include/drm/drm_connector.h | 77 +++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 100 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
>> index c7ce6b7bd8b0..deecfc582f09 100644
>> --- a/drivers/gpu/drm/drm_connector.c
>> +++ b/drivers/gpu/drm/drm_connector.c
>> @@ -220,6 +220,19 @@ void drm_connector_free_work_fn(struct work_struct *work)
>> }
>> }
>>
>> +static void drm_connector_hdmi_scdc_work(struct work_struct *work)
>> +{
>> + struct drm_connector *connector;
>> + struct drm_connector_hdmi *hdmi;
>> +
>> + hdmi = container_of(to_delayed_work(work), struct drm_connector_hdmi,
>> + scdc_work);
>> + connector = container_of(hdmi, struct drm_connector, hdmi);
>> +
>> + if (hdmi->scdc_cb)
>> + hdmi->scdc_cb(connector);
>> +}
>> +
>> static int drm_connector_init_only(struct drm_device *dev,
>> struct drm_connector *connector,
>> const struct drm_connector_funcs *funcs,
>> @@ -285,6 +298,7 @@ static int drm_connector_init_only(struct drm_device *dev,
>> mutex_init(&connector->edid_override_mutex);
>> mutex_init(&connector->hdmi.infoframes.lock);
>> mutex_init(&connector->hdmi_audio.lock);
>> + INIT_DELAYED_WORK(&connector->hdmi.scdc_work, drm_connector_hdmi_scdc_work);
>> connector->edid_blob_ptr = NULL;
>> connector->epoch_counter = 0;
>> connector->tile_blob_ptr = NULL;
>> @@ -624,12 +638,18 @@ int drmm_connector_hdmi_init_with_caps(struct drm_device *dev,
>> * inferred limit with the actual controller capability. A value of
>> * zero keeps the default limit inferred from supported_hdmi_ver.
>> */
>
> Here we need to check that the driver doesn't set only one callback of
> the pair.
Is anything missing from the check below? I chose to ignore the presence of the
callbacks in HDMI 1.x cases.
>
>> - if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0)
>> + if (caps->supported_hdmi_ver >= HDMI_VERSION_2_0) {
>> + if (!hdmi_funcs->scrambler_enable ||
>> + !hdmi_funcs->scrambler_disable)
>> + return -EINVAL;
>> +
>> + connector->hdmi.scrambler_supported = true;
>> connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ;
>> - else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3)
>> + } else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_3) {
>> connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ;
>> - else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0)
>> + } else if (caps->supported_hdmi_ver >= HDMI_VERSION_1_0) {
>> connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ;
>> + }
>>
>> if (caps->max_tmds_char_rate) {
>> if (caps->max_tmds_char_rate > connector->hdmi.max_tmds_char_rate)
>> +
>> + /** @scdc_cb: Callback to be invoked as part of @scdc_work.
>> + *
>> + * Currently used to monitor sink-side scrambling status and retry
>> + * setup if the sink resets it.
>> + *
>> + * This is assigned by the framework when making use of
>> + * drm_connector_hdmi_enable_scrambling() helper.
>
> No such helper.
Right, I'll drop the reference to the helper name, as that's added later in the
series.
> Also, please explain in the commit message, why do we
> need to keep it configurable. Why the default is not enough?
We will need a separate callback to support HDMI 2.1, i.e. for link training
management. I’ll update the commit message accordingly.
Thanks,
Cristian
^ permalink raw reply [flat|nested] 48+ messages in thread
end of thread, other threads:[~2026-07-03 20:54 UTC | newest]
Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02 14:46 [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 01/39] video/hdmi: Introduce HDMI version enum Cristian Ciocaltea
2026-07-03 13:55 ` Dmitry Baryshkov
2026-07-02 14:46 ` [PATCH v8 02/39] drm/connector: Add caps-based HDMI connector init helper Cristian Ciocaltea
2026-07-03 14:05 ` Dmitry Baryshkov
2026-07-03 19:31 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 03/39] drm/display: bridge_connector: Pass HDMI capabilities through caps struct Cristian Ciocaltea
2026-07-03 14:19 ` Dmitry Baryshkov
2026-07-03 19:55 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 04/39] drm/connector: Add HDMI 2.0 scrambler infrastructure Cristian Ciocaltea
2026-07-03 14:34 ` Dmitry Baryshkov
2026-07-03 20:54 ` Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 05/39] drm/display: scdc-helper: Add macro for connector-prefixed debug messages Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 06/39] drm/display: scdc-helper: Add helper to set SCDC version information Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 07/39] drm/display: hdmi: Add HDMI 2.0 scrambling management helpers Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 08/39] drm/display: hdmi: Advertise SCDC source version when scrambling Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 09/39] drm/display: hdmi-state-helper: Add fallback TMDS rate validation Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 10/39] drm/display: hdmi-state-helper: Sync SCDC state on hotplug Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 11/39] drm/display: hdmi-state-helper: Set HDMI scrambling requirement Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 12/39] drm/bridge: Remove redundant error check in drm_bridge_helper_reset_crtc() Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 13/39] drm/bridge: Add bridge ops for source-side HDMI 2.0 scrambling Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 14/39] drm/display: bridge_connector: Use cached connector status in .get_modes() Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 15/39] drm/display: bridge_connector: Switch to .detect_ctx() connector helper Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 16/39] drm/display: bridge_connector: Wire up HDMI 2.0 scrambler callbacks Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 17/39] drm/bridge: dw-hdmi-qp: Rate limit i2c read error messages Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 18/39] drm/bridge: dw-hdmi-qp: Provide .{enable|disable}_hpd() PHY ops Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 19/39] drm/bridge: dw-hdmi-qp: Add HDMI 2.0 SCDC scrambling support Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 20/39] drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 21/39] drm/rockchip: dw_hdmi_qp: Add missing newlines in dev_err_probe() messages Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 22/39] drm/rockchip: dw_hdmi_qp: Use local dev variable consistently in bind() Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 23/39] drm/rockchip: dw_hdmi_qp: Drop unnecessary #include Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 24/39] drm/rockchip: dw_hdmi_qp: Defer HPD IRQ enable until after connector setup Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 25/39] drm/rockchip: dw_hdmi_qp: Mask RK3576 HPD IRQ in io_init Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 26/39] drm/rockchip: dw_hdmi_qp: Implement .{enable|disable}_hpd() PHY ops Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 27/39] drm/rockchip: dw_hdmi_qp: Use dw_hdmi_qp_hpd_notify() for HPD reports Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 28/39] drm/bridge: dw-hdmi-qp: Drop unused .setup_hpd() phy op Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 29/39] drm/vc4: hdmi: Use common TMDS char rate constants Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 30/39] drm/vc4: hdmi: Switch to drm_hdmi_mode_needs_scrambling() Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 31/39] drm/vc4: hdmi: Convert to common SCDC scrambling infrastructure Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 32/39] drm/tests: connector: Add HDMI caps-based init coverage Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 33/39] drm/tests: connector: Add HDMI source-side scrambler coverage Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 34/39] drm/tests: hdmi_state_helper: Use drmm_connector_hdmi_init_with_caps() Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 35/39] drm/tests: hdmi_state_helper: Add max_tmds_char_rate fallback tests Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 36/39] drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 37/39] drm/tests: hdmi_state_helper: Cover source-side scrambling decision Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 38/39] drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID Cristian Ciocaltea
2026-07-02 14:46 ` [PATCH v8 39/39] drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID Cristian Ciocaltea
2026-07-02 15:31 ` [PATCH v8 00/39] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox