On Tue, Mar 24, 2026 at 09:04:24PM +0800, Yongxing Mou wrote:
> 
> 
> On 8/27/2025 2:40 AM, Dmitry Baryshkov wrote:
> > On Mon, Aug 25, 2025 at 10:16:17PM +0800, Yongxing Mou wrote:
> > > From: Abhinav Kumar <[email protected]>
> > > 
> > > Add HPD callback for the MST module which shall be invoked from the
> > > dp_display's HPD handler to perform MST specific operations in case
> > > of HPD. In MST case, route the HPD messages to MST module.
> > > 
> > > Signed-off-by: Abhinav Kumar <[email protected]>
> > > Signed-off-by: Yongxing Mou <[email protected]>
> > > ---
> > >   drivers/gpu/drm/msm/dp/dp_display.c | 15 ++++++++++++---
> > >   drivers/gpu/drm/msm/dp/dp_mst_drm.c | 34 
> > > ++++++++++++++++++++++++++++++++++
> > >   drivers/gpu/drm/msm/dp/dp_mst_drm.h |  2 ++
> > >   3 files changed, 48 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c 
> > > b/drivers/gpu/drm/msm/dp/dp_display.c
> > > index 
> > > abcab3ed43b6da5ef898355cf9b7561cd9fe0404..59720e1ad4b1193e33a4fc6aad0c401eaf9cbec8
> > >  100644
> > > --- a/drivers/gpu/drm/msm/dp/dp_display.c
> > > +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> > > @@ -500,9 +500,16 @@ static int msm_dp_display_handle_irq_hpd(struct 
> > > msm_dp_display_private *dp)
> > >   static int msm_dp_display_usbpd_attention_cb(struct device *dev)
> > >   {
> > > - int rc = 0;
> > > - u32 sink_request;
> > >           struct msm_dp_display_private *dp = 
> > > dev_get_dp_display_private(dev);
> > > + struct msm_dp *msm_dp_display = &dp->msm_dp_display;
> > > + u32 sink_request;
> > > + int rc = 0;
> > > +
> > > + if (msm_dp_display->mst_active) {
> > > +         if (msm_dp_aux_is_link_connected(dp->aux) != ISR_DISCONNECTED)
> > > +                 msm_dp_mst_display_hpd_irq(&dp->msm_dp_display);
> > > +         return 0;
> > > + }
> > >           /* check for any test request issued by sink */
> > >           rc = msm_dp_link_process_request(dp->link);
> > > @@ -1129,8 +1136,10 @@ static irqreturn_t msm_dp_display_irq_thread(int 
> > > irq, void *dev_id)
> > >           if (hpd_isr_status & DP_DP_HPD_UNPLUG_INT_MASK)
> > >                   msm_dp_display_send_hpd_notification(dp, false);
> > > - if (hpd_isr_status & DP_DP_IRQ_HPD_INT_MASK)
> > > + if (hpd_isr_status & DP_DP_IRQ_HPD_INT_MASK) {
> > >                   msm_dp_display_send_hpd_notification(dp, true);
> > > +         msm_dp_irq_hpd_handle(dp, 0);
> > 
> > Why is it a part of this patch?? It has nothing to do with MST.
> > 
> Emm ... maybe here we can directly call msm_dp_mst_display_hpd_irq..
> I tried an alternative approach by calling the MST IRQ handler from
> msm_dp_bridge_hpd_notify(). I expected that when hpd_isr_status ==
> DP_DP_IRQ_HPD_INT_MASK, the hpd_link_status read in
> msm_dp_bridge_hpd_notify() would be ISR_IRQ_HPD_PULSE_COUNT. That way, we
> could handle both SST and MST interrupt paths in msm_dp_irq_hpd_handle().
> However, hpd_link_status only reports ISR_CONNECTED. So I had to move the
> MST IRQ handling into the IRQ thread. Do you have any suggestions on this?

When are the link status bits updated? Please remember, we need to
support all three cases:

- Native DP, native DP HPD pin handling
- Native DP, DP HPD pin not handled by the controller
- DP AltMode, DP HPD pin not used at all

In the second and the third cases we will not be getting the IRQs.
Instead one of the next bridges (connector, EC, AltMode, etc.) will send
the HPD event, which lands in the .hpd_notify() callback.

-- 
With best wishes
Dmitry

Reply via email to