From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ezequiel Garcia Subject: Re: [PATCH] drm/i915/hdmi: Fix weak connector detection Date: Fri, 1 Apr 2016 12:38:11 -0300 Message-ID: References: <1459457703-687-1-git-send-email-ezequiel@vanguardiasur.com.ar> <20160401144747.GT4329@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0650020656==" Return-path: In-Reply-To: <20160401144747.GT4329@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0650020656== Content-Type: multipart/alternative; boundary=001a11419f86a2c343052f6e2a8e --001a11419f86a2c343052f6e2a8e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable El abr. 1, 2016 11:47 AM, "Ville Syrj=C3=A4l=C3=A4" escribi=C3=B3: > > On Thu, Mar 31, 2016 at 05:55:03PM -0300, Ezequiel Garcia wrote: > > Currently, our implementation of drm_connector_funcs.detect is > > based on getting a valid EDID. > > > > This requirement makes the driver fail to detect connected > > connectors in case of EDID corruption, which prevents from falling > > back to modes provided by builtin or user-provided EDIDs. > > So why are you getting corrupted EDIDs? > Does it matter? > > > > Let's fix this by improving the detection, with a DDC probe, > > if the current EDID-based detection failed. > > > > Note that a better way of dealing with this could calling > > drm_probe_ddc in drm_connector_funcs.detect, and do the > > EDID full reading and parsing in drm_connector_helper_funcs.get_modes, > > when it's actually needed. > > > > However, this would be more invasive and thus more error-prone. > > The current commit is an attempt to get some uninvasive fix, > > and allow for easier backporting. > > > > Signed-off-by: Ezequiel Garcia > > --- > > drivers/gpu/drm/i915/intel_hdmi.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c > > index a0d8daed2470..c079206e6681 100644 > > --- a/drivers/gpu/drm/i915/intel_hdmi.c > > +++ b/drivers/gpu/drm/i915/intel_hdmi.c > > @@ -1428,6 +1428,20 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) > > } else > > status =3D connector_status_disconnected; > > > > + /* > > + * The above call to intel_hdmi_set_edid() checked for a valid EDID. > > + * However, the EDID can get corrupted for several reasons, resulting > > + * in a disconnected status despite the connector being connected= . > > + * Hence, let's try one more time, by only probing the DDC. > > + * > > + * This allows the DRM core to fallback to builtin or user-provided > > + * EDID firmware, e.g. in drm_helper_probe_single_connector_modes= . > > + */ > > + if (status =3D=3D connector_status_disconnected) > > + if (drm_probe_ddc(intel_gmbus_get_adapter(dev_priv, > > + intel_hdmi->ddc_bus))) > > + status =3D connector_status_connected; > > + > > intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); > > > > return status; > > -- > > 2.7.0 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Ville Syrj=C3=A4l=C3=A4 > Intel OTC --001a11419f86a2c343052f6e2a8e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


El abr. 1, 2016 11:47 AM, "Ville Syrj=C3=A4l=C3=A4" <ville.syrjala@linux.intel.com= > escribi=C3=B3:
>
> On Thu, Mar 31, 2016 at 05:55:03PM -0300, Ezequiel Garcia wrote:
> > Currently, our implementation of drm_connector_funcs.detect is > > based on getting a valid EDID.
> >
> > This requirement makes the driver fail to detect connected
> > connectors in case of EDID corruption, which prevents from fallin= g
> > back to modes provided by builtin or user-provided EDIDs.
>
> So why are you getting corrupted EDIDs?
>

Does it matter?

> >
> > Let's fix this by improving the detection, with a DDC probe,<= br> > > if the current EDID-based detection failed.
> >
> > Note that a better way of dealing with this could calling
> > drm_probe_ddc in drm_connector_funcs.detect, and do the
> > EDID full reading and parsing in drm_connector_helper_funcs.get_m= odes,
> > when it's actually needed.
> >
> > However, this would be more invasive and thus more error-prone. > > The current commit is an attempt to get some uninvasive fix,
> > and allow for easier backporting.
> >
> > Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
> > ---
> >=C2=A0 drivers/gpu/drm/i915/intel_hdmi.c | 14 ++++++++++++++
> >=C2=A0 1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/= i915/intel_hdmi.c
> > index a0d8daed2470..c079206e6681 100644
> > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > @@ -1428,6 +1428,20 @@ intel_hdmi_detect(struct drm_connector *co= nnector, bool force)
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0} else
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D = connector_status_disconnected;
> >
> > +=C2=A0 =C2=A0 =C2=A0/*
> > +=C2=A0 =C2=A0 =C2=A0 * The above call to intel_hdmi_set_edid() c= hecked for a valid EDID.
> > +=C2=A0 =C2=A0 =C2=A0 * However, the EDID can get corrupted for s= everal reasons, resulting
> > +=C2=A0 =C2=A0 =C2=A0 * in a disconnected status despite the conn= ector being connected.
> > +=C2=A0 =C2=A0 =C2=A0 * Hence, let's try one more time, by on= ly probing the DDC.
> > +=C2=A0 =C2=A0 =C2=A0 *
> > +=C2=A0 =C2=A0 =C2=A0 * This allows the DRM core to fallback to b= uiltin or user-provided
> > +=C2=A0 =C2=A0 =C2=A0 * EDID firmware, e.g. in drm_helper_probe_s= ingle_connector_modes.
> > +=C2=A0 =C2=A0 =C2=A0 */
> > +=C2=A0 =C2=A0 =C2=A0if (status =3D=3D connector_status_disconnec= ted)
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (drm_probe_dd= c(intel_gmbus_get_adapter(dev_priv,
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0intel_hdmi->ddc_bus)))
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0status =3D connector_status_connected;
> > +
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0intel_display_power_put(dev_priv, POWER= _DOMAIN_GMBUS);
> >
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0return status;
> > --
> > 2.7.0
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@list= s.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Ville Syrj=C3=A4l=C3=A4
> Intel OTC

--001a11419f86a2c343052f6e2a8e-- --===============0650020656== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0650020656==--