Re: [PATCH v2 12/21] drm/i915/dp: Use check link state work in the detect handler

Imre Deak
2024-05-23T15:29:21Z

On Thu, May 23, 2024 at 06:08:40PM +0300, Ville Syrjälä wrote:
> On Mon, May 20, 2024 at 09:58:10PM +0300, Imre Deak wrote:
> > Simplify things by retraining a DP link if a bad link is detected in the
> > connector detect handler from the encoder's check link state work,
> > similarly to how this is done after a modeset link training failure.
> >
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_dp.c | 7 ++-----
> > 1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> > index ff4ed6bb520d8..70b00e5ae7ad7 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -5863,11 +5863,8 @@ intel_dp_detect(struct drm_connector *connector,
> > * Some external monitors do not signal loss of link synchronization
> > * with an IRQ_HPD, so force a link status check.
> > */
> > - if (!intel_dp_is_edp(intel_dp)) {
> > - ret = intel_dp_retrain_link(encoder, ctx);
> > - if (ret)
> > - return ret;
> > - }
> > + if (!intel_dp_is_edp(intel_dp))
> > + intel_dp_check_link_state(intel_dp);
>
> I would like to see this hack nuked entirely. But that
> could be a followup.

Okay. This tries to keep the current behavior, but can add a note that
the above workaround can be removed after the link state is checked
after modesets.

I also wondered about the link state check in the hotplug handler. If
that's only a way to defer doing this from the HPD IRQ handler - which
is now changed by patch 13 - that could be also removed eventually?

>
> >
> > /*
> > * Clearing NACK and defer counts to get their exact values
> > --
> > 2.43.3
>
> --
> Ville Syrjälä
> Intel