Skip to content

Commit a78835b

Browse files
superm1bjorn-helgaas
authored andcommitted
PCI/VGA: Select SCREEN_INFO on X86
commit 337bf13 ("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 a conditional select for SCREEN_INFO to ensure that the VGA arbiter works as intended. Fixes: 337bf13 ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check") Reported-by: Eric Biggers <ebiggers@kernel.org> Closes: https://lore.kernel.org/linux-pci/20251012182302.GA3412@sol/ Suggested-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Eric Biggers <ebiggers@kernel.org> Link: https://patch.msgid.link/20251013220829.1536292-1-superm1@kernel.org
1 parent e433110 commit a78835b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

drivers/pci/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ config VGA_ARB
306306
bool "VGA Arbitration" if EXPERT
307307
default y
308308
depends on (PCI && !S390)
309+
select SCREEN_INFO if X86
309310
help
310311
Some "legacy" VGA devices implemented on PCI typically have the same
311312
hard-decoded addresses as they did on ISA. When multiple PCI devices

drivers/pci/vgaarb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,8 @@ EXPORT_SYMBOL(vga_put);
556556

557557
static bool vga_is_firmware_default(struct pci_dev *pdev)
558558
{
559-
#ifdef CONFIG_SCREEN_INFO
560-
struct screen_info *si = &screen_info;
561-
562-
return pdev == screen_info_pci_dev(si);
559+
#if defined CONFIG_X86
560+
return pdev == screen_info_pci_dev(&screen_info);
563561
#else
564562
return false;
565563
#endif

0 commit comments

Comments
 (0)