summaryrefslogtreecommitdiff
path: root/src/pcidb
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-10-19 18:08:36 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2016-10-19 18:08:36 +0900
commit1ce1b1656acc6211deb2091ff7f28d51b6daf86b (patch)
tree0d038e9fea8b3d4fc6b91aa6b6f13fed6e75ae04 /src/pcidb
parent7c66be961de3477fc685eb71b46265adbae923f0 (diff)
Order unique chipsets according to first appearance in ati_pciids.csv
Instead of lexically. This makes it more likely for similar generations to be close to each other in the list of unique chipsets. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/pcidb')
-rwxr-xr-xsrc/pcidb/parse_pci_ids.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/pcidb/parse_pci_ids.pl b/src/pcidb/parse_pci_ids.pl
index f78e207e..222dcf89 100755
--- a/src/pcidb/parse_pci_ids.pl
+++ b/src/pcidb/parse_pci_ids.pl
@@ -17,6 +17,8 @@ my $radeonchipsetfile = 'radeon_chipset_gen.h';
my $radeonchipinfofile = 'radeon_chipinfo_gen.h';
my %uniquechipsets;
+my @uniquearray;
+my $numunique = 0;
my $csv = Text::CSV_XS->new();
@@ -50,7 +52,10 @@ while (<CSV>) {
print PCIDEVICEMATCH " ATI_DEVICE_MATCH( PCI_CHIP_$columns[1], 0 ),\n";
print RADEONCHIPSET " { PCI_CHIP_$columns[1], \"$columns[8]\" },\n";
- $uniquechipsets{$columns[8]} = 1;
+ if (!$uniquechipsets{$columns[8]}) {
+ $uniquearray[$numunique] = $columns[8];
+ $uniquechipsets{$columns[8]} = $numunique++;
+ }
print RADEONCHIPINFO " { $columns[0], CHIP_FAMILY_$columns[2], ";
@@ -95,7 +100,7 @@ while (<CSV>) {
print RADEONCHIPINFO "};\n";
print RADEONCHIPSET " { -1, NULL }\n};\n\nSymTabRec RADEONUniqueChipsets[] = {\n";
-foreach (sort keys %uniquechipsets) {
+foreach (@uniquearray) {
print RADEONCHIPSET " { 0, \"$_\" },\n";
}
print RADEONCHIPSET " { -1, NULL }\n};\n";