[PATCH 17/19] drm/msm/dp: Use drm_bridge_hpd_notify()
Dmitry Baryshkov
dmitry.baryshkov at oss.qualcomm.com
Mon Jul 14 12:25:33 UTC 2025
On Fri, Jul 11, 2025 at 05:58:22PM -0700, Jessica Zhang wrote:
> Call drm_bridge_hpd_notify() instead of drm_helper_hpd_irq_event(). This
> way, we can directly call hpd_notify() via the bridge connector.
>
> Signed-off-by: Jessica Zhang <jessica.zhang at oss.qualcomm.com>
> ---
> drivers/gpu/drm/msm/dp/dp_display.c | 17 +++++------------
> drivers/gpu/drm/msm/dp/dp_display.h | 1 +
> drivers/gpu/drm/msm/dp/dp_drm.c | 2 ++
> 3 files changed, 8 insertions(+), 12 deletions(-)
This patch has some issues. Beforehand we were just stating that there
was a HPD event, now we are explicitly stating the status. This might
confuse DRM's status handling if the status here and status at the
.detect() differ.
In my opinion, this should become patch #4 in the series (connected,
link_training, EV_HPD_PLUG_INT / EV_HPD_UNPLUG_INT, then this one).
And the correct way would be to call drm_bridge_hpd_notify(bridge,
msm_dp_display_detect()) from the IRQ thread. This way we should also be
able to drop EV_USER_NOTIFICATION from all over the place.
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 3aaa603da4f9..87f2750a99ca 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -324,17 +324,6 @@ static const struct component_ops msm_dp_display_comp_ops = {
> .unbind = msm_dp_display_unbind,
> };
>
> -static void msm_dp_display_send_hpd_event(struct msm_dp *msm_dp_display)
> -{
> - struct msm_dp_display_private *dp;
> - struct drm_connector *connector;
> -
> - dp = container_of(msm_dp_display, struct msm_dp_display_private, msm_dp_display);
> -
> - connector = dp->msm_dp_display.connector;
> - drm_helper_hpd_irq_event(connector->dev);
> -}
> -
> static int msm_dp_display_send_hpd_notification(struct msm_dp_display_private *dp,
> bool hpd)
> {
> @@ -358,7 +347,11 @@ static int msm_dp_display_send_hpd_notification(struct msm_dp_display_private *d
>
> drm_dbg_dp(dp->drm_dev, "type=%d hpd=%d\n",
> dp->msm_dp_display.connector_type, hpd);
> - msm_dp_display_send_hpd_event(&dp->msm_dp_display);
> +
> + if (hpd)
> + drm_bridge_hpd_notify(dp->msm_dp_display.bridge, connector_status_connected);
> + else
> + drm_bridge_hpd_notify(dp->msm_dp_display.bridge, connector_status_disconnected);
drm_bridge_hpd_notify(dp->msm_dp_display.bridge,
hpd ?
connector_status_connected :
connector_status_disconnected);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.h b/drivers/gpu/drm/msm/dp/dp_display.h
> index 68bd8be19463..6e12694d5a64 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.h
> +++ b/drivers/gpu/drm/msm/dp/dp_display.h
> @@ -16,6 +16,7 @@ struct msm_dp {
> struct platform_device *pdev;
> struct drm_connector *connector;
> struct drm_bridge *next_bridge;
> + struct drm_bridge *bridge;
> bool connected;
> bool link_ready;
> bool audio_enabled;
> diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c
> index f222d7ccaa88..b12a43499c54 100644
> --- a/drivers/gpu/drm/msm/dp/dp_drm.c
> +++ b/drivers/gpu/drm/msm/dp/dp_drm.c
> @@ -358,6 +358,8 @@ int msm_dp_bridge_init(struct msm_dp *msm_dp_display, struct drm_device *dev,
> }
> }
>
> + msm_dp_display->bridge = bridge;
> +
> return 0;
> }
>
>
> --
> 2.50.1
>
--
With best wishes
Dmitry
More information about the dri-devel
mailing list