From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Chiu Subject: Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v4) Date: Thu, 29 Nov 2018 16:27:15 +0800 Message-ID: References: <154344114433.11623.8778228183095492042@skylake-alporthouse-com> <1543455469-3303-1-git-send-email-guang.bai@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1907484484==" Return-path: Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id E6BE16E425 for ; Thu, 29 Nov 2018 08:27:28 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id f23so1167714edb.3 for ; Thu, 29 Nov 2018 00:27:28 -0800 (PST) In-Reply-To: <1543455469-3303-1-git-send-email-guang.bai@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: guang.bai@intel.com Cc: Jani Nikula , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1907484484== Content-Type: multipart/alternative; boundary="000000000000f28979057bc97355" --000000000000f28979057bc97355 Content-Type: text/plain; charset="UTF-8" On Thu, Nov 29, 2018 at 9:52 AM Guang Bai wrote: > On some GEN9 platforms, slowly unplugging (wiggling) the HDMI cable makes > the kernel to believe the HDMI display is still connected. This is because > the HDMI DDC lines are disconnected a little bit later after the hot-plug > interrupt triggered thus an immediate edid fetch can be made. This problem > has been identified by more than one customer recently. Use digital > port live states to authorize the edid read at HDMI detection point will > ensure most of the display related software states updated and rest of them > will be renewed accordingly when the port is connected. > > v2: Fix the formatting issue > v3: Use digital port states to authorize the edid read > v4: Add comments on issue histories and rationale of the fix (Chris W) > > Cc: Jani Nikula > Cc: Chris Chiu > Cc: Chris Wilson > Signed-off-by: Guang Bai > --- > drivers/gpu/drm/i915/intel_hdmi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c > b/drivers/gpu/drm/i915/intel_hdmi.c > index e2c6a2b..8cf7c78 100644 > --- a/drivers/gpu/drm/i915/intel_hdmi.c > +++ b/drivers/gpu/drm/i915/intel_hdmi.c > @@ -1929,7 +1929,7 @@ intel_hdmi_detect(struct drm_connector *connector, > bool force) > > intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); > > - if (IS_ICELAKE(dev_priv) && > + if ((IS_ICELAKE(dev_priv) || IS_GEN9_BC(dev_priv)) && > !intel_digital_port_connected(encoder)) > goto out; > > -- > 2.7.4 > > I've tried on my problematic ASUS X705FD, seems no problem on my test scenarios (100% pass). I can reproduce with very slow unplug on previous versions but can't reproduce anymore on this one. I tried slow unplgug with few finds of HDMI jack I have in hand, it responds as expected. Don't know if there's any tough test case I should try, but I think it pretty much solve the problem. Thanks. Chris --000000000000f28979057bc97355 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable



On Thu, Nov 29, 2018 at 9:52 AM Guang Bai <guang.bai@intel.com> wrot= e:
On some GEN9 platforms, slowly u= nplugging (wiggling) the HDMI cable makes
the kernel to believe the HDMI display is still connected. This is because<= br> the HDMI DDC lines are disconnected a little bit later after the hot-plug interrupt triggered thus an immediate edid fetch can be made. This problem<= br> has been identified by more than one customer recently. Use digital
port live states to authorize the edid read at HDMI detection point will ensure most of the display related software states updated and rest of them=
will be renewed accordingly when the port is connected.

v2: Fix the formatting issue
v3: Use digital port states to authorize the edid read
v4: Add comments on issue histories and rationale of the fix (Chris W)

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Chris Chiu <c= hiu@endlessm.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Guang Bai <guang.bai@intel.com>
---
=C2=A0drivers/gpu/drm/i915/intel_hdmi.c | 2 +-
=C2=A01 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel= _hdmi.c
index e2c6a2b..8cf7c78 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -1929,7 +1929,7 @@ intel_hdmi_detect(struct drm_connector *connector, bo= ol force)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 intel_display_power_get(dev_priv, POWER_DOMAIN_= GMBUS);

-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (IS_ICELAKE(dev_priv) &&
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((IS_ICELAKE(dev_priv) || IS_GEN9_BC(dev_pri= v)) &&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 !intel_digital_port_connected(enc= oder))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto out;

--
2.7.4


I've tried on my problematic ASUS = X705FD, seems no problem on my test
scenarios (100% pass). I can = reproduce with very slow unplug on previous
versions but can'= t reproduce anymore on this one. I tried slow unplgug with
few fi= nds of HDMI jack I have in hand, it responds as expected.=C2=A0
<= br>
Don't know if there's any tough test case I should tr= y, but I think it pretty
much solve the problem. Thanks.

Chris

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