Skip to contentSkip to conversation

PCI/VGA: Select SCREEN_INFO

PATCH Applied Mario Limonciello (AMD) 4 participants 6 messages Oct 13, 2025 PCI

v2 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PCI/VGA: Select SCREEN_INFO

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. Add a select for SCREEN_INFO to ensure that the VGA arbiter works as intended. Also drop the now dead code.

Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")

---
v2:
* drop dead code (Ilpo)

---
 drivers/pci/Kconfig  | 1 +
 drivers/pci/vgaarb.c | 8 +-------
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/pci/Kconfig +1 -0
index 7065a8e5f9b14..c35fed47addd5 100644
@@ -306,6 +306,7 @@ config VGA_ARB
 	bool "VGA Arbitration" if EXPERT
 	default y
 	depends on (PCI && !S390)
+	select SCREEN_INFO
 	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 +1 -7
index b58f94ee48916..8c8c420ff5b55 100644
@@ -556,13 +556,7 @@ 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);
-#else
-	return false;
-#endif
+	return pdev == screen_info_pci_dev(&screen_info);
 }
 
 static bool vga_arb_integrated_gpu(struct device *dev)
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw

Hi

Am 13.10.25 um 17:44 schrieb Mario Limonciello (AMD):

Quoted 8 lines

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. Add a select for SCREEN_INFO to ensure that the VGA arbiter works as intended. Also drop the now dead code.

Quoted 5 lines
Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")

I think we should take this patch in any case, even if it would not fix the reporter's problem.

Best regards
Thomas

Quoted 39 lines

---
v2:
* drop dead code (Ilpo)

---
  drivers/pci/Kconfig  | 1 +
  drivers/pci/vgaarb.c | 8 +-------
  2 files changed, 2 insertions(+), 7 deletions(-)
drivers/pci/Kconfig +1 -0
index 7065a8e5f9b14..c35fed47addd5 100644
@@ -306,6 +306,7 @@ config VGA_ARB
  	bool "VGA Arbitration" if EXPERT
  	default y
  	depends on (PCI && !S390)
+	select SCREEN_INFO
  	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 +1 -7
index b58f94ee48916..8c8c420ff5b55 100644
@@ -556,13 +556,7 @@ 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);
-#else
-	return false;
-#endif
+	return pdev == screen_info_pci_dev(&screen_info);
  }
 
  static bool vga_arb_integrated_gpu(struct device *dev)
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)
Reviewed-by on v2 1/1
#2 lore raw
In reply to Mario Limonciello (AMD)
Quoted 42 lines · Mario Limonciello (AMD)

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. Add a select for SCREEN_INFO to ensure that the VGA arbiter works as intended. Also drop the now dead code.

Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")

---
v2:
* drop dead code (Ilpo)

---
 drivers/pci/Kconfig  | 1 +
 drivers/pci/vgaarb.c | 8 +-------
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/pci/Kconfig +1 -0
index 7065a8e5f9b14..c35fed47addd5 100644
@@ -306,6 +306,7 @@ config VGA_ARB
 	bool "VGA Arbitration" if EXPERT
 	default y
 	depends on (PCI && !S390)
+	select SCREEN_INFO
 	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 +0 -1
index b58f94ee48916..8c8c420ff5b55 100644
@@ -556,13 +556,7 @@ EXPORT_SYMBOL(vga_put);
 
 static bool vga_is_firmware_default(struct pci_dev *pdev)
 {
-#ifdef CONFIG_SCREEN_INFO

drivers/pci/vgaarb.c EXPORT_SYMBOL(vga_put); · line 562

Quoted 10 lines
drivers/pci/vgaarb.c +1 -6
-	struct screen_info *si = &screen_info;
-
-	return pdev == screen_info_pci_dev(si);
-#else
-	return false;
-#endif
+	return pdev == screen_info_pci_dev(&screen_info);
 }
 
 static bool vga_arb_integrated_gpu(struct device *dev)
Signature · 1 line
 i.
#3 lore raw
In reply to Mario Limonciello (AMD)
Quoted 8 lines · Mario Limonciello (AMD)

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. Add a select for SCREEN_INFO to ensure that the VGA arbiter works as intended. Also drop the now dead code.

Quoted 5 lines
Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")

Applied to for-linus for v6.18, thanks!

Quoted 42 lines

---
v2:
* drop dead code (Ilpo)

---
 drivers/pci/Kconfig  | 1 +
 drivers/pci/vgaarb.c | 8 +-------
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/pci/Kconfig +1 -0
index 7065a8e5f9b14..c35fed47addd5 100644
@@ -306,6 +306,7 @@ config VGA_ARB
 	bool "VGA Arbitration" if EXPERT
 	default y
 	depends on (PCI && !S390)
+	select SCREEN_INFO
 	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 +1 -7
index b58f94ee48916..8c8c420ff5b55 100644
@@ -556,13 +556,7 @@ 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);
-#else
-	return false;
-#endif
+	return pdev == screen_info_pci_dev(&screen_info);
 }
 
 static bool vga_arb_integrated_gpu(struct device *dev)
Signature · 1 line
2.43.0
#4 lore raw
Quoted 9 lines · Bjorn Helgaas
Quoted 8 lines · Mario Limonciello (AMD)

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. Add a select for SCREEN_INFO to ensure that the VGA arbiter works as intended. Also drop the now dead code.

Quoted 7 lines
Quoted 5 lines
Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")

Applied to for-linus for v6.18, thanks!

Oops, dropped because of this regression:

https://lore.kernel.org/r/176038554347.1442.9483731885505420131@15dd6324cc71

Quoted 42 lines
Quoted 42 lines

---
v2:
* drop dead code (Ilpo)

---
 drivers/pci/Kconfig  | 1 +
 drivers/pci/vgaarb.c | 8 +-------
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/pci/Kconfig +1 -0
index 7065a8e5f9b14..c35fed47addd5 100644
@@ -306,6 +306,7 @@ config VGA_ARB
 	bool "VGA Arbitration" if EXPERT
 	default y
 	depends on (PCI && !S390)
+	select SCREEN_INFO
 	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 +1 -7
index b58f94ee48916..8c8c420ff5b55 100644
@@ -556,13 +556,7 @@ 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);
-#else
-	return false;
-#endif
+	return pdev == screen_info_pci_dev(&screen_info);
 }
 
 static bool vga_arb_integrated_gpu(struct device *dev)
Signature · 1 line
2.43.0
#5 lore raw
Quoted 16 lines · Bjorn Helgaas
Quoted 15 lines · Bjorn Helgaas
Quoted 13 lines · Mario Limonciello (AMD)

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. Add a select for SCREEN_INFO to ensure that the VGA arbiter works as intended. Also drop the now dead code.

Fixes 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")
Quoted 5 lines
Quoted 1 line

Applied to for-linus for v6.18, thanks!

Oops, dropped because of this regression:

   https://lore.kernel.org/r/176038554347.1442.9483731885505420131@15dd6324cc71

Ah thanks for that. I hadn't had non-x86 to test.

I'll try to cross compile to repro and come up with a solution.

Quoted 43 lines
Quoted 43 lines
Quoted 43 lines

---
v2:
* drop dead code (Ilpo)

---
  drivers/pci/Kconfig  | 1 +
  drivers/pci/vgaarb.c | 8 +-------
  2 files changed, 2 insertions(+), 7 deletions(-)
drivers/pci/Kconfig +1 -0
index 7065a8e5f9b14..c35fed47addd5 100644
@@ -306,6 +306,7 @@ config VGA_ARB
  	bool "VGA Arbitration" if EXPERT
  	default y
  	depends on (PCI && !S390)
+	select SCREEN_INFO
  	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 +1 -7
index b58f94ee48916..8c8c420ff5b55 100644
@@ -556,13 +556,7 @@ 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);
-#else
-	return false;
-#endif
+	return pdev == screen_info_pci_dev(&screen_info);
  }
 
  static bool vga_arb_integrated_gpu(struct device *dev)
Signature · 1 line
2.43.0