summaryrefslogtreecommitdiff
path: root/src/pcidb
diff options
context:
space:
mode:
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 9b6c6f2..1234d79 100755
--- a/src/pcidb/parse_pci_ids.pl
+++ b/src/pcidb/parse_pci_ids.pl
@@ -17,6 +17,8 @@ my $amdgpuchipsetfile = 'amdgpu_chipset_gen.h';
my $amdgpuchipinfofile = 'amdgpu_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 AMDGPUCHIPSET " { PCI_CHIP_$columns[1], \"$columns[3]\" },\n";
- $uniquechipsets{$columns[3]} = 1;
+ if (!$uniquechipsets{$columns[3]}) {
+ $uniquearray[$numunique] = $columns[3];
+ $uniquechipsets{$columns[3]} = ++$numunique;
+ }
print AMDGPUCHIPINFO " { $columns[0], CHIP_FAMILY_$columns[2] },\n";
}
@@ -63,7 +68,7 @@ while (<CSV>) {
print AMDGPUCHIPINFO "};\n";
print AMDGPUCHIPSET " { -1, NULL }\n};\n\nSymTabRec AMDGPUUniqueChipsets[] = {\n";
-foreach (sort keys %uniquechipsets) {
+foreach (@uniquearray) {
print AMDGPUCHIPSET " { 0, \"$_\" },\n";
}
print AMDGPUCHIPSET " { -1, NULL }\n};\n";