Commit 6a36e3e5 authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher

drm/amd/powerplay: move getting MAX_FAN_RPM value to asic level

Getting MAX_FAN_RPM value needs to be read by pptable, so it should be moved to
asic level.
Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarKevin Wang <kevin1.wang@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8890fe5f
...@@ -1302,8 +1302,6 @@ static int smu_v11_0_read_sensor(struct smu_context *smu, ...@@ -1302,8 +1302,6 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,
enum amd_pp_sensors sensor, enum amd_pp_sensors sensor,
void *data, uint32_t *size) void *data, uint32_t *size)
{ {
struct smu_table_context *table_context = &smu->smu_table;
PPTable_t *pptable = table_context->driver_pptable;
int ret = 0; int ret = 0;
switch (sensor) { switch (sensor) {
case AMDGPU_PP_SENSOR_GPU_LOAD: case AMDGPU_PP_SENSOR_GPU_LOAD:
...@@ -1339,10 +1337,6 @@ static int smu_v11_0_read_sensor(struct smu_context *smu, ...@@ -1339,10 +1337,6 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,
*(uint32_t *)data = 0; *(uint32_t *)data = 0;
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
*(uint32_t *)data = pptable->FanMaximumRpm;
*size = 4;
break;
default: default:
ret = smu_common_read_sensor(smu, sensor, data, size); ret = smu_common_read_sensor(smu, sensor, data, size);
break; break;
......
...@@ -2950,6 +2950,8 @@ static int vega20_read_sensor(struct smu_context *smu, ...@@ -2950,6 +2950,8 @@ static int vega20_read_sensor(struct smu_context *smu,
void *data, uint32_t *size) void *data, uint32_t *size)
{ {
int ret = 0; int ret = 0;
struct smu_table_context *table_context = &smu->smu_table;
PPTable_t *pptable = table_context->driver_pptable;
switch (sensor) { switch (sensor) {
case AMDGPU_PP_SENSOR_UVD_POWER: case AMDGPU_PP_SENSOR_UVD_POWER:
...@@ -2960,6 +2962,10 @@ static int vega20_read_sensor(struct smu_context *smu, ...@@ -2960,6 +2962,10 @@ static int vega20_read_sensor(struct smu_context *smu,
*(uint32_t *)data = smu_feature_is_enabled(smu, SMU_FEATURE_DPM_VCE_BIT) ? 1 : 0; *(uint32_t *)data = smu_feature_is_enabled(smu, SMU_FEATURE_DPM_VCE_BIT) ? 1 : 0;
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
*(uint32_t *)data = pptable->FanMaximumRpm;
*size = 4;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment