[PATCH v3 6/6] PCI/VGA: Enable firmware default device detection on LoongArch

From
wuqianhai@loongson.cn
Date
2026-11-10 08:59:31
Also in
dri-devel, linux-efi, linux-pci, lkml, loongarch
Reply to
wuqianhai@loongson.cn, 2026-11-10
From: wuqianhai <wuqianhai@loongson.cn>

Use CONFIG_SCREEN_INFO rather than an architecture-specific condition to
guard vga_is_firmware_default().  LoongArch now provides
sysfb_primary_display whenever CONFIG_SCREEN_INFO is enabled, so have
VGA_ARB select SCREEN_INFO on LoongArch as well.

The screen_info staleness is handled by the PCI resource-assignment path
in the previous patch, so vga_arb_device_init() no longer has to refresh
screen_info itself.

Signed-off-by: wuqianhai <wuqianhai@loongson.cn>
---
 drivers/pci/Kconfig  | 2 +-
 drivers/pci/vgaarb.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 0c7408509ba2..01e6378effae 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -255,7 +255,7 @@ config VGA_ARB
 	bool "VGA Arbitration" if EXPERT
 	default y
 	depends on !S390
-	select SCREEN_INFO if X86
+	select SCREEN_INFO if X86 || LOONGARCH
 	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 3e58b2c05c85..4528ad038610 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -566,7 +566,7 @@ EXPORT_SYMBOL(vga_put);
 
 static bool vga_is_firmware_default(struct pci_dev *pdev)
 {
-#if defined CONFIG_X86
+#ifdef CONFIG_SCREEN_INFO
 	return pdev == screen_info_pci_dev(&sysfb_primary_display.screen);
 #else
 	return false;
-- 
2.34.1
Thread (3 messages) 3 messages, 1 author, last reply 6d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help