[PATCH resend v2] drm/fourcc: Add missing big-endian XRGB1555 and RGB565 formats

Gerd Hoffmann kraxel at redhat.com
Thu Nov 24 11:17:54 UTC 2022


  Hi,

> > Supporting 16 bpp in the driver wouldn't be that much of a problem, but
> > processing the framebuffer on the host side when emulating a big endian
> > guest on a little endian host is painful.  I think I can't ask pixman to
> > do a conversation from DRM_FORMAT_RGB565 | DRM_FORMAT_BIG_ENDIAN to
> > DRM_FORMAT_XRGB8888 on a little endian machine.
> 
> Indeed. But you can do a quick 16-bit byteswap, and convert from
> DRM_FORMAT_RGB565 to DRM_FORMAT_XRGB8888?

Sure doable, but it's an extra step in a rarely tested code path ...

> BTW, does pixman support converting DRM_FORMAT_RGB565 to
> DRM_FORMAT_XRGB8888 on a big-endian machine?

I don't think so.  When you can get the color bits with shifting and
masking pixman is happy.  For rgb565 (and xrgb1555) that works only on
native byte order.

take care,
  Gerd



More information about the dri-devel mailing list