Am 08.12.25 um 20:39 schrieb Tvrtko Ursulin:
From: Tvrtko Ursulin <[email protected]>
PIXEL_BIT_MASK formats can have either less or more than four bytes per
pixel so lets fix the lfb_linelenght calculation when applying the
swapped width and height quirks.
Signed-off-by: Tvrtko Ursulin <[email protected]>
Suggested-by: Thomas Zimmermann <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Melissa Wen <[email protected]>
Cc: [email protected]
Tested-by: Melissa Wen <[email protected]> # v3
Reviewed-by: Thomas Zimmermann <[email protected]>
---
drivers/firmware/efi/sysfb_efi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c
index 1d8b6966731c..60495eb3441c 100644
--- a/drivers/firmware/efi/sysfb_efi.c
+++ b/drivers/firmware/efi/sysfb_efi.c
@@ -357,8 +357,11 @@ __init void sysfb_apply_efi_quirks(void)
if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI &&
dmi_check_system(efifb_dmi_swap_width_height)) {
+ u32 bpp = __screen_info_lfb_bits_per_pixel(&screen_info);
+
swap(screen_info.lfb_width, screen_info.lfb_height);
- screen_info.lfb_linelength = 4 * screen_info.lfb_width;
+ screen_info.lfb_linelength = bpp * screen_info.lfb_width /
+ BITS_PER_BYTE;
}
}
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)