All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Chou <zhoubb.aaron@gmail.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: "Deucher, Alexander" <alexander.deucher@amd.com>,
	zhoubinbin <zhoubinbin@uniontech.com>,
	amd-gfx list <amd-gfx@lists.freedesktop.org>,
	hristian.koenig@amd.com
Subject: Re: [PATCH] drm/admgpu: check HDMI HPD status after ddc probe
Date: Mon, 11 May 2020 09:45:01 +0800	[thread overview]
Message-ID: <CAMpQs4LXBf3wfwhUY45GzqC-+yqyA3F+25K5bxXi=vE-rEx_gQ@mail.gmail.com> (raw)
In-Reply-To: <CADnq5_Ms1oyxqODE4j_-4+WKwUbE6VthECRgA8cvsYBzMwzs5g@mail.gmail.com>

On Sat, May 9, 2020 at 9:35 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Sat, May 9, 2020 at 1:48 AM Binbin Zhou <zhoubb.aaron@gmail.com> wrote:
> >
> > Now, we check the presence of the EDID to determine if there is a monitor
> > present.
> >
> > DVI-I connectors have both analog and digital encoders and the HPD pin
> > is only reliable on the digital part.
> >
> > But when I pull out the Radeon HD8570's HDMI connector, the HDMI status
> > in system is still perform connected.
> >
> > asd@asd-PC:~$ cat /sys/class/drm/card0-HDMI-A-1/status
> > connected
> >
> > At this moment, if I want to read the EDID by /dev/i2c-X with I2C
> > driver, there is no EDID can be read.
> >
> > Dmesg witha drm.debug=0x6, we can find the following message:
> >
> > [drm:drm_helper_hpd_irq_event] [CONNECTOR:41:HDMI-A-1] status
> > updated from connected to connected
> >
> > Based on the appearance, I thought to check the HPD status again, because
> > the HPD status is perform disconnected, after amdgpu_display_ddc_probe().
> > If the amdgpu_display_hpd_sense() return false, I think the HDMI connector
> > status is undefined, and just return disconnected simply.
> >
> > I'm not sure if it happened to other AMD cards.
>
> This is the part I don't understand.  The logic already checks the HPD
> status in amdgpu_connector_check_hpd_status_unchanged().  Does it
> still report connected at that point?  After that it tires to read the
> EDID in amdgpu_display_ddc_probe().  If the monitor is disconnected,
> there should be no EDID so dret should be false.  We should try and
> figure out why the first HPD check reports connected and the EDID
> probe returns true.
>
> Alex

Emm.....
I have tried with Radeon driver, it is the same.
And In the Mint system, I find if I pick out the HDMI connector, I can
see the status is still connected,
At the moment, If I do the xrandr command or open the Setting->Display
application, the HDMI status will refresh to disconnected.
The operation means to detect the display again.

Does the phenomenon meet the expectation?

Regards.
Aaron.
>
> >
> > Signed-off-by: Binbin Zhou <zhoubb.aaron@gmail.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> > index f355d9a752d2..ee657db9a228 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> > @@ -973,7 +973,7 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)
> >         const struct drm_encoder_helper_funcs *encoder_funcs;
> >         int r;
> >         enum drm_connector_status ret = connector_status_disconnected;
> > -       bool dret = false, broken_edid = false;
> > +       bool dret = false, broken_edid = false, undefined_flag = false;
> >
> >         if (!drm_kms_helper_is_poll_worker()) {
> >                 r = pm_runtime_get_sync(connector->dev->dev);
> > @@ -988,7 +988,12 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)
> >
> >         if (amdgpu_connector->ddc_bus)
> >                 dret = amdgpu_display_ddc_probe(amdgpu_connector, false);
> > -       if (dret) {
> > +
> > +       /* Check the HDMI HPD pin status again */
> > +       if (!amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd))
> > +               undefined_flag = true;
> > +
> > +       if (dret && !undefined_flag) {
> >                 amdgpu_connector->detected_by_load = false;
> >                 amdgpu_connector_free_edid(connector);
> >                 amdgpu_connector_get_edid(connector);
> > --
> > 2.17.1
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      reply	other threads:[~2020-05-11  1:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-09  5:48 [PATCH] drm/admgpu: check HDMI HPD status after ddc probe Binbin Zhou
2020-05-09 13:35 ` Alex Deucher
2020-05-11  1:45   ` Aaron Chou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMpQs4LXBf3wfwhUY45GzqC-+yqyA3F+25K5bxXi=vE-rEx_gQ@mail.gmail.com' \
    --to=zhoubb.aaron@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=hristian.koenig@amd.com \
    --cc=zhoubinbin@uniontech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.