dummycon: only build module if there are users
Subsystems (2)
PATCH 1/3 dummycon: only build module if there are users
From: Arnd Bergmann <[email protected]>
Dummycon is used as a fallback conswitchp for vgacon and fbcon in the VT code, and there are no references to it if all three are disabled, so just leave it out of the kernel image for configurations without those.
--- drivers/video/console/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/video/console/Kconfig +1 -2
@@ -47,8 +47,7 @@ config SGI_NEWPORT_CONSOLE card of your Indy. Most people say Y here. config DUMMY_CONSOLE - bool - default y + def_bool VT || VGA_CONSOLE || FRAMEBUFFER_CONSOLE config DUMMY_CONSOLE_COLUMNS int "Initial number of console screen columns"
Signature · 1 line
2.39.5
PATCH 2/3 dummycon: fix default rows/cols
From: Arnd Bergmann <[email protected]>
dummycon fails to build on ARM/footbridge when the VGA console is disabled, since I got the dependencies slightly wrong in a previous patch:
drivers/video/console/dummycon.c: In function 'dummycon_init':drivers/video/console/dummycon.c:27:25: error: 'CONFIG_DUMMY_CONSOLE_COLUMNS' undeclared (first use in this function); did you mean 'CONFIG_DUMMY_CONSOLE'?
27 | #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNSdrivers/video/console/dummycon.c:28:25: error: 'CONFIG_DUMMY_CONSOLE_ROWS' undeclared (first use in this function); did you mean 'CONFIG_DUMMY_CONSOLE'?
28 | #define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS
This only showed up after many thousand randconfig builds on Arm, and doesn't matter in practice, but should still be fixed. Address it by using the default row/columns on footbridge after all in that corner case.
--- drivers/video/console/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/console/Kconfig +2 -2
@@ -51,7 +51,7 @@ config DUMMY_CONSOLE config DUMMY_CONSOLE_COLUMNS int "Initial number of console screen columns" - depends on DUMMY_CONSOLE && !ARCH_FOOTBRIDGE + depends on DUMMY_CONSOLE && !(ARCH_FOOTBRIDGE && VGA_CONSOLE) default 160 if PARISC default 80 help
@@ -61,7 +61,7 @@ config DUMMY_CONSOLE_COLUMNS config DUMMY_CONSOLE_ROWS int "Initial number of console screen rows" - depends on DUMMY_CONSOLE && !ARCH_FOOTBRIDGE + depends on DUMMY_CONSOLE && !(ARCH_FOOTBRIDGE && VGA_CONSOLE) default 64 if PARISC default 30 if ARM default 25
Signature · 1 line
2.39.5
PATCH 3/3 mdacon: rework dependency list
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
mdacon has roughly the same dependencies as vgacon but expresses them as a negative list instead of a positive list, with the only practical difference being PowerPC/CHRP, which uses vga16fb instead of vgacon.
The CONFIG_MDA_CONSOLE description advises to only turn it on when vgacon is also used because MDA/Hercules-only systems should be using vgacon instead, so just change the list to enforce that directly for simplicity.
The probing was broken from 2002 to 2008, this improves on the fix that was added then: If vgacon is a loadable module, then mdacon cannot be built-in now, and the list of systems that support vgacon is carried over.
---
I have no idea when the last time was that someone actually tried using dualhead vgacon/mdacon with two ISA cards, or if it still works. We may be better off removing the driver altogether, but I don't see anything immediately wrong it with it.
--- drivers/video/console/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/console/Kconfig +1 -1
@@ -24,7 +24,7 @@ config VGA_CONSOLE Say Y. config MDA_CONSOLE - depends on !M68K && !PARISC && ISA + depends on VGA_CONSOLE && ISA tristate "MDA text console (dual-headed)" help Say Y here if you have an old MDA or monochrome Hercules graphics
Signature · 1 line
2.39.5
Hi Arnd
Am 25.02.25 um 17:44 schrieb Arnd Bergmann:
Quoted 17 lines
From: Arnd Bergmann <[email protected]>
Dummycon is used as a fallback conswitchp for vgacon and fbcon in the VT code, and there are no references to it if all three are disabled, so just leave it out of the kernel image for configurations without those.
Signed-off-by Arnd Bergmann <[email protected]>--- drivers/video/console/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/video/console/Kconfig +0
-0
drivers/video/console/Kconfig config SGI_NEWPORT_CONSOLE · line 50
Quoted 6 lines
drivers/video/console/Kconfig +1
-2@@ -47,8 +47,7 @@ config SGI_NEWPORT_CONSOLE card of your Indy. Most people say Y here. config DUMMY_CONSOLE - bool - default y + def_bool VT || VGA_CONSOLE || FRAMEBUFFER_CONSOLE
What about MDA_CONSOLE and STI_CONSOLE. Don't they require this as fallback?
Best regards
Thomas
Quoted 3 lines
drivers/video/console/Kconfig +0
-0config DUMMY_CONSOLE_COLUMNS int "Initial number of console screen columns"
Signature · 7 lines
-- 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)
Thomas Zimmermann
Reviewed-byAm 26.02.25 um 08:48 schrieb Thomas Zimmermann:
Quoted 11 lines
Hi Arnd
Am 25.02.25 um 17:44 schrieb Arnd Bergmann:
Quoted 8 lines
From: Arnd Bergmann <[email protected]>
Dummycon is used as a fallback conswitchp for vgacon and fbcon in the VT code, and there are no references to it if all three are disabled, so just leave it out of the kernel image for configurations without those.
Signed-off-by Arnd Bergmann <[email protected]>
Quoted 4 lines
Quoted 4 lines
---
drivers/video/console/Kconfig| 3 +--1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 12 lines
Quoted 10 lines
drivers/video/console/Kconfig +0
-0@@ -47,8 +47,7 @@ config SGI_NEWPORT_CONSOLEcard of your Indy. Most people say Y here. config
DUMMY_CONSOLE
- bool
- default y
+def_boolVT ||VGA_CONSOLE||FRAMEBUFFER_CONSOLEWhat about
MDA_CONSOLEandSTI_CONSOLE. Don't they require this as fallback?
I did some grepping in the kernel sources and found the answer to this question. It's still surprising that the other consoles don't use dummycon. They are never unloaded, it seems.
Best regards
Thomas
Quoted 7 lines
Best regards
ThomasQuoted 2 lines
config
DUMMY_CONSOLE_COLUMNS
int "Initial number of console screen columns"
Signature · 7 lines
-- 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)
Re: [PATCH 2/3] dummycon: fix default rows/cols
In reply to Arnd BergmannAm 25.02.25 um 17:44 schrieb Arnd Bergmann:
Quoted 17 lines
From: Arnd Bergmann <[email protected]>
dummycon fails to build on ARM/footbridge when the VGA console is disabled, since I got the dependencies slightly wrong in a previous patch:
drivers/video/console/dummycon.c: In function 'dummycon_init':drivers/video/console/dummycon.c:27:25: error: 'CONFIG_DUMMY_CONSOLE_COLUMNS' undeclared (first use in this function); did you mean 'CONFIG_DUMMY_CONSOLE'?
27 | #defineDUMMY_COLUMNSCONFIG_DUMMY_CONSOLE_COLUMNSdrivers/video/console/dummycon.c:28:25: error: 'CONFIG_DUMMY_CONSOLE_ROWS' undeclared (first use in this function); did you mean 'CONFIG_DUMMY_CONSOLE'?
28 | #defineDUMMY_ROWSCONFIG_DUMMY_CONSOLE_ROWSThis only showed up after many thousand randconfig builds on Arm, and doesn't matter in practice, but should still be fixed. Address it by using the default row/columns on footbridge after all in that corner case.
Quoted 4 lines
Fixes 4293b0925149 ("dummycon: limit Arm console size hack to footbridge")Reported-by kernel test robot <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Quoted 26 lines
--- drivers/video/console/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/video/console/Kconfig +2
-2@@ -51,7 +51,7 @@ config DUMMY_CONSOLE config DUMMY_CONSOLE_COLUMNS int "Initial number of console screen columns" - depends on DUMMY_CONSOLE && !ARCH_FOOTBRIDGE + depends on DUMMY_CONSOLE && !(ARCH_FOOTBRIDGE && VGA_CONSOLE) default 160 if PARISC default 80 help@@ -61,7 +61,7 @@ config DUMMY_CONSOLE_COLUMNS config DUMMY_CONSOLE_ROWS int "Initial number of console screen rows" - depends on DUMMY_CONSOLE && !ARCH_FOOTBRIDGE + depends on DUMMY_CONSOLE && !(ARCH_FOOTBRIDGE && VGA_CONSOLE) default 64 if PARISC default 30 if ARM default 25
Signature · 7 lines
-- 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)
Quoted 20 lines · Thomas Zimmermann
Am 25.02.25 um 17:44 schrieb Arnd Bergmann:
Quoted 19 lines
From: Arnd Bergmann <[email protected]>
Dummycon is used as a fallback conswitchp for vgacon and fbcon in the VT code, and there are no references to it if all three are disabled, so just leave it out of the kernel image for configurations without those.
Signed-off-by Arnd Bergmann <[email protected]>--- drivers/video/console/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/video/console/Kconfig +0
-0@@ -47,8 +47,7 @@ config SGI_NEWPORT_CONSOLE card of your Indy. Most people say Y here.
Quoted 7 lines
drivers/video/console/Kconfig config SGI_NEWPORT_CONSOLE · line 50
Quoted 4 lines
drivers/video/console/Kconfig +1
-2config DUMMY_CONSOLE - bool - default y + def_bool VT || VGA_CONSOLE || FRAMEBUFFER_CONSOLEWhat about
MDA_CONSOLEandSTI_CONSOLE. Don't they require this as fallback?
MDA_CONSOLE clearly does not, because that is only the second console when VGA_CONSOLE is the main one.
For sti_console, I don't see how it would do use it: when CONFIG_VT is enabled, the line above turns on DUMMY_CONSOLE, but without CONFIG_VT there seems to be no reference to it after 58a5c67aadde ("parisc/sticon: Always register sticon console driver"). I also see that CONFIG_STI_CONSOLE is a 'bool' symbol, so there is no dynamic loading/unloading of the driver.
Arnd
Re: [PATCH 3/3] mdacon: rework dependency list
In reply to Arnd BergmannAm 25.02.25 um 17:44 schrieb Arnd Bergmann:
Quoted 10 lines
From: Arnd Bergmann <[email protected]>
mdacon has roughly the same dependencies as vgacon but expresses them as a negative list instead of a positive list, with the only practical difference being PowerPC/CHRP, which uses vga16fb instead of vgacon.
The
CONFIG_MDA_CONSOLEdescription advises to only turn it on when vgacon is also used because MDA/Hercules-only systems should be using vgacon instead, so just change the list to enforce that directly for simplicity.
Quoted 7 lines
The probing was broken from 2002 to 2008, this improves on the fix that was added then: If vgacon is a loadable module, then mdacon cannot be built-in now, and the list of systems that support vgacon is carried over.
Fixes 0b9cf3aa6b1e ("mdacon messing up default vc's - set default to vc13-16 again")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 22 lines
---
I have no idea when the last time was that someone actually tried using dualhead vgacon/mdacon with two ISA cards, or if it still works. We may be better off removing the driver altogether, but I don't see anything immediately wrong it with it.--- drivers/video/console/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/video/console/Kconfig +1
-1@@ -24,7 +24,7 @@ config VGA_CONSOLE Say Y. config MDA_CONSOLE - depends on !M68K && !PARISC && ISA + depends on VGA_CONSOLE && ISA tristate "MDA text console (dual-headed)" help Say Y here if you have an old MDA or monochrome Hercules graphics
Signature · 7 lines
-- 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)
Hi
Am 26.02.25 um 08:55 schrieb Arnd Bergmann:
Quoted 30 lines · Thomas Zimmermann
Quoted 20 lines
Am 25.02.25 um 17:44 schrieb Arnd Bergmann:
Quoted 19 lines
From: Arnd Bergmann <[email protected]>
Dummycon is used as a fallback conswitchp for vgacon and fbcon in the VT code, and there are no references to it if all three are disabled, so just leave it out of the kernel image for configurations without those.
Signed-off-by Arnd Bergmann <[email protected]>--- drivers/video/console/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/video/console/Kconfig +0
-0@@ -47,8 +47,7 @@ config SGI_NEWPORT_CONSOLE card of your Indy. Most people say Y here.Quoted 6 lines
drivers/video/console/Kconfig config SGI_NEWPORT_CONSOLE · line 50
Quoted 4 lines
drivers/video/console/Kconfig +1
-2config DUMMY_CONSOLE - bool - default y + def_bool VT || VGA_CONSOLE || FRAMEBUFFER_CONSOLEWhat about
MDA_CONSOLEandSTI_CONSOLE. Don't they require this as fallback?
MDA_CONSOLEclearly does not, because that is only the second console whenVGA_CONSOLEis the main one.
Quoted 6 lines
For
sti_console, I don't see how it would do use it: whenCONFIG_VTis enabled, the line above turns onDUMMY_CONSOLE, but withoutCONFIG_VTthere seems to be no reference to it after58a5c67aadde("parisc/sticon: Always register sticon console driver"). I also see thatCONFIG_STI_CONSOLEis a 'bool' symbol, so there is no dynamic loading/unloading of the driver.
Thanks.
Here's another general question. vgacon and fbcon only seem usable with CONFIG_VT=y. Wouldn't it make sense to have them depend on CONFIG_VT=y? dummycon could then be implemented as part of the vt code, maybe even become a vt-internal thing. The console code is complex, so I'm probably missing something here?
Best regards
Thomas
Quoted 2 lines
Arnd
Signature · 7 lines
-- 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)
Quoted 6 lines · Thomas Zimmermann
Am 26.02.25 um 08:55 schrieb Arnd Bergmann:
Here's another general question. vgacon and fbcon only seem usable withCONFIG_VT=y. Wouldn't it make sense to have them depend onCONFIG_VT=y? dummycon could then be implemented as part of the vt code, maybe even become a vt-internal thing. The console code is complex, so I'm probably missing something here?
I think in theory one may have a system use fbcon purely to get the boot logo, but not actually support VT. I had also assumed there might be a way to use fbcon as the console (i.e. printk) but not register the tty, but it looks like the console code still requires vt.
After I looked at the vt and conswitchp code some more, I wonder if we could go the other way and instead of integrating it more make the conswitchp logic optional: most of the complexity here deals with switching between text console and fbcon dynamically, but having any text console support is getting very rare (vga on alpha/mips/x86-32, newport on mips-ip22, sti on parisc).
If we do this, the conswitchp code could be merged with dummycon in drivers/video/console, with the simpler alternative just calling into fbcon functions. I'm not sure if we can already drop vgacon from normal x86-64 distro configs, i.e. if there are cases that are not already covered by any of efi-earlycon, efifb, vga16fb, vesafb/uvesafb or a PCI DRM driver.
Arnd
"Arnd Bergmann" <[email protected]> writes:
Hello Arnd,
Quoted 13 lines · Thomas Zimmermann
Quoted 6 lines
Am 26.02.25 um 08:55 schrieb Arnd Bergmann:
Here's another general question. vgacon and fbcon only seem usable withCONFIG_VT=y. Wouldn't it make sense to have them depend onCONFIG_VT=y? dummycon could then be implemented as part of the vt code, maybe even become a vt-internal thing. The console code is complex, so I'm probably missing something here?I think in theory one may have a system use fbcon purely to get the boot logo, but not actually support VT. I had also assumed there might be a way to use fbcon as the console (i.e. printk) but not register the tty, but it looks like the console code still requires vt.
Quoted 8 lines
After I looked at the vt and conswitchp code some more, I wonder if we could go the other way and instead of integrating it more make the conswitchp logic optional: most of the complexity here deals with switching between text console and fbcon dynamically, but having any text console support is getting very rare (vga on alpha/mips/x86-32, newport on mips-ip22, sti on parisc).
If we do this, the conswitchp code could be merged with dummycon
This sounds like a much better approach indeed.
Quoted 6 lines
in
drivers/video/console, with the simpler alternative just calling into fbcon functions. I'm not sure if we can already drop vgacon from normal x86-64 distro configs, i.e. if there are cases that are not already covered by any of efi-earlycon, efifb, vga16fb, vesafb/uvesafb or a PCI DRM driver.
I believe vgacon is still useful for x86 with legacy BIOS, because vesafb (and simpledrm) only works if the user defines a mode using the vga= kernel cmdline parameter.
Quoted 2 lines
Arnd
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
Quoted 11 lines · Javier Martinez Canillas
Quoted 6 lines · Arnd Bergmann
in
drivers/video/console, with the simpler alternative just calling into fbcon functions. I'm not sure if we can already drop vgacon from normal x86-64 distro configs, i.e. if there are cases that are not already covered by any of efi-earlycon, efifb, vga16fb, vesafb/uvesafb or a PCI DRM driver.I believe vgacon is still useful for x86 with legacy BIOS, because vesafb (and simpledrm) only works if the user defines a mode using the vga= kernel cmdline parameter.
Right, at the minimum, a configuration without vgacon would have to pick a graphical mode in arch/x86/boot/video*.c if one wasn't already set by grub.
Looking through the git history of that code, it seems that there are lots of corner cases with weird 32-bit hardware. Anything from the past 20 years is probably reasonably safe, but there still needs to be a way to configure vgacon back in to be safe.
Arnd
Helge Deller
maintainerQuoted 13 lines · Arnd Bergmann
Quoted 6 lines · Thomas Zimmermann
Am 26.02.25 um 08:55 schrieb Arnd Bergmann:
Here's another general question. vgacon and fbcon only seem usable withCONFIG_VT=y. Wouldn't it make sense to have them depend onCONFIG_VT=y? dummycon could then be implemented as part of the vt code, maybe even become a vt-internal thing. The console code is complex, so I'm probably missing something here?I think in theory one may have a system use fbcon purely to get the boot logo, but not actually support VT. I had also assumed there might be a way to use fbcon as the console (i.e. printk) but not register the tty, but it looks like the console code still requires vt.
Quoted 6 lines
After I looked at the vt and conswitchp code some more, I wonder if we could go the other way and instead of integrating it more make the conswitchp logic optional: most of the complexity here deals with switching between text console and fbcon dynamically, but having any text console support is getting very rare (vga on alpha/mips/x86-32, newport on mips-ip22, sti on parisc).
Yes, it's rare. But on parisc, if no supported fbdev or drm graphic card is found, it needs to stays on sticon (which always works). Otherwise - if a card was found - the kernel switches dynamically to fbcon.
Quoted 3 lines
If we do this, the conswitchp code could be merged with dummycon in
drivers/video/console, with the simpler alternative just calling into fbcon functions.
As mentioned above, that should be optional then.
Quoted 4 lines
I'm not sure if we can already drop
vgacon from normal x86-64 distro configs, i.e. if there are cases that are not already covered by any of efi-earlycon, efifb, vga16fb, vesafb/uvesafb or a PCI DRM driver.
Helge
Hi
Am 26.02.25 um 12:46 schrieb Arnd Bergmann:
Quoted 19 lines · Thomas Zimmermann
Quoted 6 lines
Am 26.02.25 um 08:55 schrieb Arnd Bergmann:
Here's another general question. vgacon and fbcon only seem usable withCONFIG_VT=y. Wouldn't it make sense to have them depend onCONFIG_VT=y? dummycon could then be implemented as part of the vt code, maybe even become a vt-internal thing. The console code is complex, so I'm probably missing something here?I think in theory one may have a system use fbcon purely to get the boot logo, but not actually support VT. I had also assumed there might be a way to use fbcon as the console (i.e. printk) but not register the tty, but it looks like the console code still requires vt.
After I looked at the vt and conswitchp code some more, I wonder if we could go the other way and instead of integrating it more make the conswitchp logic optional: most of the complexity here deals with switching between text console and fbcon dynamically, but having any text console support is getting very rare (vga on alpha/mips/x86-32, newport on mips-ip22, sti on parisc).
Quoted 6 lines
If we do this, the conswitchp code could be merged with dummycon in
drivers/video/console, with the simpler alternative just calling into fbcon functions. I'm not sure if we can already drop vgacon from normal x86-64 distro configs, i.e. if there are cases that are not already covered by any of efi-earlycon, efifb, vga16fb, vesafb/uvesafb or a PCI DRM driver.
Thanks for the lengthy answer. I don't want to add work to your todo list. For vgacon, I wouldn't remove it yet, as there still exisits x86_64 systems with plain VGA support.
Best regards
Thomas
Quoted 3 lines
Arnd
Signature · 7 lines
-- 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)
Helge Deller
maintainerQuoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Dummycon is used as a fallback conswitchp for vgacon and fbcon in the VT code, and there are no references to it if all three are disabled, so just leave it out of the kernel image for configurations without those.
Signed-off-by Arnd Bergmann <[email protected]>--- drivers/video/console/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
whole series applied to fbdev git tree.
Thanks!
Helge