summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorNicolas Frattaroli <nicolas.frattaroli@collabora.com>2026-07-24 16:22:37 +0200
committerDaniel Stone <daniels@collabora.com>2026-08-13 16:07:41 +0100
commit6c5121962ec0cb486fa189a0c5dc17441c2f9e9c (patch)
tree8925d86869baf1008a31a1ab8e6b09604ea9fd79 /include/drm
parented4a19460fb9ff47d01f02c2375499c1110dd1b3 (diff)
drm/scdc-helper: Add scdc_status debugfs entry
SCDC provides status information on the current display link. At the very least, it may be useful to expose this info through debugfs. Add a debugfs entry for it under the connector, which displays a few more details parsed out of the SCDC registers. A new drm_scdc_debugfs_init function can be called by the connector implementation to initialise the debugfs file. Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Maxime Ripard <mripard@kernel.org> Tested-by: Hans Verkuil <hverkuil+cisco@kernel.org> Link: https://patch.msgid.link/20260724-scdc-link-health-v9-2-bdda406d016d@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/display/drm_scdc_helper.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/drm/display/drm_scdc_helper.h b/include/drm/display/drm_scdc_helper.h
index e9ccaeba56dd..e0b79d79e1ff 100644
--- a/include/drm/display/drm_scdc_helper.h
+++ b/include/drm/display/drm_scdc_helper.h
@@ -30,6 +30,34 @@
struct drm_connector;
struct i2c_adapter;
+struct dentry;
+
+struct drm_scdc_status_flags {
+ /* Status Register 0 */
+ bool clock_detected;
+ bool ch0_locked;
+ bool ch1_locked;
+ bool ch2_locked;
+};
+
+struct drm_scdc_state {
+ /** @stf: contents of the status flag registers */
+ struct drm_scdc_status_flags stf;
+ /** @scramling_enabled: true if TMDS scrambling is on */
+ bool scrambling_enabled;
+ /** @scrambling_detected: true if the sink actually detected scrambling */
+ bool scrambling_detected;
+ /**
+ * @tmds_bclk_x40: true if TMDS bit period is 1/40th of the TMDS
+ * clock period, false if it's 1/10th of the clock period.
+ */
+ bool tmds_bclk_x40;
+ /** @error_count: character error counts for each channel */
+ u16 error_count[3];
+
+ /** @scdc: raw SCDC data buffer */
+ u8 scdc[256];
+};
int drm_scdc_read(struct i2c_adapter *adapter, u8 offset, void *buffer,
size_t size);
@@ -77,4 +105,8 @@ bool drm_scdc_get_scrambling_status(struct drm_connector *connector);
bool drm_scdc_set_scrambling(struct drm_connector *connector, bool enable);
bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector, bool set);
+int drm_scdc_read_state(struct drm_connector *connector,
+ struct drm_scdc_state *state);
+void drm_scdc_debugfs_init(struct drm_connector *connector, struct dentry *root);
+
#endif