Commit 634fc7f1 authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amdgpu/pm/smu11: query hw for manual fan control



if no setting has been specified yet.
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 892cba31
......@@ -1098,7 +1098,16 @@ static int arcturus_get_fan_speed_percent(struct smu_context *smu,
*speed = rpm * 100 / smu->fan_max_rpm;
return ret;
default:
*speed = smu->user_dpm_profile.fan_speed_percent;
if (smu->user_dpm_profile.fan_speed_percent) {
*speed = smu->user_dpm_profile.fan_speed_percent;
} else {
ret = arcturus_get_smu_metrics_data(smu,
METRICS_CURR_FANSPEED,
&rpm);
if (!ret && smu->fan_max_rpm)
*speed = rpm * 100 / smu->fan_max_rpm;
return ret;
}
return 0;
}
}
......
......@@ -1335,7 +1335,16 @@ static int navi10_get_fan_speed_percent(struct smu_context *smu,
*speed = rpm * 100 / smu->fan_max_rpm;
return ret;
default:
*speed = smu->user_dpm_profile.fan_speed_percent;
if (smu->user_dpm_profile.fan_speed_percent) {
*speed = smu->user_dpm_profile.fan_speed_percent;
} else {
ret = navi10_get_smu_metrics_data(smu,
METRICS_CURR_FANSPEED,
&rpm);
if (!ret && smu->fan_max_rpm)
*speed = rpm * 100 / smu->fan_max_rpm;
return ret;
}
return 0;
}
}
......
......@@ -1255,7 +1255,16 @@ static int sienna_cichlid_get_fan_speed_percent(struct smu_context *smu,
*speed = rpm * 100 / smu->fan_max_rpm;
return ret;
default:
*speed = smu->user_dpm_profile.fan_speed_percent;
if (smu->user_dpm_profile.fan_speed_percent) {
*speed = smu->user_dpm_profile.fan_speed_percent;
} else {
ret = sienna_cichlid_get_smu_metrics_data(smu,
METRICS_CURR_FANSPEED,
&rpm);
if (!ret && smu->fan_max_rpm)
*speed = rpm * 100 / smu->fan_max_rpm;
return ret;
}
return 0;
}
}
......
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