WSL2-Linux-Kernel/drivers/firmware/google
Alper Nebi Yasak ce3eb3c37b firmware: coreboot: framebuffer: Ignore reserved pixel color bits
commit e6acaf25cb upstream.

The coreboot framebuffer doesn't support transparency, its 'reserved'
bit field is merely padding for byte/word alignment of pixel colors [1].
When trying to match the framebuffer to a simplefb format, the kernel
driver unnecessarily requires the format's transparency bit field to
exactly match this padding, even if the former is zero-width.

Due to a coreboot bug [2] (fixed upstream), some boards misreport the
reserved field's size as equal to its position (0x18 for both on a
'Lick' Chromebook), and the driver fails to probe where it would have
otherwise worked fine with e.g. the a8r8g8b8 or x8r8g8b8 formats.

Remove the transparency comparison with reserved bits. When the
bits-per-pixel and other color components match, transparency will
already be in a subset of the reserved field. Not forcing it to match
reserved bits allows the driver to work on the boards which misreport
the reserved field. It also enables using simplefb formats that don't
have transparency bits, although this doesn't currently happen due to
format support and ordering in linux/platform_data/simplefb.h.

[1] https://review.coreboot.org/plugins/gitiles/coreboot/+/4.19/src/commonlib/include/commonlib/coreboot_tables.h#255
[2] https://review.coreboot.org/plugins/gitiles/coreboot/+/4.13/src/drivers/intel/fsp2_0/graphics.c#82

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230122190433.195941-1-alpernebiyasak@gmail.com
Cc: Salvatore Bonaccorso <carnil@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-10 09:39:55 +01:00
..
Kconfig firmware: google: Properly state IOMEM dependency 2022-04-08 14:23:50 +02:00
Makefile firmware: coreboot: Collapse platform drivers into bus core 2018-09-14 15:37:23 +02:00
coreboot_table.c firmware: coreboot: Check size of table entry and use flex-array 2023-02-01 08:27:19 +01:00
coreboot_table.h firmware: coreboot: Check size of table entry and use flex-array 2023-02-01 08:27:19 +01:00
framebuffer-coreboot.c firmware: coreboot: framebuffer: Ignore reserved pixel color bits 2023-03-10 09:39:55 +01:00
gsmi.c gsmi: fix null-deref in gsmi_get_variable 2023-01-24 07:22:47 +01:00
memconsole-coreboot.c firmware: google: make coreboot driver's remove callback return void 2021-02-09 12:12:43 +01:00
memconsole-x86-legacy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
memconsole.c Merge 5.2-rc4 into char-misc-next 2019-06-09 09:11:21 +02:00
memconsole.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
vpd.c firmware: google: make coreboot driver's remove callback return void 2021-02-09 12:12:43 +01:00
vpd_decode.c firmware: google: increment VPD key_len properly 2019-10-11 08:41:34 +02:00
vpd_decode.h firmware: google: check if size is valid when decoding VPD data 2019-09-04 13:31:28 +02:00