From 07051a296a1335d13f51880245443cb87ba96a73 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Wed, 27 Apr 2011 19:40:18 +0000 Subject: prefer boot display devices when probing cards (fixes at least an issue with an SLI laptop as reported by Maarten Vanraes) --- lib/Xconfig/card.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Xconfig/card.pm') diff --git a/lib/Xconfig/card.pm b/lib/Xconfig/card.pm index 979de95..7a10606 100644 --- a/lib/Xconfig/card.pm +++ b/lib/Xconfig/card.pm @@ -93,12 +93,14 @@ sub probe() { #- my @c = { driver => 'Card:Matrox Millennium G400 DualHead', description => 'Matrox|Millennium G400 Dual HeadCard' }; my @c = detect_devices::matching_driver__regexp('^(Card|Server|Driver):'); - my @cards = map { + # prefer the boot device + my @cards = sort { $b->{boot_device} cmp $a->{boot_device} } map { my @l = $_->{description} =~ /(.*?)\|(.*)/; my $card = { description => $_->{description}, VendorName => $l[0], BoardName => $l[1], BusID => "PCI:$_->{pci_bus}:$_->{pci_device}:$_->{pci_function}", + boot_device => chomp_(cat_($_->{sysfs_device} . "/boot_vga")) || 0, }; if (my ($card_name) = $_->{driver} =~ /Card:(.*)/) { $card->{BoardName} = $card_name; -- cgit v1.2.1