@@ -312,7 +312,7 @@ module_param_named(moverate, amdgpu_moverate, int, 0600);
312312 * DOC: audio (int)
313313 * Set HDMI/DPAudio. Only affects non-DC display handling. The default is -1 (Enabled), set 0 to disabled it.
314314 */
315- MODULE_PARM_DESC (audio , "Audio enable (-1 = auto, 0 = disable, 1 = enable)" );
315+ MODULE_PARM_DESC (audio , "HDMI/DP Audio enable for non DC displays (-1 = auto, 0 = disable, 1 = enable)" );
316316module_param_named (audio , amdgpu_audio , int , 0444 );
317317
318318/**
@@ -618,39 +618,39 @@ module_param_named(timeout_period, amdgpu_watchdog_timer.period, uint, 0644);
618618
619619/**
620620 * DOC: si_support (int)
621- * Set SI support driver. This parameter works after set config CONFIG_DRM_AMDGPU_SI. For SI asic, when radeon driver is enabled,
622- * set value 0 to use radeon driver, while set value 1 to use amdgpu driver. The default is using radeon driver when it available,
623- * otherwise using amdgpu driver.
624- */
621+ * 1 = enabled, 0 = disabled, -1 = default
622+ *
623+ * SI (Southern Islands) are first generation GCN GPUs, supported by both
624+ * drivers: radeon (old) and amdgpu (new). This parameter controls whether
625+ * amdgpu should support SI.
626+ * By default, SI dedicated GPUs are supported by amdgpu.
627+ * Only relevant when CONFIG_DRM_AMDGPU_SI is enabled to build SI support in amdgpu.
628+ * See also radeon.si_support which should be disabled when amdgpu.si_support is
629+ * enabled, and vice versa.
630+ */
631+ int amdgpu_si_support = -1 ;
625632#ifdef CONFIG_DRM_AMDGPU_SI
626-
627- #if IS_ENABLED (CONFIG_DRM_RADEON ) || IS_ENABLED (CONFIG_DRM_RADEON_MODULE )
628- int amdgpu_si_support ;
629- MODULE_PARM_DESC (si_support , "SI support (1 = enabled, 0 = disabled (default))" );
630- #else
631- int amdgpu_si_support = 1 ;
632- MODULE_PARM_DESC (si_support , "SI support (1 = enabled (default), 0 = disabled)" );
633- #endif
634-
633+ MODULE_PARM_DESC (si_support , "SI support (1 = enabled, 0 = disabled, -1 = default)" );
635634module_param_named (si_support , amdgpu_si_support , int , 0444 );
636635#endif
637636
638637/**
639638 * DOC: cik_support (int)
640- * Set CIK support driver. This parameter works after set config CONFIG_DRM_AMDGPU_CIK. For CIK asic, when radeon driver is enabled,
641- * set value 0 to use radeon driver, while set value 1 to use amdgpu driver. The default is using radeon driver when it available,
642- * otherwise using amdgpu driver.
643- */
639+ * 1 = enabled, 0 = disabled, -1 = default
640+ *
641+ * CIK (Sea Islands) are second generation GCN GPUs, supported by both
642+ * drivers: radeon (old) and amdgpu (new). This parameter controls whether
643+ * amdgpu should support CIK.
644+ * By default:
645+ * - CIK dedicated GPUs are supported by amdgpu.
646+ * - CIK APUs are supported by radeon (except when radeon is not built).
647+ * Only relevant when CONFIG_DRM_AMDGPU_CIK is enabled to build CIK support in amdgpu.
648+ * See also radeon.cik_support which should be disabled when amdgpu.cik_support is
649+ * enabled, and vice versa.
650+ */
651+ int amdgpu_cik_support = -1 ;
644652#ifdef CONFIG_DRM_AMDGPU_CIK
645-
646- #if IS_ENABLED (CONFIG_DRM_RADEON ) || IS_ENABLED (CONFIG_DRM_RADEON_MODULE )
647- int amdgpu_cik_support ;
648- MODULE_PARM_DESC (cik_support , "CIK support (1 = enabled, 0 = disabled (default))" );
649- #else
650- int amdgpu_cik_support = 1 ;
651- MODULE_PARM_DESC (cik_support , "CIK support (1 = enabled (default), 0 = disabled)" );
652- #endif
653-
653+ MODULE_PARM_DESC (cik_support , "CIK support (1 = enabled, 0 = disabled, -1 = default)" );
654654module_param_named (cik_support , amdgpu_cik_support , int , 0444 );
655655#endif
656656
@@ -2306,6 +2306,72 @@ static unsigned long amdgpu_fix_asic_type(struct pci_dev *pdev, unsigned long fl
23062306 return flags ;
23072307}
23082308
2309+ static bool amdgpu_support_enabled (struct device * dev ,
2310+ const enum amd_asic_type family )
2311+ {
2312+ const char * gen ;
2313+ const char * param ;
2314+ int module_param = -1 ;
2315+ bool radeon_support_built = IS_ENABLED (CONFIG_DRM_RADEON );
2316+ bool amdgpu_support_built = false;
2317+ bool support_by_default = false;
2318+
2319+ switch (family ) {
2320+ case CHIP_TAHITI :
2321+ case CHIP_PITCAIRN :
2322+ case CHIP_VERDE :
2323+ case CHIP_OLAND :
2324+ case CHIP_HAINAN :
2325+ gen = "SI" ;
2326+ param = "si_support" ;
2327+ module_param = amdgpu_si_support ;
2328+ amdgpu_support_built = IS_ENABLED (CONFIG_DRM_AMDGPU_SI );
2329+ support_by_default = true;
2330+ break ;
2331+
2332+ case CHIP_BONAIRE :
2333+ case CHIP_HAWAII :
2334+ support_by_default = true;
2335+ fallthrough ;
2336+ case CHIP_KAVERI :
2337+ case CHIP_KABINI :
2338+ case CHIP_MULLINS :
2339+ gen = "CIK" ;
2340+ param = "cik_support" ;
2341+ module_param = amdgpu_cik_support ;
2342+ amdgpu_support_built = IS_ENABLED (CONFIG_DRM_AMDGPU_CIK );
2343+ break ;
2344+
2345+ default :
2346+ /* All other chips are supported by amdgpu only */
2347+ return true;
2348+ }
2349+
2350+ if (!amdgpu_support_built ) {
2351+ dev_info (dev , "amdgpu built without %s support\n" , gen );
2352+ return false;
2353+ }
2354+
2355+ if ((module_param == -1 && (support_by_default || !radeon_support_built )) ||
2356+ module_param == 1 ) {
2357+ if (radeon_support_built )
2358+ dev_info (dev , "%s support provided by amdgpu.\n"
2359+ "Use radeon.%s=1 amdgpu.%s=0 to override.\n" ,
2360+ gen , param , param );
2361+
2362+ return true;
2363+ }
2364+
2365+ if (radeon_support_built )
2366+ dev_info (dev , "%s support provided by radeon.\n"
2367+ "Use radeon.%s=0 amdgpu.%s=1 to override.\n" ,
2368+ gen , param , param );
2369+ else if (module_param == 0 )
2370+ dev_info (dev , "%s support disabled by module param\n" , gen );
2371+
2372+ return false;
2373+ }
2374+
23092375static int amdgpu_pci_probe (struct pci_dev * pdev ,
23102376 const struct pci_device_id * ent )
23112377{
@@ -2353,48 +2419,8 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
23532419 return - ENOTSUPP ;
23542420 }
23552421
2356- switch (flags & AMD_ASIC_MASK ) {
2357- case CHIP_TAHITI :
2358- case CHIP_PITCAIRN :
2359- case CHIP_VERDE :
2360- case CHIP_OLAND :
2361- case CHIP_HAINAN :
2362- #ifdef CONFIG_DRM_AMDGPU_SI
2363- if (!amdgpu_si_support ) {
2364- dev_info (& pdev -> dev ,
2365- "SI support provided by radeon.\n" );
2366- dev_info (& pdev -> dev ,
2367- "Use radeon.si_support=0 amdgpu.si_support=1 to override.\n"
2368- );
2369- return - ENODEV ;
2370- }
2371- break ;
2372- #else
2373- dev_info (& pdev -> dev , "amdgpu is built without SI support.\n" );
2422+ if (!amdgpu_support_enabled (& pdev -> dev , flags & AMD_ASIC_MASK ))
23742423 return - ENODEV ;
2375- #endif
2376- case CHIP_KAVERI :
2377- case CHIP_BONAIRE :
2378- case CHIP_HAWAII :
2379- case CHIP_KABINI :
2380- case CHIP_MULLINS :
2381- #ifdef CONFIG_DRM_AMDGPU_CIK
2382- if (!amdgpu_cik_support ) {
2383- dev_info (& pdev -> dev ,
2384- "CIK support provided by radeon.\n" );
2385- dev_info (& pdev -> dev ,
2386- "Use radeon.cik_support=0 amdgpu.cik_support=1 to override.\n"
2387- );
2388- return - ENODEV ;
2389- }
2390- break ;
2391- #else
2392- dev_info (& pdev -> dev , "amdgpu is built without CIK support.\n" );
2393- return - ENODEV ;
2394- #endif
2395- default :
2396- break ;
2397- }
23982424
23992425 adev = devm_drm_dev_alloc (& pdev -> dev , & amdgpu_kms_driver , typeof (* adev ), ddev );
24002426 if (IS_ERR (adev ))
0 commit comments