[Intel-gfx] [PATCH] drm/i915: Do not reset detect_done flag in intel_dp_detect
Manasi Navare
manasi.d.navare at intel.com
Thu Dec 8 17:50:23 UTC 2016
On Thu, Dec 08, 2016 at 05:58:44PM +0200, Ville Syrjälä wrote:
> On Wed, Dec 07, 2016 at 07:51:21PM -0800, Manasi Navare wrote:
> > Ville,
> > You mentioned that this detect_done should be set to false also
> > in the resume case so in i915_display_resume where it calls
> > intel_hpd_init that eventually schedules the hpd_poll_init_work and
> > calls drm_helper_hpd_irq_event() which then calls .detect().
> > So in this case if I have to reset this detect_done in the
> > hpd_poll_init_work, how do I make sure I do it only if the
> > connector is DP?
>
> We have the .reset hook for these sort of things.
>
How can I use .reset hook to set the intel_dp->detect_done flag
to false only for DP connector before
sending drm_hpd_irq_event()?
Manasi
> >
> > Manasi
> >
> > On Wed, Dec 07, 2016 at 04:05:56PM +0200, Ville Syrjälä wrote:
> > > On Tue, Dec 06, 2016 at 04:43:51PM -0800, Manasi Navare wrote:
> > > > The detect_done flag was introduced in the commit
> > > > 7d23e3c37bb3fc6952dc84007ee60cb533fd2d5c in order to avoid
> > > > multiple detects on hotplug where intel_dp_long_pulse()
> > > > was called from HPD handler as well as in intel_dp_detect.
> > > > So this detect_done flag was required to make sure intel_dp_detect()
> > > > did not call long pulse handler again if it was already been called
> > > > from HPD handler. However commit 1015811609c0328b5ed670d07748591b837e74eb
> > > > differs the long hpd handling entirely until the hotplug work runs to
> > > > avoid the double long hpd handling the "detect_done" flag is trying
> > > > to prevent.
> > >
> > > That sentence doesn't parse here. Anyways, the flag indeed is now a nop
> > > and your patch is pretty much the same what I did here:
> > > https://patchwork.freedesktop.org/patch/101476/
> > >
> > > >
> > > > So now we do not need to reset the detect_done flag to false in
> > > > intel_dp_detect. It will be reset in the intel_dp_hpd_pulse so
> > > > that intel_dp_detect does a full detect. However if the .detect
> > > > gets called during mode enumeration then we do not need to do a
> > > > full detect. This patch avoids the WARNS_ONS during connected boot
> > > > case when it calls intel_dp_check_link_status() due to multiple
> > > > detects
> > >
> > > How exactly does it do that? Also we shouldn't sweep that under the rug
> > > anyway. Instead someone should actually fix the problem that causes the
> > > WARN.
> > >
> > > > and also avoids DP compliance failures. It avoids doing
> > > > a full detect every single time on .detect().
> > > >
> > > > Cc: Ville Syrjala <ville.syrjala at linux.intel.com>
> > > > Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> > > > Cc: Jani Nikula <jani.nikula at linux.intel.com>
> > > > Signed-off-by: Manasi Navare <manasi.d.navare at intel.com>
> > > > ---
> > > > drivers/gpu/drm/i915/intel_dp.c | 2 --
> > > > 1 file changed, 2 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > > > index db75bb9..9c9277e 100644
> > > > --- a/drivers/gpu/drm/i915/intel_dp.c
> > > > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > > > @@ -4470,8 +4470,6 @@ static bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
> > > > if (!intel_dp->detect_done)
> > > > status = intel_dp_long_pulse(intel_dp->attached_connector);
> > > >
> > > > - intel_dp->detect_done = false;
> > > > -
> > > > return status;
> > > > }
> > > >
> > > > --
> > > > 1.9.1
> > >
> > > --
> > > Ville Syrjälä
> > > Intel OTC
>
> --
> Ville Syrjälä
> Intel OTC
More information about the Intel-gfx
mailing list