aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Quan <evan.quan@amd.com>2019-01-22 05:05:54 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-01-25 16:15:36 -0500
commit713b64a58e88acec4ab97782086061fd012de7aa (patch)
treed540a1f8fc30de0c02faa7d04c2c98cdf15ce537
parent049d69df2db6da6203880e7da5f30900cd5825a4 (diff)
drm/amd/powerplay: enable MGPU fan boost feature on Vega10
For those SKUs which support this feature only. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c1
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c37
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h1
3 files changed, 39 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index d1e262844619..21696e8b0c23 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4984,6 +4984,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
4984 .get_asic_baco_capability = vega10_baco_get_capability, 4984 .get_asic_baco_capability = vega10_baco_get_capability,
4985 .get_asic_baco_state = vega10_baco_get_state, 4985 .get_asic_baco_state = vega10_baco_get_state,
4986 .set_asic_baco_state = vega10_baco_set_state, 4986 .set_asic_baco_state = vega10_baco_set_state,
4987 .enable_mgpu_fan_boost = vega10_enable_mgpu_fan_boost,
4987}; 4988};
4988 4989
4989int vega10_hwmgr_init(struct pp_hwmgr *hwmgr) 4990int vega10_hwmgr_init(struct pp_hwmgr *hwmgr)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
index 3f807d6c95ce..ba8763daa380 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
@@ -556,6 +556,43 @@ int vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
556 return ret; 556 return ret;
557} 557}
558 558
559int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr)
560{
561 struct vega10_hwmgr *data = hwmgr->backend;
562 PPTable_t *table = &(data->smc_state_table.pp_table);
563 int ret;
564
565 if (!data->smu_features[GNLD_FAN_CONTROL].supported)
566 return 0;
567
568 if (!hwmgr->thermal_controller.advanceFanControlParameters.
569 usMGpuThrottlingRPMLimit)
570 return 0;
571
572 table->FanThrottlingRpm = hwmgr->thermal_controller.
573 advanceFanControlParameters.usMGpuThrottlingRPMLimit;
574
575 ret = smum_smc_table_manager(hwmgr,
576 (uint8_t *)(&(data->smc_state_table.pp_table)),
577 PPTABLE, false);
578 if (ret) {
579 pr_info("Failed to update fan control table in pptable!");
580 return ret;
581 }
582
583 ret = vega10_disable_fan_control_feature(hwmgr);
584 if (ret) {
585 pr_info("Attempt to disable SMC fan control feature failed!");
586 return ret;
587 }
588
589 ret = vega10_enable_fan_control_feature(hwmgr);
590 if (ret)
591 pr_info("Attempt to enable SMC fan control feature failed!");
592
593 return ret;
594}
595
559/** 596/**
560* Start the fan control on the SMC. 597* Start the fan control on the SMC.
561* @param hwmgr the address of the powerplay hardware manager. 598* @param hwmgr the address of the powerplay hardware manager.
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
index 21e7c4dfa2ca..4a0ede7c1f07 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
@@ -73,6 +73,7 @@ extern int vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr);
73extern int vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr); 73extern int vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);
74extern int vega10_start_thermal_controller(struct pp_hwmgr *hwmgr, 74extern int vega10_start_thermal_controller(struct pp_hwmgr *hwmgr,
75 struct PP_TemperatureRange *range); 75 struct PP_TemperatureRange *range);
76extern int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr);
76 77
77 78
78#endif 79#endif