[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAF6AEGvp9Z5axmjwjC7iJKm3NcOg9-8eL-Z86b4ZjBbMfv0HKw@mail.gmail.com>
Date: Wed, 6 Mar 2024 17:39:21 -0800
From: Rob Clark <robdclark@...il.com>
To: Ville Syrjälä <ville.syrjala@...ux.intel.com>
Cc: Thomas Zimmermann <tzimmermann@...e.de>, Douglas Anderson <dianders@...omium.org>,
dri-devel@...ts.freedesktop.org, Rob Clark <robdclark@...omium.org>,
Javier Martinez Canillas <javierm@...hat.com>, Daniel Vetter <daniel@...ll.ch>, Dave Airlie <airlied@...hat.com>,
David Airlie <airlied@...il.com>, Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Maíra Canal <mcanal@...lia.com>,
Sean Paul <sean@...rly.run>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/udl: Add ARGB8888 as a format
On Wed, Mar 6, 2024 at 3:24 PM Ville Syrjälä
<ville.syrjala@...ux.intel.com> wrote:
>
> On Wed, Mar 06, 2024 at 07:37:16AM -0800, Rob Clark wrote:
> > On Wed, Mar 6, 2024 at 7:06 AM Ville Syrjälä
> > <ville.syrjala@...ux.intel.com> wrote:
> > >
> > > On Wed, Mar 06, 2024 at 06:49:15AM -0800, Rob Clark wrote:
> > > > On Wed, Mar 6, 2024 at 4:18 AM Thomas Zimmermann <tzimmermann@...e.de> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > sorry that I did not see the patch before.
> > > > >
> > > > > Am 27.02.24 um 23:19 schrieb Douglas Anderson:
> > > > > > Even though the UDL driver converts to RGB565 internally (see
> > > > > > pixel32_to_be16() in udl_transfer.c), it advertises XRGB8888 for
> > > > > > compatibility. Let's add ARGB8888 to that list.
> > > > >
> > > > > We had a heated discussion about the emulation of color formats. It was
> > > > > decided that XRGB8888 is the only format to support; and that's only
> > > > > because legacy userspace sometimes expects it. Adding other formats to
> > > > > the list should not be done easily.
> > > >
> > > > OTOH it is fixing a kernel change that broke userspace
> > > >
> > > > > >
> > > > > > This makes UDL devices work on ChromeOS again after commit
> > > > > > c91acda3a380 ("drm/gem: Check for valid formats"). Prior to that
> > > > > > commit things were "working" because we'd silently treat the ARGB8888
> > > > > > that ChromeOS wanted as XRGB8888.
> > > > >
> > > > > This problem has been caused by userspace. Why can it not be fixed there?
> > > > >
> > > > > And udl is just one driver. Any other driver without ARGB8888, such as
> > > > > simpledrm or ofdrm, would be affected. Do these work?
> > > >
> > > > Probably any driver where ARGB8888 is equivalent to XRGB8888 (ie.
> > > > single primary plane, etc) should advertise both.
> > >
> > > To me that seemes likely to trick userspace developers into
> > > assuming that ARGB is always available, and then when they
> > > finally try on hardware that doesn't have ARGB it'll just
> > > fail miserably.
> >
> > I think that ship has sailed already, at least for any drivers that
> > previously silently accepted ARGB8888
>
> Perhaps. Although I don't actually understand what kind of weird
> userspace people are running if it somehow expects ARGB to be there,
> but only for some specific kms drivers. Is said userspace really
> somehow checking which kms driver is present and then just ignoring
> the pixel format list exposed by the driver? Or is it just some
> super hw specific thing where they can just assume a specific kms
> driver?
I think chrome compositor (as in CrOS) always just picks ARGB8888
because, on devices that support overlays/underlays, it will use
underlays in some cases. Yes, lazy, and a userspace bug. But this
worked previously until commit c91acda3a380 ("drm/gem: Check for valid
formats"), so it seems to me like a clear case of kernel breaking
userspace. I don't think we really have a choice other than to allow
ARGB8888.
A lot of drivers like simpledrm will never encounter the chrome
compositor, so it is ofc an option to leave them as-is until someone
reports a regression, which is maybe unlikely. I suppose udl is a
special case because it can show up anywhere.
BR,
-R
> Anyways, adding ARGB to even more drivers seems like a terrible
> idea to me.
>
> --
> Ville Syrjälä
> Intel
Powered by blists - more mailing lists