From: "Mario Limonciello (AMD)" <superm1@kernel.org>
To: mario.limonciello@amd.com, bhelgaas@google.com,
superm1@kernel.org, tzimmermann@suse.de
Cc: Eric Biggers <ebiggers@kernel.org>, linux-pci@vger.kernel.org
Subject: [PATCH v2] PCI/VGA: Select SCREEN_INFO
Date: Mon, 13 Oct 2025 10:44:23 -0500 [thread overview]
Message-ID: <20251013154441.1000875-1-superm1@kernel.org> (raw)
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.
Reported-by: Eric Biggers <ebiggers@kernel.org>
Closes: https://lore.kernel.org/linux-pci/20251012182302.GA3412@sol/
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 337bf13aa9dda ("PCI/VGA: Replace vga_is_firmware_default() with a screen info check")
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
v2:
* drop dead code (Ilpo)
---
drivers/pci/Kconfig | 1 +
drivers/pci/vgaarb.c | 8 +-------
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 7065a8e5f9b14..c35fed47addd5 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -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
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index b58f94ee48916..8c8c420ff5b55 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -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)
--
2.43.0
next reply other threads:[~2025-10-13 15:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 15:44 Mario Limonciello (AMD) [this message]
2025-10-13 16:10 ` [PATCH v2] PCI/VGA: Select SCREEN_INFO Thomas Zimmermann
2025-10-13 16:39 ` Ilpo Järvinen
2025-10-13 17:55 ` Bjorn Helgaas
2025-10-13 20:47 ` Bjorn Helgaas
2025-10-13 20:48 ` Mario Limonciello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251013154441.1000875-1-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=bhelgaas@google.com \
--cc=ebiggers@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox