From: Daniel Vetter <daniel@ffwll.ch>
To: Doug Anderson <dianders@chromium.org>
Cc: "Thomas Zimmermann" <tzimmermann@suse.de>,
"Stéphane Marchesin" <marcheu@chromium.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
"Aravind Venkateswaran (QUIC)" <quic_aravindh@quicinc.com>,
"Kuogee Hsieh (QUIC)" <quic_khsieh@quicinc.com>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Rob Clark" <robdclark@gmail.com>,
"Sankeerth Billakanti" <quic_sbillaka@quicinc.com>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"Abhinav Kumar (QUIC)" <quic_abhinavk@quicinc.com>,
"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
"Stephen Boyd" <swboyd@chromium.org>,
freedreno <freedreno@lists.freedesktop.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
"Daniel Vetter" <daniel@ffwll.ch>,
"David Airlie" <airlied@linux.ie>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Sean Paul" <seanpaul@chromium.org>
Subject: Re: [PATCH v3] drm/probe-helper: Make 640x480 first if no EDID
Date: Wed, 25 May 2022 15:26:21 +0200 [thread overview]
Message-ID: <Yo4ufWm5WiXsnRX8@phenom.ffwll.local> (raw)
In-Reply-To: <CAD=FV=U3Wywjev9tEhkL_zE1cV5NwEknH2YwHqyhd5TQtiJ=AQ@mail.gmail.com>
On Mon, May 23, 2022 at 05:59:02PM -0700, Doug Anderson wrote:
> Hi,
>
> On Fri, May 20, 2022 at 5:01 PM Doug Anderson <dianders@chromium.org> wrote:
> >
> > Hi,
> >
> > On Mon, May 16, 2022 at 3:28 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
> > >
> > > Hi Douglas,
> > >
> > > I understand that you're trying to tell userspace that the modelist has
> > > been made up, but it's not something that should be done via fragile
> > > heuristics IMHO.
> > >
> > > I looked at the Chromium source code that you linked, but I cannot say
> > > whether it's doing the correct thing. It all depends on what your
> > > program needs.
> > >
> > > In that function, you could also search for 'DRM_MODE_TYPE_USERDEF'.
> > > It's the mode that the user specified on the kernel command line. If
> > > Chromium's automatic mode selection fails, you'd give your users direct
> > > control over it.
> >
> > That doesn't really work for Chrome OS. Certainly a kernel hacker
> > could do this, but it's not something I could imagine us exposing to
> > an average user of a Chromebook.
> >
> >
> > > When there's no flagged mode or if
> > > /sys/class/drm/card<...>/status contains "unconnected", you can assume
> > > that the modelist is artificial and try the modes in an appropriate order.
> >
> > So "no flagged" means that nothing is marked as preferred, correct?
> >
> > ...so I guess what you're suggesting is that the order that the kernel
> > is presenting the modes to userspace is not ABI. If there are no
> > preferred modes then userspace shouldn't necessarily assume that the
> > first mode returned is the best mode. Instead it should assume that if
> > there is no preferred mode then the mode list is made up and it should
> > make its own decisions about the best mode to start with. If this is
> > the ABI from the kernel then plausibly I could convince people to
> > change userspace to pick 640x480 first in this case.
> >
> > > If we really want the kernel to give additional guarantees, we should
> > > have a broader discussion about this topic IMHO.
> >
> > Sure. I've added Stéphane Marchesin to this thread in case he wants to
> > chime in about anything.
> >
> > Overall, my take on the matter:
> >
> > * Mostly I got involved because, apparently, a DP compliance test was
> > failing. The compliance test was upset that when it presented us with
> > no EDID that we didn't default to 640x480. There was a push to make a
> > fix for this in the Qualcomm specific driver but that didn't sit right
> > with me.
> >
> > * On all devices I'm currently working with (laptops), the DP is a
> > secondary display. If a user was trying to plug in a display with a
> > bad EDID and the max mode (1024x768) didn't work, they could just use
> > the primary display to choose a different resolution. It seems
> > unlikely a user would truly be upset and would probably be happy they
> > could get their broken display to work at all. Even if this is a
> > primary display, I believe there are documented key combos to change
> > the resolution of the primary display even if you can't see anything.
> >
> > * That all being said, defaulting to 640x480 when there's no EDID made
> > sense to me, especially since it's actually defined in the DP spec. So
> > I'm trying to do the right thing and solve this corner case. That
> > being said, if it's truly controversial I can just drop it.
> >
> >
> > So I guess my plan will be to give Stéphane a little while in case he
> > wants to chime in. If not then I guess I'll try a Chrome patch...
> > ...and if that doesn't work, I'll just drop it.
>
> OK, this userspace code seems to work:
>
> https://crrev.com/c/3662501 - ozone/drm: Try 640x480 before picking
> the first mode if no EDID
>
> ...so we'll see how review of that goes. :-)
Yeah it sucks a bit but I'm mildly afraid that if we muck around with the
absolute fallback mode list in upstream we get whacked by a regression
report :-/
There's the additional fun that on modern displays probably 720p (or maybe
720i) is a lot more likely to work than anything else really, so best we
can do here maybe is to make it an uapi guarantee that if there's no
preferred mode, then most likely the kernel invent random noise out of
thin air, and userspace has to be careful and do its own magic heuristics.
Or maybe we should add a flag for "this stuff is invented, buyer beware".
I think clarifying that would be good. Changing defaults feels a bit too
risky, we had some really hilarious regression reports in the past along
the lines of the infamous xkcd.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2022-05-25 13:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 20:06 [PATCH v3] drm/probe-helper: Make 640x480 first if no EDID Douglas Anderson
2022-05-16 10:28 ` Thomas Zimmermann
2022-05-21 0:01 ` Doug Anderson
2022-05-24 0:59 ` Doug Anderson
2022-05-25 13:26 ` Daniel Vetter [this message]
2022-05-26 1:28 ` Sean Paul
2022-05-26 15:42 ` Daniel Vetter
2022-05-26 16:01 ` Doug Anderson
2022-06-01 12:41 ` 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=Yo4ufWm5WiXsnRX8@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marcheu@chromium.org \
--cc=mripard@kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_aravindh@quicinc.com \
--cc=quic_khsieh@quicinc.com \
--cc=quic_sbillaka@quicinc.com \
--cc=robdclark@gmail.com \
--cc=seanpaul@chromium.org \
--cc=swboyd@chromium.org \
--cc=tzimmermann@suse.de \
--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