From: Lyude Paul <lyude@redhat.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, Sean Paul <sean@poorly.run>,
David Airlie <airlied@linux.ie>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/probe_helper: Don't bother probing when connectors are forced off
Date: Mon, 17 Sep 2018 17:12:04 -0400 [thread overview]
Message-ID: <8773991abd73242bc4ff27c5f1ac35eaaf40a72c.camel@redhat.com> (raw)
In-Reply-To: <20180917181641.GQ5565@intel.com>
On Mon, 2018-09-17 at 21:16 +0300, Ville Syrjälä wrote:
> On Mon, Sep 17, 2018 at 02:10:02PM -0400, Lyude Paul wrote:
> > On Mon, 2018-09-17 at 20:55 +0300, Ville Syrjälä wrote:
> > > On Mon, Sep 17, 2018 at 01:43:44PM -0400, Lyude Paul wrote:
> > > > Userspace asked them to be forced off, so why would we care about what a
> > > > probe tells us?
> > >
> > > I believe there should be force checks in the callers already.
> > > Or are we missing some?
> >
> > JFYI, what triggered me to send this patch are these error messages that
> > come
> > from nouveau when a hotplug happens on a port that we've forced off:
> >
> > [ 1903.918104] nouveau 0000:01:00.0: DRM: DDC responded, but no EDID for DP-
> > 2
> > [ 1903.918123] [drm:drm_helper_hpd_irq_event [drm_kms_helper]]
> > [CONNECTOR:61:DP-2] status updated from disconnected to disconnected
> >
> > That being said; I'm sure there are probably some checks missing, but I
> > don't
> > really see the purpose in calling the driver's probe functions at all if
> > they're
> > just supposed to return the status we forced.
>
> Digging through my cobweb ridden local git repository I found this:
>
> commit bbd17813a7c7d0210c619365707044d0fb29e3f0
> Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Date: Mon Jun 10 15:28:55 2013 +0300
>
> drm: Ignore forced connectors in drm_helper_hpd_irq_event()
>
> drm_helper_hpd_irq_event() calls the connector's .detect() function
> even for forced connectors. If the returned status doesn't match the
> forced status, we will send the hotplug event, causing userspace to
> re-probe all the connectors. Eventually we should end up back where
> we started when drm_helper_probe_single_connector_modes() overwrites
> the connector status with the forced status.
>
> We can avoid all that pointles work if we just skip forced connectors
> in drm_helper_hpd_irq_event().
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> diff --git a/drivers/gpu/drm/drm_crtc_helper.c
> b/drivers/gpu/drm/drm_crtc_helper.c
> index ed1334e27c33..4fc2ad76c107 100644
> --- a/drivers/gpu/drm/drm_crtc_helper.c
> +++ b/drivers/gpu/drm/drm_crtc_helper.c
> @@ -1086,6 +1086,10 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
> mutex_lock(&dev->mode_config.mutex);
> list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
>
> + /* Ignore forced connectors. */
> + if (connector->force)
> + continue;
> +
> /* Only handle HPD capable connectors. */
> if (!(connector->polled & DRM_CONNECTOR_POLL_HPD))
> continue;
>
>
> I guess I never sent it out.
Ahhh, to be honest though this patch isn't really enough.
drm_helper_hpd_irq_event() isn't going to be used by all drivers (I may remove
some usage of it in nouveau in the near future, even) so I still think it would
be a better idea to just add this into drm_helper_probe_detect() and
drm_helper_probe_detect_ctx() so everything gets covered
>
next prev parent reply other threads:[~2018-09-17 21:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 17:43 [PATCH] drm/probe_helper: Don't bother probing when connectors are forced off Lyude Paul
2018-09-17 17:55 ` Ville Syrjälä
2018-09-17 17:58 ` Lyude Paul
2018-09-17 18:10 ` Lyude Paul
2018-09-17 18:16 ` Ville Syrjälä
2018-09-17 21:12 ` Lyude Paul [this message]
2018-09-21 8:59 ` Daniel Vetter
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=8773991abd73242bc4ff27c5f1ac35eaaf40a72c.camel@redhat.com \
--to=lyude@redhat.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sean@poorly.run \
--cc=ville.syrjala@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).