Skip to content

drm: bridge: dw_hdmi: Misc enable/disable, CEC and EDID cleanup

Jonas Karlman dri-devel imx linux-amlogic linux-arm-kernel linux-rockchip linux-sunxi lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest23 patches 20 repliesIn review
  2. v622 patches 5 repliesSuperseded
  3. v521 patches 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v417 patches1 replySuperseded
v313 patches18 repliesSuperseded

Changes in v7 from the cover letter

- Add patch to fix use-after-free when CEC adapter is unregistered
- Only declare CEC notifier support when CEC device register succeeds
- Re-order patches to drop drm_edid_raw() use before exposing more usage
- Change to free irq before mute and clear using IH regs
- Rebased on next-20260518
Link to v6: https://lore.kernel.org/dri-devel/[email protected]/

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23drm: bridge: dw_hdmi: Disable scrambler feature when not supporteddrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+2 -00 replies
2/23drm: bridge: dw_hdmi: Only notify connected status on HPD interruptdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+2 -10 replies
3/23drm: bridge: dw_hdmi: Free IRQ before CEC adapter is unregistereddrivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c+1 -01 reply
4/23drm: bridge: dw_hdmi: Hold bridge ref until connector cleanupdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+18 -54 replies
5/23drm: bridge: dw_hdmi: Call poweron/poweroff from atomic enable/disabledrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+2 -310 replies
6/23drm: bridge: dw_hdmi: Use passed mode instead of stored previous_modedrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+4 -50 replies
7/23drm: bridge: dw_hdmi: Fold poweron and setup functionsdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+8 -130 replies
8/23drm: bridge: dw_hdmi: Remove previous_mode and mode_setdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+1 -180 replies
9/23drm: bridge: dw_hdmi: Unregister CEC notifier during connector cleanupdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+5 -112 replies
10/23drm: bridge: dw_hdmi: Invalidate CEC phys addr from connector detectdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+11 -71 reply
11/23drm: bridge: dw_hdmi: Remove cec_notifier_mutexdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+1 -101 reply
12/23drm: bridge: dw_hdmi: Extract dw_hdmi_connector_status_update()drivers/gpu/drm/bridge/synopsys/dw-hdmi.c+17 -101 reply
13/23drm: bridge: dw_hdmi: Use dw_hdmi_connector_status_update()drivers/gpu/drm/bridge/synopsys/dw-hdmi.c+15 -131 reply
14/23drm: bridge: dw_hdmi: Use display_info is_hdmi and has_audiodrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+5 -270 replies
15/23drm: bridge: dw_hdmi: Use generic CEC notifier helpersdrivers/gpu/drm/bridge/synopsys/Kconfig drivers/gpu/drm/bridge/synopsys/dw-hdmi.c+6 -211 reply
16/23drm: bridge: dw_hdmi: Update EDID and CEC phys addr in bridge detect()drivers/gpu/drm/bridge/synopsys/dw-hdmi.c+10 -11 reply
17/23drm: bridge: dw_hdmi: Declare bridge CEC notifier supportdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+4 -01 reply
18/23drm: bridge: dw_hdmi: Drop call to drm_bridge_hpd_notify()drivers/gpu/drm/bridge/synopsys/dw-hdmi.c+1 -30 replies
19/23drm: bridge: dw_hdmi: Use delayed_work to debounce hotplug eventdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+75 -53 replies
20/23drm: bridge: dw_hdmi: Rework HDP and RXSENSE interrupt handlingdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+22 -1252 replies
21/23drm: bridge: dw_hdmi: Remove the empty dw_hdmi_setup_rx_sense()drivers/gpu/drm/bridge/synopsys/dw-hdmi.c drivers/gpu/drm/meson/meson_dw_hdmi.c include/drm/bridge/dw_hdmi.h+0 -100 replies
22/23drm: bridge: dw_hdmi: Remove the empty dw_hdmi_phy_update_hpd()drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c drivers/gpu/drm/bridge/synopsys/dw-hdmi.c drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +2 more+0 -160 replies
23/23drm: bridge: dw_hdmi: Merge top and bottom half IRQ handlersdrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+11 -230 replies

Reviews trailers per patch

17 of 23 patches have a Reviewed-by or Acked-by.

PatchDiederik de HaasNeil ArmstrongNicolas FrattaroliHans VerkuilLuca CeresoliHeiko StuebnerIan Ray
SeriesT-b
1/23T-b R-b
2/23T-b R-b
3/23A-b
4/23T-b R-b
5/23T-b R-b
6/23T-b R-b
7/23T-b R-b
8/23T-b R-b
9/23T-b A-b R-b
10/23T-b R-b A-b
11/23T-b R-b A-b
12/23T-b R-b A-b
13/23T-b R-b A-b
14/23T-b R-b R-b
15/23T-b R-b A-b
16/23R-b
17/23A-b
18/23T-b
19/23
20/23T-b T-b
21/23T-b
22/23T-b
23/23T-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 v7 thread

Cover letter [PATCH v7 00/23] drm: bridge: dw_hdmi: Misc enable/disable, CEC and EDID cleanup

This is a revival of an old dw-hdmi series and is the first series part of a new effort to upstream old LibreELEC HDMI 2.0 patches for Rockchip RK33xx devices.

This series ensure poweron/poweroff and CEC phys addr invalidation is happening during normal DRM funcs, ensures EDID and CEC phys addr is updated in detect() similar to how the bridge connector works with a HDMI bridge attached, and also changes to debounce hotplug processing to prevent a full disable/enable cycle during a HPD low voltage pulse.

After this series HPD, EDID and CEC handling should work very similar regardless is the dw-hdmi connector or the bridge connector is used. It should also help ensure a smoother transition when dw-hdmi is fully converted into a HDMI bridge in a future series.

These changes have mainly been tested on Rockchip RK3328, RK3399 and RK3568 devices using both the dw-hdmi connector and also using a basic convert to use a bridge connector. The changes has also been tested on Amlogic S905X, S905Y2 and A311D devices that uses the bridge connector.

Testing with a Rock Pi 4 (RK3399) using a Reaspberry Pi Monitor with Linux kms client console using drm.debug=0xe should log something like following:

Power cycle monitor using the power button:
[CONNECTOR:68:HDMI-A-1] CEA VCDB 0x4a
[CONNECTOR:68:HDMI-A-1] HDMI: DVI dual 0, max TMDS clock 0 kHz [CONNECTOR:68:HDMI-A-1] ELD monitor RPI MON156
[CONNECTOR:68:HDMI-A-1] HDMI: latency present 0 0, video latency 0 0, audio latency 0 0 [CONNECTOR:68:HDMI-A-1] ELD size 36, SAD count 1
[CONNECTOR:68:HDMI-A-1] Same epoch counter 10

Cable unplugged:
[CONNECTOR:68:HDMI-A-1] EDID changed, epoch counter 11 [CONNECTOR:68:HDMI-A-1] status updated from connected to disconnected [CONNECTOR:68:HDMI-A-1] Changed epoch counter 10 => 12 [CONNECTOR:68:HDMI-A-1] generating connector hotplug event [CONNECTOR:68:HDMI-A-1] Sent hotplug event

Cable connected:
[CONNECTOR:68:HDMI-A-1] CEA VCDB 0x4a
[CONNECTOR:68:HDMI-A-1] HDMI: DVI dual 0, max TMDS clock 0 kHz [CONNECTOR:68:HDMI-A-1] ELD monitor RPI MON156
[CONNECTOR:68:HDMI-A-1] HDMI: latency present 0 0, video latency 0 0, audio latency 0 0 [CONNECTOR:68:HDMI-A-1] ELD size 36, SAD count 1
[CONNECTOR:68:HDMI-A-1] status updated from disconnected to connected [CONNECTOR:68:HDMI-A-1] Changed epoch counter 12 => 13 [CONNECTOR:68:HDMI-A-1] generating connector hotplug event [CONNECTOR:68:HDMI-A-1] Sent hotplug event

This series has evolved into an initial part of a larger multi series
effort to:
- drm: bridge: dw_hdmi: Misc enable/disable, CEC and EDID cleanup [v7]
- drm/bridge: dw-hdmi: Improve input/output bus format handling
- drm/bridge: dw-hdmi: Convert to a HDMI bridge and use of bridge connector
- drm/bridge: dw-hdmi: Add and use tmds_char_rate_valid() plat data ops
- drm/meson: hdmi: Misc cleanup and use CEC notifier helpers [v1]
- phy: rockchip: inno-hdmi: Change TMDS rate handling to configure() ops [v4]
- drm/rockchip: dw_hdmi: Misc cleanup and propagate bus format [v2]
- drm/rockchip: dw_hdmi: Enable YCbCr and Deep Color modes
Link to snapshot: https://github.com/Kwiboo/linux-rockchip/commits/next-20260518-rk-hdmi-v5/

Changes in v7:
- Add patch to fix use-after-free when CEC adapter is unregistered
- Only declare CEC notifier support when CEC device register succeeds
- Re-order patches to drop drm_edid_raw() use before exposing more usage
- Change to free irq before mute and clear using IH regs
- Rebased on next-20260518
Link to v6: https://lore.kernel.org/dri-devel/[email protected]/

Changes in v6:
- Update EDID and CEC phys addr in the bridge detect() func
- Add CEC notifier bridge op for the bridge connector
- Change back to disable_delayed_work_sync() in hpd disable ops,
a possible deadlock is avoided by not using drm_bridge_hpd_notify()
- Drop use of a suspend helper now that hpd disable ops use sync() calls
- Ensure HPD interrupt is masked and IRQ handler is disabled early
in dw_hdmi_remove() to prevent any irq re-arming of delayed work
- Update a few commit messages and cover letter
- Collect t-b tags
Link to v5: https://lore.kernel.org/dri-devel/[email protected]/

Changes in v5:
- Add patch that holds a bridge ref until connector cleanup, to fix
a use-after-free issue during connector cleanup
- Add patch that unregister CEC notifier during connector cleanup
- Add patch that adds a common suspend helper
- Add patch that drops call to drm_bridge_hpd_notify()
- Collect r-b tag
- Rebased on next-20260508
Link to v4: https://lore.kernel.org/dri-devel/[email protected]/

Changes in v4:
- Change to use generic CEC notifier helpers
- Disable/mask hpd_work until enable_hpd()/hpd_enable()
- Read connector status directly from HW regs in hpd_work
- Continued rework of HDP and RXSENSE interrupt handling
- Collect r-b tags
- Rebased on next-20260430
Link to v3: https://lore.kernel.org/dri-devel/[email protected]/

Changes in v3:
- Rework EDID refresh handling to closer match bridge connector
- Use delayed work to debounce HPD processing
- Update commit messages
- Collect r-b tags
- Rebased on next-20260401
Link to v2: https://lore.kernel.org/dri-devel/[email protected]/

Changes in v2:
- Add patch to disable scrambler feature when not supported
- Add patch to only notify connected status on HPD interrupt
- Update commit messages
- Collect r-b tags
- Rebased on next-20240906
Link to v1: https://lore.kernel.org/dri-devel/[email protected]/

Jonas Karlman (23):
drm: bridge: dw_hdmi: Disable scrambler feature when not supported
drm: bridge: dw_hdmi: Only notify connected status on HPD interrupt
drm: bridge: dw_hdmi: Free IRQ before CEC adapter is unregistered
drm: bridge: dw_hdmi: Hold bridge ref until connector cleanup
drm: bridge: dw_hdmi: Call poweron/poweroff from atomic enable/disable
drm: bridge: dw_hdmi: Use passed mode instead of stored previous_mode
drm: bridge: dw_hdmi: Fold poweron and setup functions
drm: bridge: dw_hdmi: Remove previous_mode and mode_set
drm: bridge: dw_hdmi: Unregister CEC notifier during connector cleanup
drm: bridge: dw_hdmi: Invalidate CEC phys addr from connector detect
drm: bridge: dw_hdmi: Remove cec_notifier_mutex
drm: bridge: dw_hdmi: Extract dw_hdmi_connector_status_update()
drm: bridge: dw_hdmi: Use dw_hdmi_connector_status_update()
drm: bridge: dw_hdmi: Use display_info is_hdmi and has_audio
drm: bridge: dw_hdmi: Use generic CEC notifier helpers
drm: bridge: dw_hdmi: Update EDID and CEC phys addr in bridge detect()
drm: bridge: dw_hdmi: Declare bridge CEC notifier support
drm: bridge: dw_hdmi: Drop call to drm_bridge_hpd_notify()
drm: bridge: dw_hdmi: Use delayed_work to debounce hotplug event
drm: bridge: dw_hdmi: Rework HDP and RXSENSE interrupt handling
drm: bridge: dw_hdmi: Remove the empty dw_hdmi_setup_rx_sense()
drm: bridge: dw_hdmi: Remove the empty dw_hdmi_phy_update_hpd()
drm: bridge: dw_hdmi: Merge top and bottom half IRQ handlers

 drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c   |   1 -
 drivers/gpu/drm/bridge/synopsys/Kconfig       |   1 +
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c |   1 +
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     | 502 +++++++-----------
 drivers/gpu/drm/meson/meson_dw_hdmi.c         |   3 -
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c   |   2 -
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c        |   2 -
 include/drm/bridge/dw_hdmi.h                  |   6 -
 8 files changed, 192 insertions(+), 326 deletions(-)
Signature · 1 line
2.54.0