提交 8fa6a7b0 编写于 作者: X Xiaomeng Hou 提交者: Alex Deucher

drm/amd/powerplay: implement interface to retrieve gpu temperature for renoir

add sensor interface of get gpu temperature for debugfs.
Signed-off-by: NXiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: NHuang Rui <ray.huang@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 ae46533b
......@@ -412,6 +412,24 @@ static int renoir_unforce_dpm_levels(struct smu_context *smu) {
return ret;
}
static int renoir_get_gpu_temperature(struct smu_context *smu, uint32_t *value)
{
int ret = 0;
SmuMetrics_t metrics;
if (!value)
return -EINVAL;
ret = renoir_get_metrics_table(smu, &metrics);
if (ret)
return ret;
*value = (metrics.GfxTemperature / 100) *
SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
return 0;
}
static int renoir_get_current_activity_percent(struct smu_context *smu,
enum amd_pp_sensors sensor,
uint32_t *value)
......@@ -766,6 +784,10 @@ static int renoir_read_sensor(struct smu_context *smu,
ret = renoir_get_current_activity_percent(smu, sensor, (uint32_t *)data);
*size = 4;
break;
case AMDGPU_PP_SENSOR_GPU_TEMP:
ret = renoir_get_gpu_temperature(smu, (uint32_t *)data);
*size = 4;
break;
default:
ret = smu_v12_0_read_sensor(smu, sensor, data, size);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册