Re: [PATCH 1/3] drm/fourcc: Add missing big-endian XRGB1555 and RGB565 formats
From: Geert Uytterhoeven
Date: Tue Jul 12 2022 - 04:43:53 EST
Hi Gerd,
On Tue, Jul 12, 2022 at 10:39 AM Gerd Hoffmann <kraxel@xxxxxxxxxx> wrote:
> On Tue, Jul 12, 2022 at 10:01:15AM +0200, Geert Uytterhoeven wrote:
> > > It IMHO is not applicable to any physical hardware. It's used by
> > > virtio-gpu where the supported format depends on the byte order
> > > (it is argb8888 in native byte order). Only virtual hardware can
> > > have that kind of behavior.
> > >
> > > And we can probably drop the DRM_FORMAT_HOST_* variants for 1555 and
> > > 565, they are not used anywhere.
> >
> > Atari DRM supports (big-endian) RGB565, so it uses
> > DRM_FORMAT_HOST_RGB565.
>
> Fixed big endian should use 'DRM_FORMAT_RGB565 | DRM_FORMAT_BIG_ENDIAN'.
True.
> As described above DRM_FORMAT_HOST_RGB565 means bigendian on bigendian
> hosts and little endian on little endian hosts. Which is not correct
> when your hardware does big endian no matter what.
But (a) drm_driver_legacy_fb_format() uses DRM_FORMAT_HOST_RGB565
if quirk_addfb_prefer_host_byte_order is set, and (b)
quirk_addfb_prefer_host_byte_order must be set on big-endian as
per commit eae06120f1974e1a ("drm: refuse ADDFB2 ioctl for broken
bigendian drivers").
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds