Skip to content

drm/bridge: Implement generic USB Type-C DP HPD bridge

Chaoyi Chen dri-devel linux-arm-kernel linux-phy linux-rockchip lkml 7 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest7 patches 0 repliesNew
  2. v77 patches 0 repliesSuperseded
  3. v67 patches 4 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v56 patches2 repliesSuperseded
v45 patches4 repliesSuperseded
v35 patches4 repliesSuperseded
v15 patches0 repliesSuperseded

Changes in v8 from the cover letter

- Link to v7: https://lore.kernel.org/all/[email protected]/
- Send missing HPD event to userspace in cdn_dp_pd_event_work() (sashiko).

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7drm/bridge: aux-hpd-bridge: Add drm_dev_has_dp_hpd_bridge()drivers/gpu/drm/bridge/aux-hpd-bridge.c include/drm/bridge/aux-bridge.h+47 -10 replies
2/7drm/bridge: Implement generic USB Type-C DP HPD bridgedrivers/gpu/drm/bridge/Kconfig drivers/gpu/drm/bridge/Makefile drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c+78 -00 replies
3/7drm/display: Add soft depend for aux-hpd-typec-dp-bridge moduledrivers/gpu/drm/display/drm_display_helper_mod.c+1 -00 replies
4/7drm/bridge: aux: Add drm_aux_bridge_register_from_node()drivers/gpu/drm/bridge/aux-bridge.c include/drm/bridge/aux-bridge.h+29 -30 replies
5/7phy: rockchip: phy-rockchip-typec: Add DRM AUX bridgedrivers/phy/rockchip/Kconfig drivers/phy/rockchip/phy-rockchip-typec.c+13 -20 replies
6/7drm/rockchip: cdn-dp: Support handle lane info without extcondrivers/gpu/drm/rockchip/cdn-dp-core.c+17 -80 replies
7/7drm/rockchip: cdn-dp: Add multiple bridges to support PHY port selectiondrivers/gpu/drm/rockchip/Kconfig drivers/gpu/drm/rockchip/cdn-dp-core.c drivers/gpu/drm/rockchip/cdn-dp-core.h+306 -580 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchSebastian ReichelHeikki KrogerusNicolas FrattaroliNeil ArmstrongHeiko StuebnerLuca CeresoliVinod Koul
1/7R-b T-b
2/7R-b T-b R-b R-b
3/7R-b T-b
4/7R-b R-b R-b
5/7R-b R-b A-b
6/7R-b
7/7R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.

Read the v8 thread

Cover letter [PATCH v8 0/7] drm/bridge: Implement generic USB Type-C DP HPD bridge

From: Chaoyi Chen <[email protected]>

This series is split from the v15 "Add Type-C DP support for RK3399 EVB IND board" series [1]. It focuses on the DRM bridge and Rockchip platform CDN-DP controller changes.

[1] https://lore.kernel.org/all/[email protected]/

====
1. Generic Type-C DP HPD bridge

Currently, several USB-C controller drivers register their own DP HPD bridge via aux-hpd-bridge.c, each duplicating the same logic. For devicetree based platforms, the USB-C controller may vary across boards, and not every USB-C controller driver implements this feature. Patch 1 implements a generic DP HPD bridge that monitors Type-C bus events and automatically creates an HPD bridge when a Type-C port device with DP SVID is registered.

2. Multiple bridge model for CDN-DP

The RK3399 has two USB/DP combo PHY and one CDN-DP controller. Patch 5 introduces a multi-bridge model where each PHY port gets a separate encoder and bridge, allowing flexible selection of the output PHY port. This is based on the DRM AUX HPD bridge rather than extcon.

====
Patch 1 adds new API to check whether a DisplayPort HPD bridge has
already been registered (Sebastian).
Patch 2 adds generic USB Type-C DP HPD bridge (Dmitry, Heikki). Patch 3 adds module soft depend for USB Type-C DP HPD bridge(Sebastian). Patch 4 adds new API drm_aux_bridge_register_from_node() (Neil). Patch 5 adds DRM AUX bridge support for RK3399 USBDP PHY (Neil). Patch 6 drops CDN-DP's extcon dependency when Type-C is present (Dmitry). Patch 7 adds multiple bridges to support PHY port selection (Dmitry, Luca).

Changes in v8:
- Link to v7: https://lore.kernel.org/all/[email protected]/
- Send missing HPD event to userspace in cdn_dp_pd_event_work() (sashiko).

Changes in v7:
- Link to v6: https://lore.kernel.org/all/[email protected]/
- Fix extcon HPD detection by checking lanes in cdn_dp_connected_port() (sashiko).
- Bound endpoint count by PHY ports to avoid overflow and uninitialized reads (sashiko).
- Use drm_bridge_clear_and_put() to clear next_bridge_list pointers (sashiko).
- Clear EDID cache pointers after free in unbind() (sashiko).

Changes in v6:
- Link to v5: https://lore.kernel.org/all/[email protected]/
- Avoid duplicate registration of the same DisplayPort HPD bridge.

Changes in v5:
- Link to v4: https://lore.kernel.org/all/[email protected]/
- Add module soft depend for USB Type-C DP HPD bridge.

Changes in v4:
- Link to v3: https://lore.kernel.org/all/[email protected]/
- Scan the entire typec_bus and attempt to register the hpd bridge, so as not to miss devices that were already added during initialization.

Changes in v3:
- Link to v2: https://lore.kernel.org/all/[email protected]/
(Sorry, I forgot to add the "v2" title, so it looks like v1.)
- Remove now-redundant call to drm_connector_attach_encoder()
- Rebase to v7.2-rc2

Changes in v2:
- Link to v1: https://lore.kernel.org/all/[email protected]/
- Add copyright text.
- Remove useless goto.
- Fix incorrect function names in the documentation comments.
- Fix the check logic for dp->active_port (0 is valid).
- Fix the uninitialized prev_port.
- Remove duplicate logic from cdn_dp_switch_port().
- Fix the prototype of cdn_dp_bridge_hpd_notify().
- Properly release connector->fwnode.
- Properly release next_bridge.

Chaoyi Chen (7):
drm/bridge: aux-hpd-bridge: Add drm_dev_has_dp_hpd_bridge() drm/bridge: Implement generic USB Type-C DP HPD bridge drm/display: Add soft depend for aux-hpd-typec-dp-bridge module drm/bridge: aux: Add drm_aux_bridge_register_from_node()
phy: rockchip: phy-rockchip-typec: Add DRM AUX bridge drm/rockchip: cdn-dp: Support handle lane info without extcon drm/rockchip: cdn-dp: Add multiple bridges to support PHY port
selection

 drivers/gpu/drm/bridge/Kconfig                |  10 +
 drivers/gpu/drm/bridge/Makefile               |   1 +
 drivers/gpu/drm/bridge/aux-bridge.c           |  26 +-
 drivers/gpu/drm/bridge/aux-hpd-bridge.c       |  42 +-
 .../gpu/drm/bridge/aux-hpd-typec-dp-bridge.c  |  67 ++++
 .../gpu/drm/display/drm_display_helper_mod.c  |   1 +
 drivers/gpu/drm/rockchip/Kconfig              |   1 +
 drivers/gpu/drm/rockchip/cdn-dp-core.c        | 369 +++++++++++++++---
 drivers/gpu/drm/rockchip/cdn-dp-core.h        |  19 +-
 drivers/phy/rockchip/Kconfig                  |   2 +
 drivers/phy/rockchip/phy-rockchip-typec.c     |  13 +-
 include/drm/bridge/aux-bridge.h               |  12 +
 12 files changed, 491 insertions(+), 72 deletions(-)
 create mode 100644 drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c
Signature · 1 line
2.53.0