From 41c58693c323978ce610ec6f8805a7d604e61f22 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Mon, 23 Jun 2025 22:30:46 -0500 Subject: [PATCH] Add check for `pci_device_linux_sysfs_boot_display()` In the case of multiple display devices that are not VGA devices the 'boot_display' attribute read by libpciaccess can disambiguate. Part-of: --- hw/xfree86/common/xf86pciBus.c | 3 ++- hw/xfree86/common/xf86platformBus.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 0fb945c3d..9a940722b 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -110,7 +110,8 @@ xf86PciProbe(void) xf86PciVideoInfo[num - 1] = info; pci_device_probe(info); - if (primaryBus.type == BUS_NONE && pci_device_is_boot_vga(info)) { + if (primaryBus.type == BUS_NONE && (pci_device_is_boot_vga(info) || + pci_device_is_boot_display(info))) { primaryBus.type = BUS_PCI; primaryBus.id.pci = info; } diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 3e14e957b..c4657589e 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -349,7 +349,7 @@ xf86platformProbe(void) } } - /* Then check for pci_device_is_boot_vga() */ + /* Then check for pci_device_is_boot_vga()/pci_device_is_boot_display() */ for (i = 0; i < xf86_num_platform_devices; i++) { struct xf86_platform_device *dev = &xf86_platform_devices[i]; @@ -357,7 +357,8 @@ xf86platformProbe(void) continue; pci_device_probe(dev->pdev); - if (pci_device_is_boot_vga(dev->pdev)) { + if (pci_device_is_boot_display(dev->pdev) || + pci_device_is_boot_vga(dev->pdev)) { primaryBus.type = BUS_PLATFORM; primaryBus.id.plat = dev; }