2023-07-07 10:13:29

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 1/4] vgacon: rework Kconfig dependencies

From: Arnd Bergmann <[email protected]>

The list of dependencies here is phrased as an opt-out, but this is missing
a lot of architectures that don't actually support VGA consoles, and some
of the entries are stale:

- powerpc used to support VGA consoles in the old arch/ppc codebase, but
the merged arch/powerpc never did

- arm lists footbridge, integrator and netwinder, but netwinder is actually
part of footbridge, and integrator does not appear to have an actual
VGA hardware, or list it in its ATAG or DT.

- mips has a few platforms (jazz, sibyte, and sni) that initialize
screen_info, on everything else the console is selected but cannot
actually work.

- csky, hexgagon, loongarch, nios2, riscv and xtensa are not listed
in the opt-out table and declare a screen_info to allow building
vga_con, but this cannot work because the console is never selected.

Replace this with an opt-in table that lists only the platforms that
remain. This is effectively x86, plus a couple of historic workstation
and server machines that reused parts of the x86 system architecture.

Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/video/console/Kconfig | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index a2a88d42edf0c..47c498defc211 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -7,9 +7,9 @@ menu "Console display driver support"

config VGA_CONSOLE
bool "VGA text console" if EXPERT || !X86
- depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !SUPERH && \
- (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \
- !ARM64 && !ARC && !MICROBLAZE && !OPENRISC && !S390 && !UML
+ depends on ALPHA || IA64 || X86 || \
+ (ARM && ARCH_FOOTBRIDGE) || \
+ (MIPS && (MIPS_MALTA || SIBYTE_BCM112X || SIBYTE_SB1250 || SIBYTE_BCM1x80 || SNI_RM))
select APERTURE_HELPERS if (DRM || FB || VFIO_PCI_CORE)
default y
help
--
2.39.2



2023-07-07 10:22:00

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 4/4] vgacon, arch/*: remove unused screen_info definitions

From: Arnd Bergmann <[email protected]>

A number of architectures either kept the screen_info definition for
historical purposes as it used to be required by the generic VT code, or
they copied it from another architecture in order to build the VGA
console driver in an allmodconfig build.

Now that vgacon no longer builds on these architectures, remove the
stale definitions.

Signed-off-by: Arnd Bergmann <[email protected]>
---
arch/csky/kernel/setup.c | 12 ------------
arch/hexagon/kernel/Makefile | 2 --
arch/hexagon/kernel/screen_info.c | 3 ---
arch/nios2/kernel/setup.c | 5 -----
arch/sh/kernel/setup.c | 5 -----
arch/sparc/kernel/setup_32.c | 13 -------------
arch/sparc/kernel/setup_64.c | 13 -------------
arch/xtensa/kernel/setup.c | 12 ------------
8 files changed, 65 deletions(-)
delete mode 100644 arch/hexagon/kernel/screen_info.c

diff --git a/arch/csky/kernel/setup.c b/arch/csky/kernel/setup.c
index 106fbf0b6f3b4..51012e90780d6 100644
--- a/arch/csky/kernel/setup.c
+++ b/arch/csky/kernel/setup.c
@@ -8,22 +8,10 @@
#include <linux/of_fdt.h>
#include <linux/start_kernel.h>
#include <linux/dma-map-ops.h>
-#include <linux/screen_info.h>
#include <asm/sections.h>
#include <asm/mmu_context.h>
#include <asm/pgalloc.h>

-#ifdef CONFIG_DUMMY_CONSOLE
-struct screen_info screen_info = {
- .orig_video_lines = 30,
- .orig_video_cols = 80,
- .orig_video_mode = 0,
- .orig_video_ega_bx = 0,
- .orig_video_isVGA = 1,
- .orig_video_points = 8
-};
-#endif
-
static void __init csky_memblock_init(void)
{
unsigned long lowmem_size = PFN_DOWN(LOWMEM_LIMIT - PHYS_OFFSET_OFFSET);
diff --git a/arch/hexagon/kernel/Makefile b/arch/hexagon/kernel/Makefile
index e73cb321630ec..3fdf937eb572e 100644
--- a/arch/hexagon/kernel/Makefile
+++ b/arch/hexagon/kernel/Makefile
@@ -17,5 +17,3 @@ obj-y += vm_vectors.o
obj-$(CONFIG_HAS_DMA) += dma.o

obj-$(CONFIG_STACKTRACE) += stacktrace.o
-
-obj-$(CONFIG_VGA_CONSOLE) += screen_info.o
diff --git a/arch/hexagon/kernel/screen_info.c b/arch/hexagon/kernel/screen_info.c
deleted file mode 100644
index 1e1ceb18bafe7..0000000000000
--- a/arch/hexagon/kernel/screen_info.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <linux/screen_info.h>
-
-struct screen_info screen_info;
diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c
index 8582ed9658447..da122a5fa43b2 100644
--- a/arch/nios2/kernel/setup.c
+++ b/arch/nios2/kernel/setup.c
@@ -19,7 +19,6 @@
#include <linux/memblock.h>
#include <linux/initrd.h>
#include <linux/of_fdt.h>
-#include <linux/screen_info.h>

#include <asm/mmu_context.h>
#include <asm/sections.h>
@@ -36,10 +35,6 @@ static struct pt_regs fake_regs = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0};

-#ifdef CONFIG_VT
-struct screen_info screen_info;
-#endif
-
/* Copy a short hook instruction sequence to the exception address */
static inline void copy_exception_handler(unsigned int addr)
{
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index b3da2757faaf3..3d80515298d26 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -7,7 +7,6 @@
* Copyright (C) 1999 Niibe Yutaka
* Copyright (C) 2002 - 2010 Paul Mundt
*/
-#include <linux/screen_info.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/initrd.h>
@@ -69,10 +68,6 @@ EXPORT_SYMBOL(cpu_data);
struct sh_machine_vector sh_mv = { .mv_name = "generic", };
EXPORT_SYMBOL(sh_mv);

-#ifdef CONFIG_VT
-struct screen_info screen_info;
-#endif
-
extern int root_mountflags;

#define RAMDISK_IMAGE_START_MASK 0x07FF
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
index 34ef7febf0d56..e3b72a7b46d37 100644
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -17,7 +17,6 @@
#include <linux/initrd.h>
#include <asm/smp.h>
#include <linux/user.h>
-#include <linux/screen_info.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/seq_file.h>
@@ -51,18 +50,6 @@

#include "kernel.h"

-struct screen_info screen_info = {
- 0, 0, /* orig-x, orig-y */
- 0, /* unused */
- 0, /* orig-video-page */
- 0, /* orig-video-mode */
- 128, /* orig-video-cols */
- 0,0,0, /* ega_ax, ega_bx, ega_cx */
- 54, /* orig-video-lines */
- 0, /* orig-video-isVGA */
- 16 /* orig-video-points */
-};
-
/* Typing sync at the prom prompt calls the function pointed to by
* romvec->pv_synchook which I set to the following function.
* This should sync all filesystems and return, for now it just
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 6546ca9d4d3f1..6a4797dec34b4 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -15,7 +15,6 @@
#include <linux/ptrace.h>
#include <asm/smp.h>
#include <linux/user.h>
-#include <linux/screen_info.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/seq_file.h>
@@ -68,18 +67,6 @@
DEFINE_SPINLOCK(ns87303_lock);
EXPORT_SYMBOL(ns87303_lock);

-struct screen_info screen_info = {
- 0, 0, /* orig-x, orig-y */
- 0, /* unused */
- 0, /* orig-video-page */
- 0, /* orig-video-mode */
- 128, /* orig-video-cols */
- 0, 0, 0, /* unused, ega_bx, unused */
- 54, /* orig-video-lines */
- 0, /* orig-video-isVGA */
- 16 /* orig-video-points */
-};
-
static void
prom_console_write(struct console *con, const char *s, unsigned int n)
{
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index aba3ff4e60d85..3f22d0537818d 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -19,7 +19,6 @@
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/proc_fs.h>
-#include <linux/screen_info.h>
#include <linux/kernel.h>
#include <linux/percpu.h>
#include <linux/reboot.h>
@@ -49,17 +48,6 @@
#include <asm/timex.h>
#include <asm/traps.h>

-#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
-struct screen_info screen_info = {
- .orig_x = 0,
- .orig_y = 24,
- .orig_video_cols = 80,
- .orig_video_lines = 24,
- .orig_video_isVGA = 1,
- .orig_video_points = 16,
-};
-#endif
-
#ifdef CONFIG_BLK_DEV_INITRD
extern unsigned long initrd_start;
extern unsigned long initrd_end;
--
2.39.2


2023-07-07 13:43:16

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 1/4] vgacon: rework Kconfig dependencies

Arnd Bergmann <[email protected]> writes:

Hello Arnd,

> From: Arnd Bergmann <[email protected]>
>
> The list of dependencies here is phrased as an opt-out, but this is missing
> a lot of architectures that don't actually support VGA consoles, and some
> of the entries are stale:
>
> - powerpc used to support VGA consoles in the old arch/ppc codebase, but
> the merged arch/powerpc never did
>
> - arm lists footbridge, integrator and netwinder, but netwinder is actually
> part of footbridge, and integrator does not appear to have an actual
> VGA hardware, or list it in its ATAG or DT.
>
> - mips has a few platforms (jazz, sibyte, and sni) that initialize
> screen_info, on everything else the console is selected but cannot
> actually work.
>
> - csky, hexgagon, loongarch, nios2, riscv and xtensa are not listed
> in the opt-out table and declare a screen_info to allow building
> vga_con, but this cannot work because the console is never selected.
>
> Replace this with an opt-in table that lists only the platforms that
> remain. This is effectively x86, plus a couple of historic workstation
> and server machines that reused parts of the x86 system architecture.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---

Both our explanation and changes look good to me.

Reviewed-by: Javier Martinez Canillas <[email protected]>

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


2023-07-07 13:51:53

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 4/4] vgacon, arch/*: remove unused screen_info definitions

Arnd Bergmann <[email protected]> writes:

> From: Arnd Bergmann <[email protected]>
>
> A number of architectures either kept the screen_info definition for
> historical purposes as it used to be required by the generic VT code, or
> they copied it from another architecture in order to build the VGA
> console driver in an allmodconfig build.
>
> Now that vgacon no longer builds on these architectures, remove the
> stale definitions.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---

Nice cleanup!

Reviewed-by: Javier Martinez Canillas <[email protected]>

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


2023-07-07 15:29:08

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH 1/4] vgacon: rework Kconfig dependencies

Hi,

for the whole series:

Reviewed-by: Thomas Zimmermann <[email protected]>

Best regards
Thomas

Am 07.07.23 um 11:52 schrieb Arnd Bergmann:
> From: Arnd Bergmann <[email protected]>
>
> The list of dependencies here is phrased as an opt-out, but this is missing
> a lot of architectures that don't actually support VGA consoles, and some
> of the entries are stale:
>
> - powerpc used to support VGA consoles in the old arch/ppc codebase, but
> the merged arch/powerpc never did
>
> - arm lists footbridge, integrator and netwinder, but netwinder is actually
> part of footbridge, and integrator does not appear to have an actual
> VGA hardware, or list it in its ATAG or DT.
>
> - mips has a few platforms (jazz, sibyte, and sni) that initialize
> screen_info, on everything else the console is selected but cannot
> actually work.
>
> - csky, hexgagon, loongarch, nios2, riscv and xtensa are not listed
> in the opt-out table and declare a screen_info to allow building
> vga_con, but this cannot work because the console is never selected.
>
> Replace this with an opt-in table that lists only the platforms that
> remain. This is effectively x86, plus a couple of historic workstation
> and server machines that reused parts of the x86 system architecture.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> drivers/video/console/Kconfig | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
> index a2a88d42edf0c..47c498defc211 100644
> --- a/drivers/video/console/Kconfig
> +++ b/drivers/video/console/Kconfig
> @@ -7,9 +7,9 @@ menu "Console display driver support"
>
> config VGA_CONSOLE
> bool "VGA text console" if EXPERT || !X86
> - depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !SUPERH && \
> - (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \
> - !ARM64 && !ARC && !MICROBLAZE && !OPENRISC && !S390 && !UML
> + depends on ALPHA || IA64 || X86 || \
> + (ARM && ARCH_FOOTBRIDGE) || \
> + (MIPS && (MIPS_MALTA || SIBYTE_BCM112X || SIBYTE_SB1250 || SIBYTE_BCM1x80 || SNI_RM))
> select APERTURE_HELPERS if (DRM || FB || VFIO_PCI_CORE)
> default y
> help

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


Attachments:
OpenPGP_signature (855.00 B)
OpenPGP digital signature

2023-07-10 04:29:08

by Dinh Nguyen

[permalink] [raw]
Subject: Re: [PATCH 4/4] vgacon, arch/*: remove unused screen_info definitions



On 7/7/23 04:52, Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> A number of architectures either kept the screen_info definition for
> historical purposes as it used to be required by the generic VT code, or
> they copied it from another architecture in order to build the VGA
> console driver in an allmodconfig build.
>
> Now that vgacon no longer builds on these architectures, remove the
> stale definitions.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> arch/csky/kernel/setup.c | 12 ------------
> arch/hexagon/kernel/Makefile | 2 --
> arch/hexagon/kernel/screen_info.c | 3 ---
> arch/nios2/kernel/setup.c | 5 -----

Acked-by: Dinh Nguyen <[email protected]>


2023-07-10 04:53:18

by Max Filippov

[permalink] [raw]
Subject: Re: [PATCH 4/4] vgacon, arch/*: remove unused screen_info definitions

On Fri, Jul 7, 2023 at 2:56 AM Arnd Bergmann <[email protected]> wrote:
>
> From: Arnd Bergmann <[email protected]>
>
> A number of architectures either kept the screen_info definition for
> historical purposes as it used to be required by the generic VT code, or
> they copied it from another architecture in order to build the VGA
> console driver in an allmodconfig build.
>
> Now that vgacon no longer builds on these architectures, remove the
> stale definitions.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> arch/csky/kernel/setup.c | 12 ------------
> arch/hexagon/kernel/Makefile | 2 --
> arch/hexagon/kernel/screen_info.c | 3 ---
> arch/nios2/kernel/setup.c | 5 -----
> arch/sh/kernel/setup.c | 5 -----
> arch/sparc/kernel/setup_32.c | 13 -------------
> arch/sparc/kernel/setup_64.c | 13 -------------
> arch/xtensa/kernel/setup.c | 12 ------------

For xtensa:
Acked-by: Max Filippov <[email protected]>

--
Thanks.
-- Max

2023-07-12 14:57:36

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH 4/4] vgacon, arch/*: remove unused screen_info definitions

On Fri, 07 Jul 2023 02:52:26 PDT (-0700), [email protected] wrote:
> From: Arnd Bergmann <[email protected]>
>
> A number of architectures either kept the screen_info definition for
> historical purposes as it used to be required by the generic VT code, or
> they copied it from another architecture in order to build the VGA
> console driver in an allmodconfig build.
>
> Now that vgacon no longer builds on these architectures, remove the
> stale definitions.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> arch/csky/kernel/setup.c | 12 ------------
> arch/hexagon/kernel/Makefile | 2 --
> arch/hexagon/kernel/screen_info.c | 3 ---
> arch/nios2/kernel/setup.c | 5 -----
> arch/sh/kernel/setup.c | 5 -----
> arch/sparc/kernel/setup_32.c | 13 -------------
> arch/sparc/kernel/setup_64.c | 13 -------------
> arch/xtensa/kernel/setup.c | 12 ------------
> 8 files changed, 65 deletions(-)
> delete mode 100644 arch/hexagon/kernel/screen_info.c
>
> diff --git a/arch/csky/kernel/setup.c b/arch/csky/kernel/setup.c
> index 106fbf0b6f3b4..51012e90780d6 100644
> --- a/arch/csky/kernel/setup.c
> +++ b/arch/csky/kernel/setup.c
> @@ -8,22 +8,10 @@
> #include <linux/of_fdt.h>
> #include <linux/start_kernel.h>
> #include <linux/dma-map-ops.h>
> -#include <linux/screen_info.h>
> #include <asm/sections.h>
> #include <asm/mmu_context.h>
> #include <asm/pgalloc.h>
>
> -#ifdef CONFIG_DUMMY_CONSOLE
> -struct screen_info screen_info = {
> - .orig_video_lines = 30,
> - .orig_video_cols = 80,
> - .orig_video_mode = 0,
> - .orig_video_ega_bx = 0,
> - .orig_video_isVGA = 1,
> - .orig_video_points = 8
> -};
> -#endif
> -
> static void __init csky_memblock_init(void)
> {
> unsigned long lowmem_size = PFN_DOWN(LOWMEM_LIMIT - PHYS_OFFSET_OFFSET);
> diff --git a/arch/hexagon/kernel/Makefile b/arch/hexagon/kernel/Makefile
> index e73cb321630ec..3fdf937eb572e 100644
> --- a/arch/hexagon/kernel/Makefile
> +++ b/arch/hexagon/kernel/Makefile
> @@ -17,5 +17,3 @@ obj-y += vm_vectors.o
> obj-$(CONFIG_HAS_DMA) += dma.o
>
> obj-$(CONFIG_STACKTRACE) += stacktrace.o
> -
> -obj-$(CONFIG_VGA_CONSOLE) += screen_info.o
> diff --git a/arch/hexagon/kernel/screen_info.c b/arch/hexagon/kernel/screen_info.c
> deleted file mode 100644
> index 1e1ceb18bafe7..0000000000000
> --- a/arch/hexagon/kernel/screen_info.c
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -#include <linux/screen_info.h>
> -
> -struct screen_info screen_info;
> diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c
> index 8582ed9658447..da122a5fa43b2 100644
> --- a/arch/nios2/kernel/setup.c
> +++ b/arch/nios2/kernel/setup.c
> @@ -19,7 +19,6 @@
> #include <linux/memblock.h>
> #include <linux/initrd.h>
> #include <linux/of_fdt.h>
> -#include <linux/screen_info.h>
>
> #include <asm/mmu_context.h>
> #include <asm/sections.h>
> @@ -36,10 +35,6 @@ static struct pt_regs fake_regs = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0,
> 0};
>
> -#ifdef CONFIG_VT
> -struct screen_info screen_info;
> -#endif
> -
> /* Copy a short hook instruction sequence to the exception address */
> static inline void copy_exception_handler(unsigned int addr)
> {
> diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
> index b3da2757faaf3..3d80515298d26 100644
> --- a/arch/sh/kernel/setup.c
> +++ b/arch/sh/kernel/setup.c
> @@ -7,7 +7,6 @@
> * Copyright (C) 1999 Niibe Yutaka
> * Copyright (C) 2002 - 2010 Paul Mundt
> */
> -#include <linux/screen_info.h>
> #include <linux/ioport.h>
> #include <linux/init.h>
> #include <linux/initrd.h>
> @@ -69,10 +68,6 @@ EXPORT_SYMBOL(cpu_data);
> struct sh_machine_vector sh_mv = { .mv_name = "generic", };
> EXPORT_SYMBOL(sh_mv);
>
> -#ifdef CONFIG_VT
> -struct screen_info screen_info;
> -#endif
> -
> extern int root_mountflags;
>
> #define RAMDISK_IMAGE_START_MASK 0x07FF
> diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
> index 34ef7febf0d56..e3b72a7b46d37 100644
> --- a/arch/sparc/kernel/setup_32.c
> +++ b/arch/sparc/kernel/setup_32.c
> @@ -17,7 +17,6 @@
> #include <linux/initrd.h>
> #include <asm/smp.h>
> #include <linux/user.h>
> -#include <linux/screen_info.h>
> #include <linux/delay.h>
> #include <linux/fs.h>
> #include <linux/seq_file.h>
> @@ -51,18 +50,6 @@
>
> #include "kernel.h"
>
> -struct screen_info screen_info = {
> - 0, 0, /* orig-x, orig-y */
> - 0, /* unused */
> - 0, /* orig-video-page */
> - 0, /* orig-video-mode */
> - 128, /* orig-video-cols */
> - 0,0,0, /* ega_ax, ega_bx, ega_cx */
> - 54, /* orig-video-lines */
> - 0, /* orig-video-isVGA */
> - 16 /* orig-video-points */
> -};
> -
> /* Typing sync at the prom prompt calls the function pointed to by
> * romvec->pv_synchook which I set to the following function.
> * This should sync all filesystems and return, for now it just
> diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
> index 6546ca9d4d3f1..6a4797dec34b4 100644
> --- a/arch/sparc/kernel/setup_64.c
> +++ b/arch/sparc/kernel/setup_64.c
> @@ -15,7 +15,6 @@
> #include <linux/ptrace.h>
> #include <asm/smp.h>
> #include <linux/user.h>
> -#include <linux/screen_info.h>
> #include <linux/delay.h>
> #include <linux/fs.h>
> #include <linux/seq_file.h>
> @@ -68,18 +67,6 @@
> DEFINE_SPINLOCK(ns87303_lock);
> EXPORT_SYMBOL(ns87303_lock);
>
> -struct screen_info screen_info = {
> - 0, 0, /* orig-x, orig-y */
> - 0, /* unused */
> - 0, /* orig-video-page */
> - 0, /* orig-video-mode */
> - 128, /* orig-video-cols */
> - 0, 0, 0, /* unused, ega_bx, unused */
> - 54, /* orig-video-lines */
> - 0, /* orig-video-isVGA */
> - 16 /* orig-video-points */
> -};
> -
> static void
> prom_console_write(struct console *con, const char *s, unsigned int n)
> {
> diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
> index aba3ff4e60d85..3f22d0537818d 100644
> --- a/arch/xtensa/kernel/setup.c
> +++ b/arch/xtensa/kernel/setup.c
> @@ -19,7 +19,6 @@
> #include <linux/init.h>
> #include <linux/mm.h>
> #include <linux/proc_fs.h>
> -#include <linux/screen_info.h>
> #include <linux/kernel.h>
> #include <linux/percpu.h>
> #include <linux/reboot.h>
> @@ -49,17 +48,6 @@
> #include <asm/timex.h>
> #include <asm/traps.h>
>
> -#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
> -struct screen_info screen_info = {
> - .orig_x = 0,
> - .orig_y = 24,
> - .orig_video_cols = 80,
> - .orig_video_lines = 24,
> - .orig_video_isVGA = 1,
> - .orig_video_points = 16,
> -};
> -#endif
> -
> #ifdef CONFIG_BLK_DEV_INITRD
> extern unsigned long initrd_start;
> extern unsigned long initrd_end;

Acked-by: Palmer Dabbelt <[email protected]>

2023-07-13 00:54:47

by Guo Ren

[permalink] [raw]
Subject: Re: [PATCH 4/4] vgacon, arch/*: remove unused screen_info definitions

csky:
Acked-by: Guo Ren <[email protected]>

On Fri, Jul 7, 2023 at 5:56 AM Arnd Bergmann <[email protected]> wrote:
>
> From: Arnd Bergmann <[email protected]>
>
> A number of architectures either kept the screen_info definition for
> historical purposes as it used to be required by the generic VT code, or
> they copied it from another architecture in order to build the VGA
> console driver in an allmodconfig build.
>
> Now that vgacon no longer builds on these architectures, remove the
> stale definitions.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> arch/csky/kernel/setup.c | 12 ------------
> arch/hexagon/kernel/Makefile | 2 --
> arch/hexagon/kernel/screen_info.c | 3 ---
> arch/nios2/kernel/setup.c | 5 -----
> arch/sh/kernel/setup.c | 5 -----
> arch/sparc/kernel/setup_32.c | 13 -------------
> arch/sparc/kernel/setup_64.c | 13 -------------
> arch/xtensa/kernel/setup.c | 12 ------------
> 8 files changed, 65 deletions(-)
> delete mode 100644 arch/hexagon/kernel/screen_info.c
>
> diff --git a/arch/csky/kernel/setup.c b/arch/csky/kernel/setup.c
> index 106fbf0b6f3b4..51012e90780d6 100644
> --- a/arch/csky/kernel/setup.c
> +++ b/arch/csky/kernel/setup.c
> @@ -8,22 +8,10 @@
> #include <linux/of_fdt.h>
> #include <linux/start_kernel.h>
> #include <linux/dma-map-ops.h>
> -#include <linux/screen_info.h>
> #include <asm/sections.h>
> #include <asm/mmu_context.h>
> #include <asm/pgalloc.h>
>
> -#ifdef CONFIG_DUMMY_CONSOLE
> -struct screen_info screen_info = {
> - .orig_video_lines = 30,
> - .orig_video_cols = 80,
> - .orig_video_mode = 0,
> - .orig_video_ega_bx = 0,
> - .orig_video_isVGA = 1,
> - .orig_video_points = 8
> -};
> -#endif
> -
> static void __init csky_memblock_init(void)
> {
> unsigned long lowmem_size = PFN_DOWN(LOWMEM_LIMIT - PHYS_OFFSET_OFFSET);
> diff --git a/arch/hexagon/kernel/Makefile b/arch/hexagon/kernel/Makefile
> index e73cb321630ec..3fdf937eb572e 100644
> --- a/arch/hexagon/kernel/Makefile
> +++ b/arch/hexagon/kernel/Makefile
> @@ -17,5 +17,3 @@ obj-y += vm_vectors.o
> obj-$(CONFIG_HAS_DMA) += dma.o
>
> obj-$(CONFIG_STACKTRACE) += stacktrace.o
> -
> -obj-$(CONFIG_VGA_CONSOLE) += screen_info.o
> diff --git a/arch/hexagon/kernel/screen_info.c b/arch/hexagon/kernel/screen_info.c
> deleted file mode 100644
> index 1e1ceb18bafe7..0000000000000
> --- a/arch/hexagon/kernel/screen_info.c
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -#include <linux/screen_info.h>
> -
> -struct screen_info screen_info;
> diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c
> index 8582ed9658447..da122a5fa43b2 100644
> --- a/arch/nios2/kernel/setup.c
> +++ b/arch/nios2/kernel/setup.c
> @@ -19,7 +19,6 @@
> #include <linux/memblock.h>
> #include <linux/initrd.h>
> #include <linux/of_fdt.h>
> -#include <linux/screen_info.h>
>
> #include <asm/mmu_context.h>
> #include <asm/sections.h>
> @@ -36,10 +35,6 @@ static struct pt_regs fake_regs = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0,
> 0};
>
> -#ifdef CONFIG_VT
> -struct screen_info screen_info;
> -#endif
> -
> /* Copy a short hook instruction sequence to the exception address */
> static inline void copy_exception_handler(unsigned int addr)
> {
> diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
> index b3da2757faaf3..3d80515298d26 100644
> --- a/arch/sh/kernel/setup.c
> +++ b/arch/sh/kernel/setup.c
> @@ -7,7 +7,6 @@
> * Copyright (C) 1999 Niibe Yutaka
> * Copyright (C) 2002 - 2010 Paul Mundt
> */
> -#include <linux/screen_info.h>
> #include <linux/ioport.h>
> #include <linux/init.h>
> #include <linux/initrd.h>
> @@ -69,10 +68,6 @@ EXPORT_SYMBOL(cpu_data);
> struct sh_machine_vector sh_mv = { .mv_name = "generic", };
> EXPORT_SYMBOL(sh_mv);
>
> -#ifdef CONFIG_VT
> -struct screen_info screen_info;
> -#endif
> -
> extern int root_mountflags;
>
> #define RAMDISK_IMAGE_START_MASK 0x07FF
> diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
> index 34ef7febf0d56..e3b72a7b46d37 100644
> --- a/arch/sparc/kernel/setup_32.c
> +++ b/arch/sparc/kernel/setup_32.c
> @@ -17,7 +17,6 @@
> #include <linux/initrd.h>
> #include <asm/smp.h>
> #include <linux/user.h>
> -#include <linux/screen_info.h>
> #include <linux/delay.h>
> #include <linux/fs.h>
> #include <linux/seq_file.h>
> @@ -51,18 +50,6 @@
>
> #include "kernel.h"
>
> -struct screen_info screen_info = {
> - 0, 0, /* orig-x, orig-y */
> - 0, /* unused */
> - 0, /* orig-video-page */
> - 0, /* orig-video-mode */
> - 128, /* orig-video-cols */
> - 0,0,0, /* ega_ax, ega_bx, ega_cx */
> - 54, /* orig-video-lines */
> - 0, /* orig-video-isVGA */
> - 16 /* orig-video-points */
> -};
> -
> /* Typing sync at the prom prompt calls the function pointed to by
> * romvec->pv_synchook which I set to the following function.
> * This should sync all filesystems and return, for now it just
> diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
> index 6546ca9d4d3f1..6a4797dec34b4 100644
> --- a/arch/sparc/kernel/setup_64.c
> +++ b/arch/sparc/kernel/setup_64.c
> @@ -15,7 +15,6 @@
> #include <linux/ptrace.h>
> #include <asm/smp.h>
> #include <linux/user.h>
> -#include <linux/screen_info.h>
> #include <linux/delay.h>
> #include <linux/fs.h>
> #include <linux/seq_file.h>
> @@ -68,18 +67,6 @@
> DEFINE_SPINLOCK(ns87303_lock);
> EXPORT_SYMBOL(ns87303_lock);
>
> -struct screen_info screen_info = {
> - 0, 0, /* orig-x, orig-y */
> - 0, /* unused */
> - 0, /* orig-video-page */
> - 0, /* orig-video-mode */
> - 128, /* orig-video-cols */
> - 0, 0, 0, /* unused, ega_bx, unused */
> - 54, /* orig-video-lines */
> - 0, /* orig-video-isVGA */
> - 16 /* orig-video-points */
> -};
> -
> static void
> prom_console_write(struct console *con, const char *s, unsigned int n)
> {
> diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
> index aba3ff4e60d85..3f22d0537818d 100644
> --- a/arch/xtensa/kernel/setup.c
> +++ b/arch/xtensa/kernel/setup.c
> @@ -19,7 +19,6 @@
> #include <linux/init.h>
> #include <linux/mm.h>
> #include <linux/proc_fs.h>
> -#include <linux/screen_info.h>
> #include <linux/kernel.h>
> #include <linux/percpu.h>
> #include <linux/reboot.h>
> @@ -49,17 +48,6 @@
> #include <asm/timex.h>
> #include <asm/traps.h>
>
> -#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
> -struct screen_info screen_info = {
> - .orig_x = 0,
> - .orig_y = 24,
> - .orig_video_cols = 80,
> - .orig_video_lines = 24,
> - .orig_video_isVGA = 1,
> - .orig_video_points = 16,
> -};
> -#endif
> -
> #ifdef CONFIG_BLK_DEV_INITRD
> extern unsigned long initrd_start;
> extern unsigned long initrd_end;
> --
> 2.39.2
>


--
Best Regards
Guo Ren

2023-08-01 17:25:47

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH 1/4] vgacon: rework Kconfig dependencies

ping! What's the status of this patchset?

Am 07.07.23 um 11:52 schrieb Arnd Bergmann:
> From: Arnd Bergmann <[email protected]>
>
> The list of dependencies here is phrased as an opt-out, but this is missing
> a lot of architectures that don't actually support VGA consoles, and some
> of the entries are stale:
>
> - powerpc used to support VGA consoles in the old arch/ppc codebase, but
> the merged arch/powerpc never did
>
> - arm lists footbridge, integrator and netwinder, but netwinder is actually
> part of footbridge, and integrator does not appear to have an actual
> VGA hardware, or list it in its ATAG or DT.
>
> - mips has a few platforms (jazz, sibyte, and sni) that initialize
> screen_info, on everything else the console is selected but cannot
> actually work.
>
> - csky, hexgagon, loongarch, nios2, riscv and xtensa are not listed
> in the opt-out table and declare a screen_info to allow building
> vga_con, but this cannot work because the console is never selected.
>
> Replace this with an opt-in table that lists only the platforms that
> remain. This is effectively x86, plus a couple of historic workstation
> and server machines that reused parts of the x86 system architecture.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> drivers/video/console/Kconfig | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
> index a2a88d42edf0c..47c498defc211 100644
> --- a/drivers/video/console/Kconfig
> +++ b/drivers/video/console/Kconfig
> @@ -7,9 +7,9 @@ menu "Console display driver support"
>
> config VGA_CONSOLE
> bool "VGA text console" if EXPERT || !X86
> - depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !SUPERH && \
> - (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \
> - !ARM64 && !ARC && !MICROBLAZE && !OPENRISC && !S390 && !UML
> + depends on ALPHA || IA64 || X86 || \
> + (ARM && ARCH_FOOTBRIDGE) || \
> + (MIPS && (MIPS_MALTA || SIBYTE_BCM112X || SIBYTE_SB1250 || SIBYTE_BCM1x80 || SNI_RM))
> select APERTURE_HELPERS if (DRM || FB || VFIO_PCI_CORE)
> default y
> help

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


Attachments:
OpenPGP_signature (855.00 B)
OpenPGP digital signature

2023-08-01 18:19:52

by Russell King (Oracle)

[permalink] [raw]
Subject: Re: [PATCH 1/4] vgacon: rework Kconfig dependencies

On Fri, Jul 07, 2023 at 11:52:23AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> The list of dependencies here is phrased as an opt-out, but this is missing
> a lot of architectures that don't actually support VGA consoles, and some
> of the entries are stale:
>
> - powerpc used to support VGA consoles in the old arch/ppc codebase, but
> the merged arch/powerpc never did
>
> - arm lists footbridge, integrator and netwinder, but netwinder is actually
> part of footbridge, and integrator does not appear to have an actual
> VGA hardware, or list it in its ATAG or DT.

Integrator/AP has PCI, and I have had PCI VGA cards plugged in to that
hardware when I've had it.

Provided any platform sets up PCI in a compatible way, and can run the
VGA's BIOS to initialise the card, then vgacon is supportable.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

2023-08-04 21:11:43

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 1/4] vgacon: rework Kconfig dependencies

On Tue, Aug 1, 2023, at 19:05, Russell King (Oracle) wrote:
> On Fri, Jul 07, 2023 at 11:52:23AM +0200, Arnd Bergmann wrote:
>> From: Arnd Bergmann <[email protected]>
>>
>> The list of dependencies here is phrased as an opt-out, but this is missing
>> a lot of architectures that don't actually support VGA consoles, and some
>> of the entries are stale:
>>
>> - powerpc used to support VGA consoles in the old arch/ppc codebase, but
>> the merged arch/powerpc never did
>>
>> - arm lists footbridge, integrator and netwinder, but netwinder is actually
>> part of footbridge, and integrator does not appear to have an actual
>> VGA hardware, or list it in its ATAG or DT.
>
> Integrator/AP has PCI, and I have had PCI VGA cards plugged in to that
> hardware when I've had it.

I'm pretty sure it can no longer work and broke a while ago,
so I would prefer to leave it out unless someone actually has
a reason to use it and puts the work in to restore the support.
From what I can tell, it's broken in at least three ways with
the new PCI host driver:

- the PCI memory space is identity mapped to its CPU physical
address as of d3721efce22d1 ("ARM: dts: integratorap: Fix
PCI windows"), which is generally better for compatibility
with broken drivers that read the BAR directly, but it
prevents memory mapped ISA-style devices including VGA text
buffer.

- vga_base is no longer set by the new PCI host driver, so
any accesses to the text buffer just end up in user space
memory at (__iomem*)0xb8000

- there is no DT binding for setting the global screen_info
to whatever the boot firmware has initialized
the VGA BIOS to, and the default 80x30 on Arm does not match
the typical 80x25 text that would be set by the BIOS.

> Provided any platform sets up PCI in a compatible way, and can run the
> VGA's BIOS to initialise the card, then vgacon is supportable.

It looks like only footbridge does at this point, all the other
platforms would need to fix at least some of the three things I
mentioned above, in particular plat-orion is the only thing
setting vga_base but also has the identity map issue.

My impression is that nobody has cared about vgacon on most
Arm systems since it's harder to get working than fbcon with
a native PCI driver (or the built-in pl110 on integrator) but
also less useful.

Arnd