Commit 555624c0 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

vgacon: clean up global screen_info instances



To prepare for completely separating the VGA console screen_info from
the one used in EFI/sysfb, rename the vgacon instances and make them
local as much as possible.

ia64 and arm both have confurations with vgacon and efi, but the contents
never overlaps because ia64 has no EFI framebuffer, and arm only has
vga console on legacy platforms without EFI. Renaming these is required
before the EFI screen_info can be moved into drivers/firmware.

The ia64 vga console is actually registered in two places from
setup_arch(), but one of them is wrong, so drop the one in pcdp.c and
fix the one in setup.c to use the correct conditional.

x86 has to keep them together, as the boot protocol is used to switch
between VGA text console and framebuffer through the screen_info data.

Acked-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Acked-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-7-arnd@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent acfc7882
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/interrupt.h>
#include <linux/screen_info.h>
#include <linux/io.h>

/* Prototypes of functions used across modules here in this directory.  */
@@ -113,6 +114,7 @@ extern int boot_cpuid;
#ifdef CONFIG_VERBOSE_MCHECK
extern unsigned long alpha_verbose_mcheck;
#endif
extern struct screen_info vgacon_screen_info;

/* srmcons.c */
#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM)
+2 −4
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ static char __initdata command_line[COMMAND_LINE_SIZE];
 * code think we're on a VGA color display.
 */

struct screen_info screen_info = {
struct screen_info vgacon_screen_info = {
	.orig_x = 0,
	.orig_y = 25,
	.orig_video_cols = 80,
@@ -146,8 +146,6 @@ struct screen_info screen_info = {
	.orig_video_isVGA = 1,
	.orig_video_points = 16
};

EXPORT_SYMBOL(screen_info);
#endif

/*
@@ -654,7 +652,7 @@ setup_arch(char **cmdline_p)

#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
	vgacon_register_screen(&screen_info);
	vgacon_register_screen(&vgacon_screen_info);
#endif
#endif

+3 −3
Original line number Diff line number Diff line
@@ -60,9 +60,9 @@ 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;
	vgacon_screen_info.orig_y = 37;
	vgacon_screen_info.orig_video_cols = 100;
	vgacon_screen_info.orig_video_lines = 37;
#endif

	lca_init_arch();
+5 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#ifndef __ASMARM_SETUP_H
#define __ASMARM_SETUP_H

#include <linux/screen_info.h>
#include <uapi/asm/setup.h>


@@ -35,4 +36,8 @@ void early_mm_init(const struct machine_desc *);
void adjust_lowmem_bounds(void);
void setup_dma_zone(const struct machine_desc *desc);

#ifdef CONFIG_VGA_CONSOLE
extern struct screen_info vgacon_screen_info;
#endif

#endif
+9 −9
Original line number Diff line number Diff line
@@ -72,15 +72,15 @@ __tagtable(ATAG_MEM, parse_tag_mem32);
#if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_VGA_CONSOLE)
static int __init parse_tag_videotext(const struct tag *tag)
{
	screen_info.orig_x            = tag->u.videotext.x;
	screen_info.orig_y            = tag->u.videotext.y;
	screen_info.orig_video_page   = tag->u.videotext.video_page;
	screen_info.orig_video_mode   = tag->u.videotext.video_mode;
	screen_info.orig_video_cols   = tag->u.videotext.video_cols;
	screen_info.orig_video_ega_bx = tag->u.videotext.video_ega_bx;
	screen_info.orig_video_lines  = tag->u.videotext.video_lines;
	screen_info.orig_video_isVGA  = tag->u.videotext.video_isvga;
	screen_info.orig_video_points = tag->u.videotext.video_points;
	vgacon_screen_info.orig_x            = tag->u.videotext.x;
	vgacon_screen_info.orig_y            = tag->u.videotext.y;
	vgacon_screen_info.orig_video_page   = tag->u.videotext.video_page;
	vgacon_screen_info.orig_video_mode   = tag->u.videotext.video_mode;
	vgacon_screen_info.orig_video_cols   = tag->u.videotext.video_cols;
	vgacon_screen_info.orig_video_ega_bx = tag->u.videotext.video_ega_bx;
	vgacon_screen_info.orig_video_lines  = tag->u.videotext.video_lines;
	vgacon_screen_info.orig_video_isVGA  = tag->u.videotext.video_isvga;
	vgacon_screen_info.orig_video_points = tag->u.videotext.video_points;
	return 0;
}

Loading