@@ -2420,6 +2420,26 @@ static int vega10_enable_thermal_protection(struct pp_hwmgr *hwmgr)
2420
2420
return 0 ;
2421
2421
}
2422
2422
2423
+ static int vega10_disable_thermal_protection (struct pp_hwmgr * hwmgr )
2424
+ {
2425
+ struct vega10_hwmgr * data = (struct vega10_hwmgr * )(hwmgr -> backend );
2426
+
2427
+ if (data -> smu_features [GNLD_THERMAL ].supported ) {
2428
+ if (!data -> smu_features [GNLD_THERMAL ].enabled )
2429
+ pr_info ("THERMAL Feature Already disabled!" );
2430
+
2431
+ PP_ASSERT_WITH_CODE (
2432
+ !vega10_enable_smc_features (hwmgr -> smumgr ,
2433
+ false,
2434
+ data -> smu_features [GNLD_THERMAL ].smu_feature_bitmap ),
2435
+ "disable THERMAL Feature Failed!" ,
2436
+ return - 1 );
2437
+ data -> smu_features [GNLD_THERMAL ].enabled = false;
2438
+ }
2439
+
2440
+ return 0 ;
2441
+ }
2442
+
2423
2443
static int vega10_enable_vrhot_feature (struct pp_hwmgr * hwmgr )
2424
2444
{
2425
2445
struct vega10_hwmgr * data =
@@ -2498,6 +2518,37 @@ static int vega10_enable_deep_sleep_master_switch(struct pp_hwmgr *hwmgr)
2498
2518
return 0 ;
2499
2519
}
2500
2520
2521
+ static int vega10_stop_dpm (struct pp_hwmgr * hwmgr , uint32_t bitmap )
2522
+ {
2523
+ struct vega10_hwmgr * data =
2524
+ (struct vega10_hwmgr * )(hwmgr -> backend );
2525
+ uint32_t i , feature_mask = 0 ;
2526
+
2527
+
2528
+ if (data -> smu_features [GNLD_LED_DISPLAY ].supported == true){
2529
+ PP_ASSERT_WITH_CODE (!vega10_enable_smc_features (hwmgr -> smumgr ,
2530
+ true, data -> smu_features [GNLD_LED_DISPLAY ].smu_feature_bitmap ),
2531
+ "Attempt to Enable LED DPM feature Failed!" , return - EINVAL );
2532
+ data -> smu_features [GNLD_LED_DISPLAY ].enabled = true;
2533
+ }
2534
+
2535
+ for (i = 0 ; i < GNLD_DPM_MAX ; i ++ ) {
2536
+ if (data -> smu_features [i ].smu_feature_bitmap & bitmap ) {
2537
+ if (data -> smu_features [i ].supported ) {
2538
+ if (data -> smu_features [i ].enabled ) {
2539
+ feature_mask |= data -> smu_features [i ].
2540
+ smu_feature_bitmap ;
2541
+ data -> smu_features [i ].enabled = false;
2542
+ }
2543
+ }
2544
+ }
2545
+ }
2546
+
2547
+ vega10_enable_smc_features (hwmgr -> smumgr , false, feature_mask );
2548
+
2549
+ return 0 ;
2550
+ }
2551
+
2501
2552
/**
2502
2553
* @brief Tell SMC to enabled the supported DPMs.
2503
2554
*
@@ -4356,11 +4407,55 @@ vega10_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmg
4356
4407
return is_update_required ;
4357
4408
}
4358
4409
4410
+ static int vega10_disable_dpm_tasks (struct pp_hwmgr * hwmgr )
4411
+ {
4412
+ int tmp_result , result = 0 ;
4413
+
4414
+ tmp_result = (vega10_is_dpm_running (hwmgr )) ? 0 : -1 ;
4415
+ PP_ASSERT_WITH_CODE (tmp_result == 0 ,
4416
+ "DPM is not running right now, no need to disable DPM!" ,
4417
+ return 0 );
4418
+
4419
+ if (phm_cap_enabled (hwmgr -> platform_descriptor .platformCaps ,
4420
+ PHM_PlatformCaps_ThermalController ))
4421
+ vega10_disable_thermal_protection (hwmgr );
4422
+
4423
+ tmp_result = vega10_disable_power_containment (hwmgr );
4424
+ PP_ASSERT_WITH_CODE ((tmp_result == 0 ),
4425
+ "Failed to disable power containment!" , result = tmp_result );
4426
+
4427
+ tmp_result = vega10_avfs_enable (hwmgr , false);
4428
+ PP_ASSERT_WITH_CODE ((tmp_result == 0 ),
4429
+ "Failed to disable AVFS!" , result = tmp_result );
4430
+
4431
+ tmp_result = vega10_stop_dpm (hwmgr , SMC_DPM_FEATURES );
4432
+ PP_ASSERT_WITH_CODE ((tmp_result == 0 ),
4433
+ "Failed to stop DPM!" , result = tmp_result );
4434
+
4435
+ return result ;
4436
+ }
4437
+
4438
+ static int vega10_power_off_asic (struct pp_hwmgr * hwmgr )
4439
+ {
4440
+ struct vega10_hwmgr * data = (struct vega10_hwmgr * )(hwmgr -> backend );
4441
+ int result ;
4442
+
4443
+ result = vega10_disable_dpm_tasks (hwmgr );
4444
+ PP_ASSERT_WITH_CODE ((0 == result ),
4445
+ "[disable_dpm_tasks] Failed to disable DPM!" ,
4446
+ );
4447
+ data -> water_marks_bitmap &= ~(WaterMarksLoaded );
4448
+
4449
+ return result ;
4450
+ }
4451
+
4452
+
4359
4453
static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
4360
4454
.backend_init = vega10_hwmgr_backend_init ,
4361
4455
.backend_fini = vega10_hwmgr_backend_fini ,
4362
4456
.asic_setup = vega10_setup_asic_task ,
4363
4457
.dynamic_state_management_enable = vega10_enable_dpm_tasks ,
4458
+ .dynamic_state_management_disable = vega10_disable_dpm_tasks ,
4364
4459
.get_num_of_pp_table_entries =
4365
4460
vega10_get_number_of_powerplay_table_entries ,
4366
4461
.get_power_state_size = vega10_get_power_state_size ,
@@ -4400,6 +4495,8 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
4400
4495
.check_states_equal = vega10_check_states_equal ,
4401
4496
.check_smc_update_required_for_display_configuration =
4402
4497
vega10_check_smc_update_required_for_display_configuration ,
4498
+ .power_off_asic = vega10_power_off_asic ,
4499
+ .disable_smc_firmware_ctf = vega10_thermal_disable_alert ,
4403
4500
};
4404
4501
4405
4502
int vega10_hwmgr_init (struct pp_hwmgr * hwmgr )
0 commit comments