firmware/sysfb: Update screen_info for relocated EFI framebuffers
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 12 Feb 2024 09:06:15 +0000 (10:06 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 14 Feb 2024 09:09:21 +0000 (10:09 +0100)
commit78aa89d1dfba1e3cf4a2e053afa3b4c4ec622371
tree5329f0fbf2d241600d9d4b46ca57c13a54e1dcbd
parent784e27f2811884ab78edc713a4ef0d4deca9b668
firmware/sysfb: Update screen_info for relocated EFI framebuffers

On ARM PCI systems, the PCI hierarchy might be reconfigured during
boot and the firmware framebuffer might move as a result of that.
The values in screen_info will then be invalid.

Work around this problem by tracking the framebuffer's initial
location before it get relocated; then fix the screen_info state
between reloaction and creating the firmware framebuffer's device.

This functionality has been lifted from efifb. See the commit message
of commit 55d728a40d36 ("efi/fb: Avoid reconfiguration of BAR that
covers the framebuffer") for more information.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240212090736.11464-8-tzimmermann@suse.de
drivers/firmware/sysfb.c
drivers/video/screen_info_pci.c
include/linux/screen_info.h