From: Damon Ding <damon.ding@rock-chips.com>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Heiko Stuebner <heiko@sntech.de>,
Andy Yan <andy.yan@rock-chips.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
Damon Ding <damon.ding@rock-chips.com>
Subject: [PATCH v2 10/10] drm/bridge: analogix_dp: Handle HPD notification from downstream bridge
Date: Tue, 4 Aug 2026 16:17:17 +0800 [thread overview]
Message-ID: <20260804081717.741404-11-damon.ding@rock-chips.com> (raw)
In-Reply-To: <20260804081717.741404-1-damon.ding@rock-chips.com>
When the display pipeline includes a display-connector bridge with
hpd-gpios configured, the connector's hotplug status is managed by the
display-connector bridge through its GPIO, not by the Analogix DP
controller's native HPD. In this configuration, the DP controller's
internal HPD polling in analogix_dp_detect_hpd() does not reflect the
actual connection state.
Implement the .hpd_notify bridge callback to receive connection status
updates from downstream bridges. Cache the connection status in a
connection_notified flag, and use it to short-circuit
analogix_dp_detect_hpd() when a downstream bridge has already confirmed
the connection.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
.../gpu/drm/bridge/analogix/analogix_dp_core.c | 16 ++++++++++++++++
.../gpu/drm/bridge/analogix/analogix_dp_core.h | 1 +
2 files changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index a5a50b9ab8a7..f0476a60ece3 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -68,6 +68,13 @@ static int analogix_dp_detect_hpd(struct analogix_dp_device *dp)
{
int timeout_loop = 0;
+ /*
+ * Trust connection status from downstream bridge (e.g.,
+ * display-connector with hpd-gpios).
+ */
+ if (dp->plat_data->next_bridge && dp->connection_notified)
+ return 0;
+
while (timeout_loop < DP_TIMEOUT_LOOP_COUNT) {
if (analogix_dp_get_plug_in_status(dp) == 0)
return 0;
@@ -1247,6 +1254,14 @@ static void analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge,
DRM_ERROR("Failed to enable psr (%d)\n", ret);
}
+static void analogix_dp_bridge_notify(struct drm_bridge *bridge, struct drm_connector *connector,
+ enum drm_connector_status status)
+{
+ struct analogix_dp_device *dp = to_dp(bridge);
+
+ dp->connection_notified = (status == connector_status_connected);
+}
+
static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
@@ -1259,6 +1274,7 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
.attach = analogix_dp_bridge_attach,
.edid_read = analogix_dp_bridge_edid_read,
.detect = analogix_dp_bridge_detect,
+ .hpd_notify = analogix_dp_bridge_notify,
};
static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index bcb5674801a2..cd8a5d52f973 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -169,6 +169,7 @@ struct analogix_dp_device {
bool fast_train_enable;
bool psr_supported;
bool last_bridge_is_panel;
+ bool connection_notified;
u8 dpcd[DP_RECEIVER_CAP_SIZE];
--
2.34.1
next prev parent reply other threads:[~2026-08-04 8:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 8:17 [PATCH v2 00/10] Add HPD support for Rockchip Analogix DP Damon Ding
2026-08-04 8:17 ` [PATCH v2 01/10] drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin detection Damon Ding
2026-08-04 8:37 ` sashiko-bot
2026-08-04 8:17 ` [PATCH v2 02/10] drm/bridge: analogix_dp: Return bitmask from analogix_dp_get_irq_type() Damon Ding
2026-08-04 8:17 ` [PATCH v2 03/10] drm/bridge: analogix_dp: Add IRQF_ONESHOT and simplify IRQ handling Damon Ding
2026-08-04 8:33 ` sashiko-bot
2026-08-04 8:17 ` [PATCH v2 04/10] drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ bitmask Damon Ding
2026-08-04 8:17 ` [PATCH v2 05/10] drm/bridge: analogix_dp: Extend mute/unmute HPD interrupts to accept irq bitmask Damon Ding
2026-08-04 8:17 ` [PATCH v2 06/10] drm/bridge: analogix_dp: Simplify analogix_dp_config_interrupt() Damon Ding
2026-08-04 8:17 ` [PATCH v2 07/10] drm/bridge: analogix_dp: Use platform-specific HPD detection scheme Damon Ding
2026-08-04 8:32 ` sashiko-bot
2026-08-04 8:17 ` [PATCH v2 08/10] drm/bridge: analogix_dp: Skip native HPD interrupt ops for GPIO HPD Damon Ding
2026-08-04 8:17 ` [PATCH v2 09/10] drm/bridge: analogix_dp: Restrict forced connected status only for panel endpoint Damon Ding
2026-08-04 8:30 ` sashiko-bot
2026-08-04 8:17 ` Damon Ding [this message]
2026-08-04 8:44 ` [PATCH v2 10/10] drm/bridge: analogix_dp: Handle HPD notification from downstream bridge sashiko-bot
2026-08-04 22:39 ` [PATCH v2 00/10] Add HPD support for Rockchip Analogix DP Heiko Stübner
2026-08-05 4:06 ` Damon Ding
2026-08-05 23:42 ` Heiko Stübner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804081717.741404-11-damon.ding@rock-chips.com \
--to=damon.ding@rock-chips.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=andy.yan@rock-chips.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=luca.ceresoli@bootlin.com \
--cc=m.szyprowski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox