Thread (103 messages) flat view 103 messages, 4 authors, 3h ago

Re: [PATCH v11 30/74] drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper

From: Maxime Ripard <mripard@kernel.org>
Date: 2026-09-08 12:48:15
Also in: dri-devel, linux-fbdev, linux-rockchip, linux-sunxi, lkml

On Tue, Sep 01, 2026 at 09:50:54PM +0300, Cristian Ciocaltea wrote:
quoted hunk ↗ jump to hunk
Export dw_hdmi_qp_hpd_notify() for platform drivers to report hot-plug
detection events.  Unlike drm_helper_hpd_irq_event() which polls all
connectors, this helper targets only the affected connector and ensures
.detect_ctx() is invoked on reconnection events to trigger SCDC state
recovery.

Note that this helper may sleep, so it must only be called from a
threaded HPD interrupt handler or a work function.

Tested-by: Maud Spierings <redacted>
Tested-by: Diederik de Haas <redacted>  # NanoPC-T6 LTS, Rock 5B
Signed-off-by: Cristian Ciocaltea <redacted>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 37 ++++++++++++++++++++++++++++
 include/drm/bridge/dw_hdmi_qp.h              |  1 +
 2 files changed, 38 insertions(+)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index ee74266b7aa9..a2277531182c 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -28,6 +28,7 @@
 #include <drm/drm_edid.h>
 #include <drm/drm_modes.h>
 #include <drm/drm_print.h>
+#include <drm/drm_probe_helper.h>
 
 #include <media/cec.h>
 
@@ -163,6 +164,8 @@ struct dw_hdmi_qp {
 	struct regmap *regm;
 	int main_irq;
 
+	/* Written by the atomic enable/disable hooks, read locklessly by HPD */
+	struct drm_connector *curr_conn;
 	unsigned long tmds_char_rate;
 	bool no_hpd;
 };
@@ -785,6 +788,8 @@ static void dw_hdmi_qp_bridge_atomic_enable(struct drm_bridge *bridge,
 	dw_hdmi_qp_mod(hdmi, op_mode, OPMODE_DVI, LINK_CONFIG0);
 
 	drm_atomic_helper_connector_hdmi_update_infoframes(connector, state);
+
+	WRITE_ONCE(hdmi->curr_conn, connector);
You need to take a reference to the connector, and you really should use
a mutex here.

Maxime

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help