aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-09-30 01:19:00 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-10-09 18:04:52 -0400
commitd5f480372ca485806443afca50ef024623f8eb03 (patch)
treec4f58b8ac4d22199e64058d5f41393e57e942762 /drivers/gpu/drm/amd
parent862cd98029d5f31db326e007aff5fec784807941 (diff)
drm/amd/pp: Implement AMDGPU_PP_SENSOR_MIN/MAX_FAN_RPM
so user can query the RPM range Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/powerplay/amd_powerplay.c6
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 32f475e37051..053c485baed0 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -813,6 +813,12 @@ static int pp_dpm_read_sensor(void *handle, int idx,
813 case AMDGPU_PP_SENSOR_STABLE_PSTATE_MCLK: 813 case AMDGPU_PP_SENSOR_STABLE_PSTATE_MCLK:
814 *((uint32_t *)value) = hwmgr->pstate_mclk; 814 *((uint32_t *)value) = hwmgr->pstate_mclk;
815 return 0; 815 return 0;
816 case AMDGPU_PP_SENSOR_MIN_FAN_RPM:
817 *((uint32_t *)value) = hwmgr->thermal_controller.fanInfo.ulMinRPM;
818 return 0;
819 case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
820 *((uint32_t *)value) = hwmgr->thermal_controller.fanInfo.ulMaxRPM;
821 return 0;
816 default: 822 default:
817 mutex_lock(&hwmgr->smu_lock); 823 mutex_lock(&hwmgr->smu_lock);
818 ret = hwmgr->hwmgr_func->read_sensor(hwmgr, idx, value, size); 824 ret = hwmgr->hwmgr_func->read_sensor(hwmgr, idx, value, size);
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c
index 5f1f7a32ac24..c9b93e6487e4 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c
@@ -834,6 +834,8 @@ static int init_powerplay_table_information(
834 834
835 hwmgr->thermal_controller.ucType = powerplay_table->ucThermalControllerType; 835 hwmgr->thermal_controller.ucType = powerplay_table->ucThermalControllerType;
836 pptable_information->uc_thermal_controller_type = powerplay_table->ucThermalControllerType; 836 pptable_information->uc_thermal_controller_type = powerplay_table->ucThermalControllerType;
837 hwmgr->thermal_controller.fanInfo.ulMinRPM = 0;
838 hwmgr->thermal_controller.fanInfo.ulMaxRPM = powerplay_table->smcPPTable.FanMaximumRpm;
837 839
838 set_hw_cap(hwmgr, 840 set_hw_cap(hwmgr,
839 ATOM_VEGA20_PP_THERMALCONTROLLER_NONE != hwmgr->thermal_controller.ucType, 841 ATOM_VEGA20_PP_THERMALCONTROLLER_NONE != hwmgr->thermal_controller.ucType,