From: Arnd Bergmann <[email protected]>
I refreshed the first four patches that I sent before with very minor
updates, and then added some more to further disaggregate the use
of screen_info:
- I found that powerpc wasn't using vga16fb any more
- vgacon can be almost entirely separated from the global
screen_info, except on x86
- similarly, the EFI framebuffer initialization can be
kept separate, except on x86.
I did extensive build testing on arm/arm64/x86 and the normal built bot
testing for the other architectures.
Which tree should this get merged through?
Link: https://lore.kernel.org/lkml/[email protected]/
Arnd Bergmann (9):
vgacon: rework Kconfig dependencies
vgacon: rework screen_info #ifdef checks
dummycon: limit Arm console size hack to footbridge
vgacon, arch/*: remove unused screen_info definitions
vgacon: remove screen_info dependency
vgacon: clean up global screen_info instances
vga16fb: drop powerpc support
hyperv: avoid dependency on screen_info
efi: move screen_info into efi init code
arch/alpha/kernel/proto.h | 2 +
arch/alpha/kernel/setup.c | 8 +--
arch/alpha/kernel/sys_sio.c | 8 ++-
arch/arm/include/asm/setup.h | 5 ++
arch/arm/kernel/atags_parse.c | 20 +++---
arch/arm/kernel/efi.c | 6 --
arch/arm/kernel/setup.c | 7 +-
arch/arm64/kernel/efi.c | 4 --
arch/arm64/kernel/image-vars.h | 2 +
arch/csky/kernel/setup.c | 12 ----
arch/hexagon/kernel/Makefile | 2 -
arch/hexagon/kernel/screen_info.c | 3 -
arch/ia64/kernel/setup.c | 51 +++++++-------
arch/loongarch/kernel/efi.c | 3 +-
arch/loongarch/kernel/image-vars.h | 2 +
arch/loongarch/kernel/setup.c | 3 -
arch/mips/jazz/setup.c | 9 ---
arch/mips/kernel/setup.c | 11 ---
arch/mips/mti-malta/malta-setup.c | 4 +-
arch/mips/sibyte/swarm/setup.c | 26 ++++---
arch/mips/sni/setup.c | 18 ++---
arch/nios2/kernel/setup.c | 5 --
arch/powerpc/kernel/setup-common.c | 16 -----
arch/riscv/kernel/setup.c | 12 ----
arch/sh/kernel/setup.c | 5 --
arch/sparc/kernel/setup_32.c | 13 ----
arch/sparc/kernel/setup_64.c | 13 ----
arch/x86/kernel/setup.c | 2 +-
arch/xtensa/kernel/setup.c | 12 ----
drivers/firmware/efi/efi-init.c | 14 +++-
drivers/firmware/efi/libstub/efi-stub-entry.c | 8 ++-
drivers/firmware/pcdp.c | 1 -
drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 7 +-
drivers/hv/vmbus_drv.c | 6 +-
drivers/video/console/Kconfig | 11 +--
drivers/video/console/dummycon.c | 2 +-
drivers/video/console/vgacon.c | 68 +++++++++++--------
drivers/video/fbdev/Kconfig | 2 +-
drivers/video/fbdev/hyperv_fb.c | 8 +--
drivers/video/fbdev/vga16fb.c | 9 +--
include/linux/console.h | 7 ++
41 files changed, 178 insertions(+), 249 deletions(-)
delete mode 100644 arch/hexagon/kernel/screen_info.c
--
2.39.2
Cc: "David S. Miller" <[email protected]>
Cc: "K. Y. Srinivasan" <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Cain <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Deepak Rawat <[email protected]>
Cc: Dexuan Cui <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Javier Martinez Canillas <[email protected]>
Cc: John Paul Adrian Glaubitz <[email protected]>
Cc: Khalid Aziz <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Matt Turner <[email protected]>
Cc: Max Filippov <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Russell King <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
From: Arnd Bergmann <[email protected]>
The two hyperv framebuffer drivers (hyperv_fb or hyperv_drm_drv) access the
global screen_info in order to take over from the sysfb framebuffer, which
in turn could be handled by simplefb, simpledrm or efifb. Similarly, the
vmbus_drv code marks the original EFI framebuffer as reserved, but this
is not required if there is no sysfb.
As a preparation for making screen_info itself more local to the sysfb
helper code, add a compile-time conditional in all three files that relate
to hyperv fb and just skip this code if there is no sysfb that needs to
be unregistered.
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 7 ++++---
drivers/hv/vmbus_drv.c | 6 ++++--
drivers/video/fbdev/hyperv_fb.c | 8 ++++----
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
index 8026118c6e033..9a44a00effc24 100644
--- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
+++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
@@ -73,9 +73,10 @@ static int hyperv_setup_vram(struct hyperv_drm_device *hv,
struct drm_device *dev = &hv->dev;
int ret;
- drm_aperture_remove_conflicting_framebuffers(screen_info.lfb_base,
- screen_info.lfb_size,
- &hyperv_driver);
+ if (IS_ENABLED(CONFIG_SYSFB))
+ drm_aperture_remove_conflicting_framebuffers(screen_info.lfb_base,
+ screen_info.lfb_size,
+ &hyperv_driver);
hv->fb_size = (unsigned long)hv->mmio_megabytes * 1024 * 1024;
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 67f95a29aeca5..5bc059e8a9f5f 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -2100,8 +2100,10 @@ static void __maybe_unused vmbus_reserve_fb(void)
if (efi_enabled(EFI_BOOT)) {
/* Gen2 VM: get FB base from EFI framebuffer */
- start = screen_info.lfb_base;
- size = max_t(__u32, screen_info.lfb_size, 0x800000);
+ if (IS_ENABLED(CONFIG_SYSFB)) {
+ start = screen_info.lfb_base;
+ size = max_t(__u32, screen_info.lfb_size, 0x800000);
+ }
} else {
/* Gen1 VM: get FB base from PCI */
pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
index b331452aab4fb..7e0d1c4235549 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
@@ -1030,7 +1030,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
goto getmem_done;
}
pr_info("Unable to allocate enough contiguous physical memory on Gen 1 VM. Using MMIO instead.\n");
- } else {
+ } else if (IS_ENABLED(CONFIG_SYSFB)) {
base = screen_info.lfb_base;
size = screen_info.lfb_size;
}
@@ -1076,13 +1076,13 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
getmem_done:
aperture_remove_conflicting_devices(base, size, KBUILD_MODNAME);
- if (gen2vm) {
+ if (!gen2vm) {
+ pci_dev_put(pdev);
+ } else if (IS_ENABLED(CONFIG_SYSFB)) {
/* framebuffer is reallocated, clear screen_info to avoid misuse from kexec */
screen_info.lfb_size = 0;
screen_info.lfb_base = 0;
screen_info.orig_video_isVGA = 0;
- } else {
- pci_dev_put(pdev);
}
return 0;
--
2.39.2
Arnd Bergmann <[email protected]> writes:
> From: Arnd Bergmann <[email protected]>
>
> The two hyperv framebuffer drivers (hyperv_fb or hyperv_drm_drv) access the
> global screen_info in order to take over from the sysfb framebuffer, which
> in turn could be handled by simplefb, simpledrm or efifb. Similarly, the
> vmbus_drv code marks the original EFI framebuffer as reserved, but this
> is not required if there is no sysfb.
>
> As a preparation for making screen_info itself more local to the sysfb
> helper code, add a compile-time conditional in all three files that relate
> to hyperv fb and just skip this code if there is no sysfb that needs to
> be unregistered.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
Reviewed-by: Javier Martinez Canillas <[email protected]>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
On 7/19/23 14:39, Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> I refreshed the first four patches that I sent before with very minor
> updates, and then added some more to further disaggregate the use
> of screen_info:
>
> - I found that powerpc wasn't using vga16fb any more
>
> - vgacon can be almost entirely separated from the global
> screen_info, except on x86
>
> - similarly, the EFI framebuffer initialization can be
> kept separate, except on x86.
Nice cleanup, Arnd!
You may add a
Acked-by: Helge Deller <[email protected]>
to the series.
> I did extensive build testing on arm/arm64/x86 and the normal built bot
> testing for the other architectures.
> Which tree should this get merged through?
I suggest drm-misc or fbdev. Either is fine for me.
Since it applies cleanly onto git head, I can put it a few days into
the fbdev git tree to see if some builds break. Just let me know.
Helge