dummycon: limit Arm console size hack to footbridge
authorArnd Bergmann <arnd@arndb.de>
Mon, 9 Oct 2023 21:18:39 +0000 (23:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Oct 2023 08:17:02 +0000 (10:17 +0200)
The dummycon default console size used to be determined by architecture,
but now this is a Kconfig setting on everything except ARM. Tracing this
back in the historic git trees, this was used to match the size of VGA
console or VGA framebuffer on early machines, but nowadays that code is
no longer used, except probably on the old footbridge/netwinder since
that is the only one that supports vgacon.

On machines with a framebuffer, booting with DT so far results in always
using the hardcoded 80x30 size in dummycon, while on ATAGS the setting
can come from a bootloader specific override. Both seem to be worse
choices than the Kconfig setting, since the actual text size for fbcon
also depends on the selected font.

Make this work the same way as everywhere else and use the normal
Kconfig setting, except for the footbridge with vgacon, which keeps
using the traditional code. If vgacon is disabled, footbridge can
also ignore the setting. This means the screen_info only has to be
provided when either vgacon or EFI are enabled now.

To limit the amount of surprises on Arm, change the Kconfig default
to the previously used 80x30 setting instead of the usual 80x25.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Helge Deller <deller@gmx.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20231009211845.3136536-4-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kernel/atags_parse.c
arch/arm/kernel/setup.c
drivers/video/console/Kconfig
drivers/video/console/dummycon.c

index 33f6eb5213a5a8c9aabbd2a5c3f20188e2144e32..4c815da3b77b0679a88b84c8109f62b64b9ebc76 100644 (file)
@@ -69,7 +69,7 @@ static int __init parse_tag_mem32(const struct tag *tag)
 
 __tagtable(ATAG_MEM, parse_tag_mem32);
 
-#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
+#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;
index c66b560562b301b0705163dfd201ee1e2cfbaa4c..40326a35a179bc6fd91bf82fb2d1fbf895e6a1a6 100644 (file)
@@ -928,8 +928,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
                request_resource(&ioport_resource, &lp2);
 }
 
-#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) || \
-    defined(CONFIG_EFI)
+#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_EFI)
 struct screen_info screen_info = {
  .orig_video_lines     = 30,
  .orig_video_cols      = 80,
index cbf303d76d39ba87ff088131a14ef608867f7ecb..83c2d7329ca58831f0153417a332383b0c6cf081 100644 (file)
@@ -52,7 +52,7 @@ config DUMMY_CONSOLE
 
 config DUMMY_CONSOLE_COLUMNS
        int "Initial number of console screen columns"
-       depends on DUMMY_CONSOLE && !ARM
+       depends on DUMMY_CONSOLE && !ARCH_FOOTBRIDGE
        default 160 if PARISC
        default 80
        help
@@ -62,8 +62,9 @@ config DUMMY_CONSOLE_COLUMNS
 
 config DUMMY_CONSOLE_ROWS
        int "Initial number of console screen rows"
-       depends on DUMMY_CONSOLE && !ARM
+       depends on DUMMY_CONSOLE && !ARCH_FOOTBRIDGE
        default 64 if PARISC
+       default 30 if ARM
        default 25
        help
          On PA-RISC, the default value is 64, which should fit a 1280x1024
index f1711b2f9ff057449bccbb923ff4812c5b67a75d..70549fecee12ceccf39c8e5cc23be3890a61cef7 100644 (file)
@@ -18,7 +18,7 @@
  *  Dummy console driver
  */
 
-#if defined(__arm__)
+#if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_VGA_CONSOLE)
 #define DUMMY_COLUMNS  screen_info.orig_video_cols
 #define DUMMY_ROWS     screen_info.orig_video_lines
 #else