PCI/VGA: Select SCREEN_INFO on X86
PATCH v3 1/1 PCI/VGA: Select SCREEN_INFO on X86
commit 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check") introduced an implicit dependency upon SCREEN_INFO by removing the open coded implementation.
If a user didn't have CONFIG_SCREEN_INFO set vga_is_firmware_default() would now return false. SCREEN_INFO is only used on X86 so add add a conditional select for SCREEN_INFO to ensure that the VGA arbiter works as intended.
--- drivers/pci/Kconfig | 1 + drivers/pci/vgaarb.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/pci/Kconfig +1 -0
@@ -306,6 +306,7 @@ config VGA_ARB bool "VGA Arbitration" if EXPERT default y depends on (PCI && !S390) + select SCREEN_INFO if X86 help Some "legacy" VGA devices implemented on PCI typically have the same hard-decoded addresses as they did on ISA. When multiple PCI devices
drivers/pci/vgaarb.c +2 -4
@@ -556,10 +556,8 @@ EXPORT_SYMBOL(vga_put);static bool vga_is_firmware_default (struct pci_dev *pdev) { -#ifdef CONFIG_SCREEN_INFO -struct screen_info *si = &screen_info; - -return pdev ==screen_info_pci_dev (si); +#if definedCONFIG_X86 +return pdev ==screen_info_pci_dev (&screen_info);#else return false;#endif
Signature · 1 line
2.43.0
Quoted 9 lines · Mario Limonciello (AMD)
commit
337bf13aa9dda("PCI/VGA: Replacevga_is_firmware_default()with a screen info check") introduced an implicit dependency uponSCREEN_INFOby removing the open coded implementation.If a user didn't have
CONFIG_SCREEN_INFOsetvga_is_firmware_default()would now return false.SCREEN_INFOis only used on X86 so add add a conditional select forSCREEN_INFOto ensure that the VGA arbiter works as intended.
Quoted 7 lines
Reported-by Eric Biggers <[email protected]>Suggested-by Thomas Zimmermann <[email protected]>Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")Reviewed-by Thomas Zimmermann <[email protected]>Reviewed-by Ilpo Järvinen <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>
- Eric
Am 14.10.25 um 00:08 schrieb Mario Limonciello (AMD):
Quoted 26 lines
commit
337bf13aa9dda("PCI/VGA: Replacevga_is_firmware_default()with a screen info check") introduced an implicit dependency uponSCREEN_INFOby removing the open coded implementation.If a user didn't have
CONFIG_SCREEN_INFOsetvga_is_firmware_default()would now return false.SCREEN_INFOis only used on X86 so add add a conditional select forSCREEN_INFOto ensure that the VGA arbiter works as intended.Reported-by Eric Biggers <[email protected]>Suggested-by Thomas Zimmermann <[email protected]>Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")Reviewed-by Thomas Zimmermann <[email protected]>Reviewed-by Ilpo Järvinen <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>--- drivers/pci/Kconfig | 1 + drivers/pci/vgaarb.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-)drivers/pci/Kconfig +0
-0
drivers/pci/Kconfig config VGA_ARB · line 309
Quoted 4 lines
drivers/pci/Kconfig +1
-0@@ -306,6 +306,7 @@ config VGA_ARB bool "VGA Arbitration" if EXPERT default y depends on (PCI && !S390) + select SCREEN_INFO if X86
On x86 screen_info comes from [1]. On other systems it's at [2].
You can try selecting CONFIG_SYSFB instead, but that will likely run into trouble with CONFIG_EFI=n.
[1] https://elixir.bootlin.com/linux/v6.17.1/source/arch/x86/kernel/setup.c#L214
[2] https://elixir.bootlin.com/linux/v6.17.1/source/drivers/firmware/efi/efi-init.c#L63
I guess, the current patch should work for the use case. I'll keep in mind to make the screen_info state easier to select.
Best regards
Thomas
Quoted 20 lines
drivers/pci/Kconfig +0
-0help Some "legacy" VGA devices implemented on PCI typically have the same hard-decoded addresses as they did on ISA. When multiple PCI devicesdrivers/pci/vgaarb.c +2
-4@@ -556,10 +556,8 @@ EXPORT_SYMBOL(vga_put);static bool vga_is_firmware_default (struct pci_dev *pdev) { -#ifdef CONFIG_SCREEN_INFO -struct screen_info *si = &screen_info; - -return pdev ==screen_info_pci_dev (si); +#if definedCONFIG_X86 +return pdev ==screen_info_pci_dev (&screen_info);#else return false;#endif
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 36 lines · Thomas Zimmermann
Am 14.10.25 um 00:08 schrieb Mario Limonciello (AMD):
Quoted 26 lines
commit
337bf13aa9dda("PCI/VGA: Replacevga_is_firmware_default()with a screen info check") introduced an implicit dependency uponSCREEN_INFOby removing the open coded implementation.If a user didn't have
CONFIG_SCREEN_INFOsetvga_is_firmware_default()would now return false.SCREEN_INFOis only used on X86 so add add a conditional select forSCREEN_INFOto ensure that the VGA arbiter works as intended.Reported-by Eric Biggers <[email protected]>Suggested-by Thomas Zimmermann <[email protected]>Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")Reviewed-by Thomas Zimmermann <[email protected]>Reviewed-by Ilpo Järvinen <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>---
drivers/pci/Kconfig | 1 +
drivers/pci/vgaarb.c| 6 ++----2 files changed, 3 insertions(+), 4 deletions(-)drivers/pci/Kconfig +0
-0@@ -306,6 +306,7 @@ config VGA_ARBQuoted 4 lines
bool "VGA Arbitration" if EXPERT
default y
depends on (PCI && !S390)
+ selectSCREEN_INFOif X86On x86
screen_infocomes from [1]. On other systems it's at [2].
Quoted 7 lines
You can try selecting
CONFIG_SYSFBinstead, but that will likely run into trouble withCONFIG_EFI=n.[1] https://elixir.bootlin.com/linux/v6.17.1/source/arch/x86/kernel/ setup.c#L214
[2] https://elixir.bootlin.com/linux/v6.17.1/source/drivers/firmware/ efi/efi-init.c#L63I guess, the current patch should work for the use case. I'll keep in mind to make the
screen_infostate easier to select.
Yeah I noticed these when I was putting this together and when I compared the pre-337bf13aa9dda code I decided KISS is the better approach, especially to fix the 6.18 regression.
Quoted 23 lines
Best regards
ThomasQuoted 19 lines
help
Some "legacy" VGA devices implemented on PCI typically have the same hard-decoded addresses as they did on ISA. When multiple PCI devicesdrivers/pci/vgaarb.c +2
-4@@ -556,10 +556,8 @@ EXPORT_SYMBOL(vga_put); static bool vga_is_firmware_default(struct pci_dev *pdev) { -#ifdef CONFIG_SCREEN_INFO - struct screen_info *si = &screen_info; - - return pdev == screen_info_pci_dev(si); +#if definedCONFIG_X86 + return pdev == screen_info_pci_dev(&screen_info); #else return false; #endif
Bjorn Helgaas
AppliedQuoted 9 lines · Mario Limonciello (AMD)
commit
337bf13aa9dda("PCI/VGA: Replacevga_is_firmware_default()with a screen info check") introduced an implicit dependency uponSCREEN_INFOby removing the open coded implementation.If a user didn't have
CONFIG_SCREEN_INFOsetvga_is_firmware_default()would now return false.SCREEN_INFOis only used on X86 so add add a conditional select forSCREEN_INFOto ensure that the VGA arbiter works as intended.
Quoted 7 lines
Reported-by Eric Biggers <[email protected]>Suggested-by Thomas Zimmermann <[email protected]>Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")Reviewed-by Thomas Zimmermann <[email protected]>Reviewed-by Ilpo Järvinen <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>
Applied to pci/for-linus for v6.18, thanks!
Quoted 37 lines
--- drivers/pci/Kconfig | 1 + drivers/pci/vgaarb.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-)drivers/pci/Kconfig +1
-0@@ -306,6 +306,7 @@ config VGA_ARB bool "VGA Arbitration" if EXPERT default y depends on (PCI && !S390) + select SCREEN_INFO if X86 help Some "legacy" VGA devices implemented on PCI typically have the same hard-decoded addresses as they did on ISA. When multiple PCI devicesdrivers/pci/vgaarb.c +2
-4@@ -556,10 +556,8 @@ EXPORT_SYMBOL(vga_put);static bool vga_is_firmware_default (struct pci_dev *pdev) { -#ifdef CONFIG_SCREEN_INFO -struct screen_info *si = &screen_info; - -return pdev ==screen_info_pci_dev (si); +#if definedCONFIG_X86 +return pdev ==screen_info_pci_dev (&screen_info);#else return false;#endif Signature · 1 line
2.43.0