Commit 8633ef82 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Thomas Zimmermann
Browse files

drivers/firmware: consolidate EFI framebuffer setup for all arches



The register_gop_device() function registers an "efi-framebuffer" platform
device to match against the efifb driver, to have an early framebuffer for
EFI platforms.

But there is already support to do exactly the same by the Generic System
Framebuffers (sysfb) driver. This used to be only for X86 but it has been
moved to drivers/firmware and could be reused by other architectures.

Also, besides supporting registering an "efi-framebuffer", this driver can
register a "simple-framebuffer" allowing to use the siple{fb,drm} drivers
on non-X86 EFI platforms. For example, on aarch64 these drivers can only
be used with DT and doesn't have code to register a "simple-frambuffer"
platform device when booting with EFI.

For these reasons, let's remove the register_gop_device() duplicated code
and instead move the platform specific logic that's there to sysfb driver.

Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Acked-by: default avatarBorislav Petkov <bp@suse.de>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210625131359.1804394-1-javierm@redhat.com
parent d391c582
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

#ifdef CONFIG_EFI
void efi_init(void);
extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt);

int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
@@ -52,10 +53,6 @@ void efi_virtmap_unload(void);
struct screen_info *alloc_screen_info(void);
void free_screen_info(struct screen_info *si);

static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
{
}

/*
 * A reasonable upper bound for the uncompressed kernel size is 32 MBytes,
 * so we will reserve that amount of memory. We have no easy way to tell what
+1 −4
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@

#ifdef CONFIG_EFI
extern void efi_init(void);
extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt);
#else
#define efi_init()
#endif
@@ -85,10 +86,6 @@ static inline void free_screen_info(struct screen_info *si)
{
}

static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
{
}

#define EFI_ALLOC_ALIGN		SZ_64K

/*
+1 −4
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@

#ifdef CONFIG_EFI
extern void efi_init(void);
extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt);
#else
#define efi_init()
#endif
@@ -39,10 +40,6 @@ static inline void free_screen_info(struct screen_info *si)
{
}

static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
{
}

void efi_virtmap_load(void);
void efi_virtmap_unload(void);

+4 −4
Original line number Diff line number Diff line
@@ -254,9 +254,9 @@ config QCOM_SCM_DOWNLOAD_MODE_DEFAULT
config SYSFB
	bool
	default y
	depends on X86 || COMPILE_TEST
	depends on X86 || ARM || ARM64 || RISCV || COMPILE_TEST

config X86_SYSFB
config SYSFB_SIMPLEFB
	bool "Mark VGA/VBE/EFI FB as generic system framebuffer"
	depends on SYSFB
	help
@@ -264,10 +264,10 @@ config X86_SYSFB
	  bootloader or kernel can show basic video-output during boot for
	  user-guidance and debugging. Historically, x86 used the VESA BIOS
	  Extensions and EFI-framebuffers for this, which are mostly limited
	  to x86.
	  to x86 BIOS or EFI systems.
	  This option, if enabled, marks VGA/VBE/EFI framebuffers as generic
	  framebuffers so the new generic system-framebuffer drivers can be
	  used on x86. If the framebuffer is not compatible with the generic
	  used instead. If the framebuffer is not compatible with the generic
	  modes, it is advertised as fallback platform framebuffer so legacy
	  drivers like efifb, vesafb and uvesafb can pick it up.
	  If this option is not selected, all system framebuffers are always
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o
obj-$(CONFIG_FW_CFG_SYSFS)	+= qemu_fw_cfg.o
obj-$(CONFIG_QCOM_SCM)		+= qcom_scm.o qcom_scm-smc.o qcom_scm-legacy.o
obj-$(CONFIG_SYSFB)		+= sysfb.o
obj-$(CONFIG_X86_SYSFB)		+= sysfb_simplefb.o
obj-$(CONFIG_SYSFB_SIMPLEFB)	+= sysfb_simplefb.o
obj-$(CONFIG_TI_SCI_PROTOCOL)	+= ti_sci.o
obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o
obj-$(CONFIG_TURRIS_MOX_RWTM)	+= turris-mox-rwtm.o
Loading