@@ -2041,6 +2041,14 @@ static const struct pci_device_id pciidlist[] = {
2041
2041
2042
2042
MODULE_DEVICE_TABLE (pci , pciidlist );
2043
2043
2044
+ static const struct amdgpu_asic_type_quirk asic_type_quirks [] = {
2045
+ /* differentiate between P10 and P11 asics with the same DID */
2046
+ {0x67FF , 0xE3 , CHIP_POLARIS10 },
2047
+ {0x67FF , 0xE7 , CHIP_POLARIS10 },
2048
+ {0x67FF , 0xF3 , CHIP_POLARIS10 },
2049
+ {0x67FF , 0xF7 , CHIP_POLARIS10 },
2050
+ };
2051
+
2044
2052
static const struct drm_driver amdgpu_kms_driver ;
2045
2053
2046
2054
static void amdgpu_get_secondary_funcs (struct amdgpu_device * adev )
@@ -2083,6 +2091,22 @@ static void amdgpu_init_debug_options(struct amdgpu_device *adev)
2083
2091
}
2084
2092
}
2085
2093
2094
+ static unsigned long amdgpu_fix_asic_type (struct pci_dev * pdev , unsigned long flags )
2095
+ {
2096
+ int i ;
2097
+
2098
+ for (i = 0 ; i < ARRAY_SIZE (asic_type_quirks ); i ++ ) {
2099
+ if (pdev -> device == asic_type_quirks [i ].device &&
2100
+ pdev -> revision == asic_type_quirks [i ].revision ) {
2101
+ flags &= ~AMD_ASIC_MASK ;
2102
+ flags |= asic_type_quirks [i ].type ;
2103
+ break ;
2104
+ }
2105
+ }
2106
+
2107
+ return flags ;
2108
+ }
2109
+
2086
2110
static int amdgpu_pci_probe (struct pci_dev * pdev ,
2087
2111
const struct pci_device_id * ent )
2088
2112
{
@@ -2110,15 +2134,8 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
2110
2134
"See modparam exp_hw_support\n" );
2111
2135
return - ENODEV ;
2112
2136
}
2113
- /* differentiate between P10 and P11 asics with the same DID */
2114
- if (pdev -> device == 0x67FF &&
2115
- (pdev -> revision == 0xE3 ||
2116
- pdev -> revision == 0xE7 ||
2117
- pdev -> revision == 0xF3 ||
2118
- pdev -> revision == 0xF7 )) {
2119
- flags &= ~AMD_ASIC_MASK ;
2120
- flags |= CHIP_POLARIS10 ;
2121
- }
2137
+
2138
+ flags = amdgpu_fix_asic_type (pdev , flags );
2122
2139
2123
2140
/* Due to hardware bugs, S/G Display on raven requires a 1:1 IOMMU mapping,
2124
2141
* however, SME requires an indirect IOMMU mapping because the encryption
0 commit comments