[Intel-gfx] [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)

Guang Bai guang.bai at intel.com
Tue Nov 13 05:07:37 UTC 2018


On Tue, 13 Nov 2018 09:04:37 +0800
Chris Chiu <chiu at endlessm.com> wrote:

> Gentle ping. Just want to know if you have time for this so far.
> Thanks
> 
> Chris
Actually I'm still working on it right now with
DRM_MODE_CONNECTOR_HDMIA/HDMIB, recommended by James, I'm able to
differentiate the HDMI or DP even the encoder type is the
"INTEL_OUTPUT_DDI", I still have the "trybot" intermittent test failures
with new DRM connector types. Even worse, there is phantom
"intel_encoder_hotplug()" call following the correct one:
When connecting both DP and HDMI on the platform, unplug the DP, the
"i915_hotplug_work_func()" first calls the "intel_encoder_hotplug()"
with DP encoder, then calls again with HDMI encoder.
I haven't identified if the work function get queued twice or itself
is incorrectly identifying wrong encoder hotplut status. Will try to
get everything cleaned up ASAP.
Thanks,
Guang
> 
> On Tue, Oct 30, 2018 at 1:24 AM Guang Bai <guang.bai at intel.com> wrote:
> 
> > On Tue, 23 Oct 2018 17:14:34 +0800
> > Chris Chiu <chiu at endlessm.com> wrote:
> >  
> > > On Thu, Oct 11, 2018 at 2:04 AM Guang Bai <guang.bai at intel.com>
> > > wrote: 
> > > > On Mon, 8 Oct 2018 08:56:20 -0700
> > > > Guang Bai <guang.bai at intel.com> wrote:
> > > >  
> > > > > On Mon, 8 Oct 2018 22:35:34 +0800
> > > > > Chris Chiu <chiu at endlessm.com> wrote:
> > > > >  
> > > > > > Thanks! I have no problem with this patch.  
> > > > >
> > > > > There are Fi.CI.BAT failures with the v2 (only with
> > > > > formatting fix added) while the previous patch had passing
> > > > > results. Now trying to identify why the failures happened
> > > > > with trybot Thanks,
> > > > > Guang  
> > > > The tribot run my patch twice and passes the tests without any
> > > > error however I'm recommended to chase down root causes of
> > > > Patchwork Fi.CI.BAT test errors still - WIP on that.
> > > > Thanks,
> > > > Guang
> > > >  
> > >
> > > Gentle ping. Any good news on this?
> > >
> > > Chris
> > >  
> > Sorry...was distracted by other dev taks...will get update ASAP.
> > -Guang  
> > >  
> > > > >  
> > > > > >
> > > > > > On Thu, Oct 4, 2018 at 2:08 AM Guang Bai
> > > > > > <guang.bai at intel.com> wrote:  
> > > > > > > On some platforms, slowly unplugging (wiggling) the HDMI
> > > > > > > cable makes the kernel to believe the HDMI display still
> > > > > > > connected. This is because the HDMI DDC lines are
> > > > > > > disconnected sometimes later after the hot-plug interrupt
> > > > > > > triggered. Use the hot plug live states to honor HDMI hot
> > > > > > > plug status in addtion to access the DDC channels.
> > > > > > >
> > > > > > > v2: Fix the formatting issue
> > > > > > >
> > > > > > > Cc: Jani Nikula <jani.nikula at intel.com>
> > > > > > > Cc: Chris Chiu <chiu at endlessm.com>
> > > > > > > Signed-off-by: Guang Bai <guang.bai at intel.com>
> > > > > > > ---
> > > > > > >  drivers/gpu/drm/i915/intel_hotplug.c | 32
> > > > > > > +++++++++++++++++++++++++++++--- 1 file changed, 29
> > > > > > > insertions(+), 3 deletions(-)
> > > > > > >
> > > > > > > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > index 648a13c..98ab1ab 100644
> > > > > > > --- a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > @@ -246,17 +246,43 @@ static void
> > > > > > > intel_hpd_irq_storm_reenable_work(struct work_struct
> > > > > > > *work) intel_runtime_pm_put(dev_priv);
> > > > > > >  }
> > > > > > >
> > > > > > > +#define MAX_SHORT_PULSE_MS     100
> > > > > > > +#define PORT_CHECK_LOOP_COUNT  3
> > > > > > > +
> > > > > > >  bool intel_encoder_hotplug(struct intel_encoder *encoder,
> > > > > > >                            struct intel_connector
> > > > > > > *connector) {
> > > > > > >         struct drm_device *dev = connector->base.dev;
> > > > > > > -       enum drm_connector_status old_status;
> > > > > > > +       enum drm_connector_status old_status, new_status;
> > > > > > > +       enum hpd_pin pin = encoder->hpd_pin;
> > > > > > > +       struct drm_i915_private *dev_priv =
> > > > > > > to_i915(encoder->base.dev);
> > > > > > > +       u32 count = 0;
> > > > > > >
> > > > > > >         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> > > > > > >         old_status = connector->base.status;
> > > > > > >
> > > > > > > -       connector->base.status =
> > > > > > > -               drm_helper_probe_detect(&connector->base,
> > > > > > > NULL, false);
> > > > > > > +       /*
> > > > > > > +        * Set HDMI connection status based on hot-plug
> > > > > > > live states and
> > > > > > > +        * display probe results.
> > > > > > > +        */
> > > > > > > +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> > > > > > > +            encoder->type == INTEL_OUTPUT_DDI) &&
> > > > > > > +           dev_priv->hotplug.stats[pin].state ==
> > > > > > > HPD_ENABLED) {
> > > > > > > +               do {
> > > > > > > +                       new_status =
> > > > > > > connector_status_disconnected;
> > > > > > > +                       msleep(MAX_SHORT_PULSE_MS);
> > > > > > > +
> > > > > > > +                       if
> > > > > > > (intel_digital_port_connected(encoder))
> > > > > > > +                               new_status =
> > > > > > > drm_helper_probe_detect(&connector->base,
> > > > > > > +
> > > > > > > NULL, false);
> > > > > > > +                       if (new_status ==
> > > > > > > connector_status_connected)
> > > > > > > +                               break;
> > > > > > > +               } while (++count <=
> > > > > > > PORT_CHECK_LOOP_COUNT);
> > > > > > > +               connector->base.status = new_status;
> > > > > > > +       } else {
> > > > > > > +               connector->base.status =
> > > > > > > +
> > > > > > > drm_helper_probe_detect(&connector->base, NULL, false);
> > > > > > > +       }
> > > > > > >
> > > > > > >         if (old_status == connector->base.status)
> > > > > > >                 return false;
> > > > > > > --
> > > > > > > 2.7.4
> > > > > > >
> > > > > > >  
> > > > >
> > > > > _______________________________________________
> > > > > Intel-gfx mailing list
> > > > > Intel-gfx at lists.freedesktop.org
> > > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx  
> > > >
> > > >  
> >
> >  



More information about the Intel-gfx mailing list