firmware/sysfb: Fix EFI/VESA format selection
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 2 Jan 2023 11:29:15 +0000 (12:29 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 3 Jan 2023 13:23:03 +0000 (14:23 +0100)
commitf35cd3fa77293c2cd03e94b6a6151e1a7d9309cf
treed1a4c70ab640a679aa2f740187d72f678662d9f8
parent2591939e881cf728b6ac45971eeec2f58051c101
firmware/sysfb: Fix EFI/VESA format selection

Select color format for EFI/VESA firmware scanout buffer from the
number of bits per pixel and the position of the individual color
components. Fixes the selected format for the buffer in several odd
cases. For example, XRGB1555 has been reported as ARGB1555 because
of the different use of depth and transparency in VESA and Linux.

Bits-per-pixel is always the pixel's raw number of bits; including
alpha and filler bits. It is preferred over color depth, which has a
different meaning among various components and standards.

Also do not compare reserved bits and transparency bits to each other.
These values have different meanings, as reserved bits include filler
bits while transparency does not.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102112927.26565-2-tzimmermann@suse.de
drivers/firmware/sysfb_simplefb.c