Commit 8a736ddf authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

vgacon: rework screen_info #ifdef checks



On non-x86 architectures, the screen_info variable is generally only
used for the VGA console where supported, and in some cases the EFI
framebuffer or vga16fb.

Now that we have a definite list of which architectures actually use it
for what, use consistent #ifdef checks so the global variable is only
defined when it is actually used on those architectures.

Loongarch and riscv have no support for vgacon or vga16fb, but
they support EFI firmware, so only that needs to be checked, and the
initialization can be removed because that is handled by EFI.
IA64 has both vgacon and EFI, though EFI apparently never uses
a framebuffer here.

Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarKhalid Aziz <khalid@gonehiking.org>
Acked-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20231009211845.3136536-3-arnd@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e9e3300b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ static void determine_cpu_caches (unsigned int);

static char __initdata command_line[COMMAND_LINE_SIZE];

#ifdef CONFIG_VGA_CONSOLE
/*
 * The format of "screen_info" is strange, and due to early
 * i386-setup code. This is just enough to make the console
@@ -147,6 +148,7 @@ struct screen_info screen_info = {
};

EXPORT_SYMBOL(screen_info);
#endif

/*
 * The direct map I/O window, if any.  This should be the same
+2 −0
Original line number Diff line number Diff line
@@ -57,11 +57,13 @@ sio_init_irq(void)
static inline void __init
alphabook1_init_arch(void)
{
#ifdef CONFIG_VGA_CONSOLE
	/* The AlphaBook1 has LCD video fixed at 800x600,
	   37 rows and 100 cols. */
	screen_info.orig_y = 37;
	screen_info.orig_video_cols = 100;
	screen_info.orig_video_lines = 37;
#endif

	lca_init_arch();
}
+6 −0
Original line number Diff line number Diff line
@@ -86,9 +86,13 @@ EXPORT_SYMBOL(local_per_cpu_offset);
#endif
unsigned long ia64_cycles_per_usec;
struct ia64_boot_param *ia64_boot_param;
#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_EFI)
struct screen_info screen_info;
#endif
#ifdef CONFIG_VGA_CONSOLE
unsigned long vga_console_iobase;
unsigned long vga_console_membase;
#endif

static struct resource data_resource = {
	.name	= "Kernel data",
@@ -497,6 +501,7 @@ early_console_setup (char *cmdline)
static void __init
screen_info_setup(void)
{
#ifdef CONFIG_VGA_CONSOLE
	unsigned int orig_x, orig_y, num_cols, num_rows, font_height;

	memset(&screen_info, 0, sizeof(screen_info));
@@ -525,6 +530,7 @@ screen_info_setup(void)
	screen_info.orig_video_mode = 3;	/* XXX fake */
	screen_info.orig_video_isVGA = 1;	/* XXX fake */
	screen_info.orig_video_ega_bx = 3;	/* XXX fake */
#endif
}

static inline void
+2 −0
Original line number Diff line number Diff line
@@ -57,7 +57,9 @@
#define SMBIOS_CORE_PACKAGE_OFFSET	0x23
#define LOONGSON_EFI_ENABLE		(1 << 3)

#ifdef CONFIG_EFI
struct screen_info screen_info __section(".data");
#endif

unsigned long fw_arg0, fw_arg1, fw_arg2;
DEFINE_PER_CPU(unsigned long, kernelsp);
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;

EXPORT_SYMBOL(cpu_data);

#ifdef CONFIG_VT
#ifdef CONFIG_VGA_CONSOLE
struct screen_info screen_info;
#endif

Loading