Skip to content

Add support for DisplayPort link training information report

Kory Maincent dri-devel intel-gfx intel-xe linux-arm-kernel linux-mediatek lkml 4 versions – New

Get series with b4
b4 am [email protected] change-id 20260226-feat_link_cap-20cbb6f31d40

Versions newest first

  1. v4 Latest8 patches 0 repliesNew
  2. v3 RFC8 patches 8 repliesSuperseded
  3. v2 RFC4 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC12 patches16 repliesSuperseded

Changes in v4 from the cover letter

- Add a new mutex to protect sysfs group update
- Remove the check on the connection_mutex
- Add the newly supported DisplayPort tunnel features in the series
- Link to v3: https://patch.msgid.link/[email protected]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8drm: Move sink link rates reading helpers out of i915drivers/gpu/drm/display/drm_dp_helper.c drivers/gpu/drm/i915/display/intel_dp.c include/drm/display/drm_dp.h +1 more+294 -1560 replies
2/8drm: Move DSC capability reading helper out of i915drivers/gpu/drm/display/drm_dp_helper.c drivers/gpu/drm/i915/display/intel_dp.c include/drm/display/drm_dp_helper.h+36 -240 replies
3/8drm: Introduce DisplayPort link training capabilities and state helpersDocumentation/ABI/testing/sysfs-class-drm-dp drivers/gpu/drm/display/drm_dp_helper.c drivers/gpu/drm/drm_connector.c +4 more+636 -00 replies
4/8drm/i915/display/dp: Read DPCD DSC capabilities in any casedrivers/gpu/drm/i915/display/intel_dp.c+0 -50 replies
5/8drm/i915/display/dp: Use dp_connector helpers to expose link training statedrivers/gpu/drm/i915/display/intel_display_types.h drivers/gpu/drm/i915/display/intel_dp.c drivers/gpu/drm/i915/display/intel_dp_link_training.c+69 -20 replies
6/8drm/bridge: Expose link training state via new DRM_BRIDGE_OP_DP flagdrivers/gpu/drm/display/Kconfig drivers/gpu/drm/display/drm_bridge_connector.c include/drm/drm_bridge.h+43 -00 replies
7/8drm/analogix/anx7625: Use dp_connector helpers to expose link training statedrivers/gpu/drm/bridge/analogix/anx7625.c drivers/gpu/drm/bridge/analogix/anx7625.h+69 -00 replies
8/8drm/mediatek: Use dp_connector helpers to expose link training statedrivers/gpu/drm/mediatek/mtk_dp.c+57 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/8] Add support for DisplayPort link training information report

DisplayPort link training negotiates the physical-layer parameters needed for a reliable connection: lane count, link rate, and optionally Display Stream Compression (DSC). Currently, each driver exposes this state in its own way, often through driver-specific debugfs entries, with no standard interface for userspace diagnostic and monitoring tools.

This series introduces generic helpers, for exposing DP link capabilities and state as standard sysfs entries.

The aim of such development is to guide users to select the most suitable DisplayPort connector for their needs. For example, if you have a USB-C hub with lesser capabilities than your computer’s native DisplayPort connector (such as HBR2 versus HBR3 support), the system could recommend connecting high-resolution displays directly to the computer’s port instead of through the hub to ensure optimal performance.

The new drm_dp_source_set_caps and drm_dp_sink_set_caps helper expose source and sink training capabilities to userspace via sysfs attributes under dp_link. Finally drm_dp_set_cur_link_params helper is provided to report current link information at runtime.

Three drivers are updated as reference implementations: i915 (direct connector path), ANX7625 and MediaTek (via the bridge connector framework using a new DRM_BRIDGE_OP_DP flag).

Here is a sysfs example:

cur_link_info_dsc            sink_link_caps_nlanes
cur_link_info_link_rate      source_link_caps_dsc
cur_link_info_nlanes         source_link_caps_link_rates
sink_link_caps_dsc           source_link_caps_nlanes

sink_link_caps_link_rates

1620000 2160000 2700000 3240000 4320000 5400000

1620000 2700000 5400000 10000000 20000000

5400000

This series is rebased on top of drm-misc and may conflict with the current state of the drm i915 tree. Which tree should pick this up, given that it mixes core development with driver changes?

Patch 1,2: Move helpers out of i915
Patch 3: Introduce DisplayPort link training capabilities and state helpers Patch 4: Read i915 DSC capabilities in any case
Patch 5 Use dp_connector helpers in i915 to expose link training state Patch 6: Introduce DRM_BRIDGE_OP_DP and wire bridge connectors Patch 7: Use dp_connector helpers in anx7625 to expose link training state Patch 8: Use dp_connector helpers in mediatek to expose link training state

Changes in v4:
- Add a new mutex to protect sysfs group update
- Remove the check on the connection_mutex
- Add the newly supported DisplayPort tunnel features in the series
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- Rework the core to use new helpers instead of an extension of drmm_connector_init().
- Add a new mutex to protect sysfs read write access instead of using
the global connection_mutex.
- Move helpers out of i915.
- Add the support in the anx7625 driver.
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Removed work converting i915 to DRM managed resource
- Remove voltage swing and pre-emphasis properties
- Expose link training state via sysfs dp_link/ group instead of
connector properties
- Add comprehensive sysfs attributes for both source and sink capabilities
- Add new helpers for managing sink capabilities and for current link parameters
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Kory Maincent (8):
drm: Move sink link rates reading helpers out of i915
drm: Move DSC capability reading helper out of i915
drm: Introduce DisplayPort link training capabilities and state helpers drm/i915/display/dp: Read DPCD DSC capabilities in any case drm/i915/display/dp: Use dp_connector helpers to expose link training state drm/bridge: Expose link training state via new DRM_BRIDGE_OP_DP flag drm/analogix/anx7625: Use dp_connector helpers to expose link training state drm/mediatek: Use dp_connector helpers to expose link training state

 Documentation/ABI/testing/sysfs-class-drm-dp       |  85 +++
 drivers/gpu/drm/bridge/analogix/anx7625.c          |  68 +++
 drivers/gpu/drm/bridge/analogix/anx7625.h          |   1 +
 drivers/gpu/drm/display/Kconfig                    |   1 +
 drivers/gpu/drm/display/drm_bridge_connector.c     |  29 +
 drivers/gpu/drm/display/drm_dp_helper.c            | 590 +++++++++++++++++++++
 drivers/gpu/drm/drm_connector.c                    |  13 +
 drivers/gpu/drm/drm_sysfs.c                        | 160 ++++++
 drivers/gpu/drm/i915/display/intel_display_types.h |   2 +
 drivers/gpu/drm/i915/display/intel_dp.c            | 264 +++------
 .../gpu/drm/i915/display/intel_dp_link_training.c  |  14 +
 drivers/gpu/drm/mediatek/mtk_dp.c                  |  61 ++-
 include/drm/display/drm_dp.h                       |   1 +
 include/drm/display/drm_dp_helper.h                |  25 +
 include/drm/drm_bridge.h                           |  13 +
 include/drm/drm_connector.h                        |  59 +++
 include/drm/drm_sysfs.h                            |   1 +
 17 files changed, 1200 insertions(+), 187 deletions(-)

---
base-commit: 932326f098877d9650c80ed428d82fc2dc14e841
change-id: 20260226-feat_link_cap-20cbb6f31d40

Best regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com