Re: [PATCH v9 0/5] Add SCDC information to connector debugfs
Jani Nikula <[email protected]> Mon, 27 Jul 2026 11:35:15 +0300
| Newsgroups | dev.linux.lists.linux-sunxi,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel |
|---|---|
| Organization | Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland |
| Message-ID | <[email protected]> |
On Fri, 24 Jul 2026, Nicolas Frattaroli <[email protected]> wrote: > HDMI uses the DDC I2C bus for communicating various bits of link status > out of band with the actual HDMI video signal. This information can be > useful for debugging issues like questionable cables sabotaged by feline > teeth, Enthusiast Grade cables made of cow fencing wire, and other such > problems that ruin one's media viewing plans. > > Consequently, this series exposes various bits of pertinent information > from the SCDC protocol in an HDMI connector's debugfs. To continually > poll the link status, userspace can poll the debugfs file. Is there a reason we can't add a character device node for this similar to DP AUX? See config DRM_DISPLAY_DP_AUX_CHARDEV. It's ultimately more generic than deciphering everything in kernel. BR, Jani. > > --- > Changes in v9: > - Unlock mode_config.mutex on disconnected connector early exit > - Calculate and print Reed-Solomon error corrections counter on != 4 > lane FRL as well. Technically a functional change to an already > reviewed patch, but I kept the R-b because it's so minor. > - Link to v8: https://patch.msgid.link/[email protected] > > Changes in v8: > - Acquire mode_config mutex in an interruptible way during > scdc_status_show to avoid racing connector state > - Remove scdc_debugfs_priv, use connector as debugfs entry priv instead > - Allocate and free state in scdc_status_show, since it doesn't need to > persist across debugfs reads > - Check for NULL ddc in drm_scdc_read_state in the unlikely event an > EDID with the SCDC flag was forced on a connector with no DDC > - Note: drm_connector_get() is omitted from drm_scdc_debugfs_init > because drm_scdc_debugfs_init is called on connector construction and > the debugfs is removed on connector destruction. Adding a redundant > reference increase here would necessitate introducing a destruction > callback to mirror the debugfs_init connector op for the sole purpose > of decreasing the counter again. > - Link to v7: https://patch.msgid.link/[email protected] > > Changes in v7: > - Move HDMI debugfs registration to new state helper, fix up all users > (sun4i, vc4, bridge) > - Register scdc debugfs in new hdmi debugfs helper > - Link to v6: https://patch.msgid.link/[email protected] > > Changes in v6: > - Fix off-by-one error in drm_scdc_read_state > - Link to v5: https://patch.msgid.link/[email protected] > > Changes in v5: > - Read all SCDC data regardless of update flags > - Dump SCDC data as hex before the human-readable output. It's separated > with "\n----------------\n\n". > - No longer write 0 to read-only registers > - Add Reed-Solomon Corrections counter parsing > - Parsing has been kept. A desire was expressed to get this data without > any external userspace tooling, and the kernel will need to parse it > eventually anyway to set the link status. > - Functions have been made static as of right now, since external users > may do another pass over the function signatures anyway. > - Link to v4: https://patch.msgid.link/[email protected] > > Changes in v4: > - Don't use C struct bitfields for parsing status flags. Switch to > bitwise AND for boolean flags, and FIELD_GET for multi-bit values. > - Drop the superfluous !! and parens > - Drop the __pure attributes on static functions > - Initialise stack local arrays with {}, not { 0 }. > - I've kept the print macros and %-30s format. Reason being that I don't > want to repeat the format specifier and str_yes_no(foo) a bunch, and I > like the %-30s format because it means all values are aligned with the > value of the longest field, which is 30 chars long. > - Link to v3: https://patch.msgid.link/[email protected] > > Changes in v3: > - Add patch to change return type of drm_scdc_read/write. > - Rework error counter reading to duplicate less code. > - Also check lane 3 counter valid flag when reading its error counter. > - Use memset to clear buf for error counters, rather than doing it in > the loop. > - Make read_error_counters not accept 0 as num_lanes; fix it up in the > caller instead. > - Link to v2: https://patch.msgid.link/[email protected] > > Changes in v2: > - Add HDMI 2.1 SCDC status reporting > - Link to v1: https://patch.msgid.link/[email protected] > > To: Jani Nikula <[email protected]> > To: Maarten Lankhorst <[email protected]> > To: Maxime Ripard <[email protected]> > To: Thomas Zimmermann <[email protected]> > To: David Airlie <[email protected]> > To: Simona Vetter <[email protected]> > To: Andrzej Hajda <[email protected]> > To: Neil Armstrong <[email protected]> > To: Robert Foss <[email protected]> > To: Laurent Pinchart <[email protected]> > To: Jonas Karlman <[email protected]> > To: Jernej Skrabec <[email protected]> > To: Luca Ceresoli <[email protected]> > To: Daniel Stone <[email protected]> > To: Hans Verkuil <[email protected]> > To: Chen-Yu Tsai <[email protected]> > To: Samuel Holland <[email protected]> > To: Dave Stevenson <[email protected]> > To: MaĆra Canal <[email protected]> > To: Raspberry Pi Kernel Maintenance <[email protected]> > Cc: [email protected] > Cc: [email protected] > Cc: [email protected] > Cc: [email protected] > Cc: [email protected] > Signed-off-by: Nicolas Frattaroli <[email protected]> > > --- > Nicolas Frattaroli (5): > drm/scdc-helper: Don't use ssize_t return type for scdc_read/write > drm/scdc-helper: Add scdc_status debugfs entry > drm/scdc-helper: Implement parsing and printing HDMI 2.1 fields > drm/debugfs: Move HDMI debugfs registration to state helper > drm/display: hdmi-state-helper: Init SCDC debugfs for HDMI > > drivers/gpu/drm/display/drm_bridge_connector.c | 3 + > drivers/gpu/drm/display/drm_hdmi_state_helper.c | 156 +++++++++++++ > drivers/gpu/drm/display/drm_scdc_helper.c | 289 +++++++++++++++++++++++- > drivers/gpu/drm/drm_debugfs.c | 157 ------------- > drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 1 + > drivers/gpu/drm/vc4/vc4_hdmi.c | 1 + > include/drm/display/drm_hdmi_state_helper.h | 3 + > include/drm/display/drm_scdc.h | 21 +- > include/drm/display/drm_scdc_helper.h | 103 ++++++++- > 9 files changed, 568 insertions(+), 166 deletions(-) > --- > base-commit: b747a63003130bef1a3d5d6ba97c94d0cee36f55 > change-id: 20260413-scdc-link-health-89326013d96c > > Best regards, > -- > Nicolas Frattaroli <[email protected]> > -- Jani Nikula, Intel