[PATCH v9 12/22] drm/bridge: Add out-of-band HPD notify handler
Sebastian Reichel <[email protected]> Mon, 03 Aug 2026 20:05:13 +0200
| Newsgroups | org.freedesktop.lists.dri-devel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <20260803-synopsys-dw-dp-improvements-v9-12-2e6e46135312@collabora.com> |
For DP bridges, that can be used for DP AltMode, it might be necessary to enforce HPD status. There is an existing ->oob_hotplug_event() on the DRM connector, but it currently just calls into hpd_notify(). As DP bridge drivers usually also implement .detect and that also generates calls into hpd_notify, this is a bad place to force the HPD status as the follow-up detect call might force it off again resulting in all follow-up calls to the detection routine also failing. Avoid this by having a dedicated function for OOB events. Signed-off-by: Sebastian Reichel <[email protected]> --- drivers/gpu/drm/display/drm_bridge_connector.c | 6 ++++++ include/drm/drm_bridge.h | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 8b54069fa53a..632cc3ae3b54 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -180,6 +180,12 @@ static void drm_bridge_connector_oob_hotplug_event(struct drm_connector *connect struct drm_bridge_connector *bridge_connector = to_drm_bridge_connector(connector); + /* Notify all bridges in the pipeline of hotplug events. */ + drm_for_each_bridge_in_chain(bridge_connector->encoder, bridge) { + if (bridge->funcs->oob_notify) + bridge->funcs->oob_notify(bridge, connector, status); + } + drm_bridge_connector_handle_hpd(bridge_connector, status); } diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 58fff047f43b..713652fca033 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -540,6 +540,20 @@ struct drm_bridge_funcs { */ void (*hpd_disable)(struct drm_bridge *bridge); + /** + * @oob_notify: + * + * Notify the bridge of out of band hot plug detection. + * + * This callback is optional, it may be implemented by bridges that + * need to be notified of display connection or disconnection for + * internal reasons. One use case is to force the DP controllers HPD + * signal for USB-C DP AltMode. + */ + void (*oob_notify)(struct drm_bridge *bridge, + struct drm_connector *connector, + enum drm_connector_status status); + /** * @hdmi_tmds_char_rate_valid: * -- 2.53.0