Order unique chipsets according to first appearance in ati_pciids.csv
PATCH 1/1 Order unique chipsets according to first appearance in ati_pciids.csv
From: Michel Dänzer <[email protected]>
Instead of lexically. This makes it more likely for similar generations to be close to each other in the list of unique chipsets.
(Ported from radeon commit 1ce1b1656acc6211deb2091ff7f28d51b6daf86b,
plus change $numunique++ => ++$numunique to fix OLAND getting listed twice)
--- src/amdgpu_chipset_gen.h | 26 +++++++++++++------------- src/pcidb/parse_pci_ids.pl | 9 +++++++-- 2 files changed, 20 insertions(+), 15 deletions(-)
src/amdgpu_chipset_gen.h +13 -13
@@ -195,22 +195,22 @@ SymTabRec AMDGPUChipsets[] = { };SymTabRec AMDGPUUniqueChipsets[] = { - {0 ,"BONAIRE" }, - {0 ,"CARRIZO" }, - {0 ,"FIJI" }, + {0 ,"OLAND" }, {0 ,"HAINAN" }, - {0 ,"HAWAII" }, + {0 ,"TAHITI" }, + {0 ,"PITCAIRN" }, + {0 ,"VERDE" }, + {0 ,"BONAIRE" }, {0 ,"KABINI" }, - {0 ,"KAVERI" }, {0 ,"MULLINS" }, - {0 ,"OLAND" }, - {0 ,"PITCAIRN" }, - {0 ,"POLARIS10" }, - {0 ,"POLARIS11" }, - {0 ,"STONEY" }, - {0 ,"TAHITI" }, - {0 ,"TONGA" }, + {0 ,"KAVERI" }, + {0 ,"HAWAII" }, {0 ,"TOPAZ" }, - {0 ,"VERDE" }, + {0 ,"TONGA" }, + {0 ,"CARRIZO" }, + {0 ,"FIJI" }, + {0 ,"STONEY" }, + {0 ,"POLARIS11" }, + {0 ,"POLARIS10" }, {-1 ,NULL } };
src/pcidb/parse_pci_ids.pl +7 -2
@@ -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";
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20161019092809.26197-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
Alex Deucher
Reviewed-byQuoted 10 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
Instead of lexically. This makes it more likely for similar generations to be close to each other in the list of unique chipsets.
(Ported from radeon commit
1ce1b1656acc6211deb2091ff7f28d51b6daf86b,
plus change $numunique++ => ++$numunique to fix OLAND getting listed twice)Signed-off-by Michel Dänzer <[email protected]>
Quoted 82 lines
--- src/amdgpu_chipset_gen.h | 26 +++++++++++++------------- src/pcidb/parse_pci_ids.pl | 9 +++++++-- 2 files changed, 20 insertions(+), 15 deletions(-)src/amdgpu_chipset_gen.h +13
-13@@ -195,22 +195,22 @@ SymTabRec AMDGPUChipsets[] = { };SymTabRec AMDGPUUniqueChipsets[] = { - {0 ,"BONAIRE" }, - {0 ,"CARRIZO" }, - {0 ,"FIJI" }, + {0 ,"OLAND" }, {0 ,"HAINAN" }, - {0 ,"HAWAII" }, + {0 ,"TAHITI" }, + {0 ,"PITCAIRN" }, + {0 ,"VERDE" }, + {0 ,"BONAIRE" }, {0 ,"KABINI" }, - {0 ,"KAVERI" }, {0 ,"MULLINS" }, - {0 ,"OLAND" }, - {0 ,"PITCAIRN" }, - {0 ,"POLARIS10" }, - {0 ,"POLARIS11" }, - {0 ,"STONEY" }, - {0 ,"TAHITI" }, - {0 ,"TONGA" }, + {0 ,"KAVERI" }, + {0 ,"HAWAII" }, {0 ,"TOPAZ" }, - {0 ,"VERDE" }, + {0 ,"TONGA" }, + {0 ,"CARRIZO" }, + {0 ,"FIJI" }, + {0 ,"STONEY" }, + {0 ,"POLARIS11" }, + {0 ,"POLARIS10" }, {-1 ,NULL } };src/pcidb/parse_pci_ids.pl +7
-3@@ -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"; --2.9.3
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx