summaryrefslogtreecommitdiff
path: root/drivers/firmware/sysfb_simplefb.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-06-26 15:23:15 +0200
committerTakashi Iwai <tiwai@suse.de>2023-06-26 15:23:23 +0200
commita15b51375684c2bfa6017bb185139477e7a3b96c (patch)
tree6a4d7b4e7f09b858782cf2e5c0601d9f778cab15 /drivers/firmware/sysfb_simplefb.c
parente94f1f96f108ba96c0ed8bf3fbdd8ee6a6703880 (diff)
parent4e0871333661d2ec0ed3dc00a945c2160eccae77 (diff)
Merge branch 'for-next' into for-linus
Pull the 6.5-devel branch for upstreaming. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/firmware/sysfb_simplefb.c')
-rw-r--r--drivers/firmware/sysfb_simplefb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/firmware/sysfb_simplefb.c b/drivers/firmware/sysfb_simplefb.c
index 82c64cb9f531..74363ed7501f 100644
--- a/drivers/firmware/sysfb_simplefb.c
+++ b/drivers/firmware/sysfb_simplefb.c
@@ -51,7 +51,8 @@ __init bool sysfb_parse_mode(const struct screen_info *si,
*
* It's not easily possible to fix this in struct screen_info,
* as this could break UAPI. The best solution is to compute
- * bits_per_pixel here and ignore lfb_depth. In the loop below,
+ * bits_per_pixel from the color bits, reserved bits and
+ * reported lfb_depth, whichever is highest. In the loop below,
* ignore simplefb formats with alpha bits, as EFI and VESA
* don't specify alpha channels.
*/
@@ -60,6 +61,7 @@ __init bool sysfb_parse_mode(const struct screen_info *si,
si->green_size + si->green_pos,
si->blue_size + si->blue_pos),
si->rsvd_size + si->rsvd_pos);
+ bits_per_pixel = max_t(u32, bits_per_pixel, si->lfb_depth);
} else {
bits_per_pixel = si->lfb_depth;
}