Commit 9366c2e8 authored by Mario Limonciello's avatar Mario Limonciello Committed by Alex Deucher

drm/amd: Rename AMDGPU_PP_SENSOR_GPU_POWER

Use the clearer name `AMDGPU_PP_SENSOR_GPU_AVG_POWER` instead.
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 765bbbec
...@@ -1019,7 +1019,7 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) ...@@ -1019,7 +1019,7 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
case AMDGPU_INFO_SENSOR_GPU_AVG_POWER: case AMDGPU_INFO_SENSOR_GPU_AVG_POWER:
/* get average GPU power */ /* get average GPU power */
if (amdgpu_dpm_read_sensor(adev, if (amdgpu_dpm_read_sensor(adev,
AMDGPU_PP_SENSOR_GPU_POWER, AMDGPU_PP_SENSOR_GPU_AVG_POWER,
(void *)&ui32, &ui32_size)) { (void *)&ui32, &ui32_size)) {
return -EINVAL; return -EINVAL;
} }
......
...@@ -132,7 +132,7 @@ enum amd_pp_sensors { ...@@ -132,7 +132,7 @@ enum amd_pp_sensors {
AMDGPU_PP_SENSOR_MEM_TEMP, AMDGPU_PP_SENSOR_MEM_TEMP,
AMDGPU_PP_SENSOR_VCE_POWER, AMDGPU_PP_SENSOR_VCE_POWER,
AMDGPU_PP_SENSOR_UVD_POWER, AMDGPU_PP_SENSOR_UVD_POWER,
AMDGPU_PP_SENSOR_GPU_POWER, AMDGPU_PP_SENSOR_GPU_AVG_POWER,
AMDGPU_PP_SENSOR_GPU_INPUT_POWER, AMDGPU_PP_SENSOR_GPU_INPUT_POWER,
AMDGPU_PP_SENSOR_SS_APU_SHARE, AMDGPU_PP_SENSOR_SS_APU_SHARE,
AMDGPU_PP_SENSOR_SS_DGPU_SHARE, AMDGPU_PP_SENSOR_SS_DGPU_SHARE,
......
...@@ -2796,7 +2796,7 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, ...@@ -2796,7 +2796,7 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev,
{ {
unsigned int val; unsigned int val;
val = amdgpu_hwmon_get_power(dev, AMDGPU_PP_SENSOR_GPU_POWER); val = amdgpu_hwmon_get_power(dev, AMDGPU_PP_SENSOR_GPU_AVG_POWER);
if (val < 0) if (val < 0)
return val; return val;
...@@ -3460,7 +3460,7 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *a ...@@ -3460,7 +3460,7 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *a
if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VDDNB, (void *)&value, &size)) if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VDDNB, (void *)&value, &size))
seq_printf(m, "\t%u mV (VDDNB)\n", value); seq_printf(m, "\t%u mV (VDDNB)\n", value);
size = sizeof(uint32_t); size = sizeof(uint32_t);
if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_POWER, (void *)&query, &size)) if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_AVG_POWER, (void *)&query, &size))
seq_printf(m, "\t%u.%u W (average GPU)\n", query >> 8, query & 0xff); seq_printf(m, "\t%u.%u W (average GPU)\n", query >> 8, query & 0xff);
size = sizeof(value); size = sizeof(value);
seq_printf(m, "\n"); seq_printf(m, "\n");
......
...@@ -2141,7 +2141,7 @@ static int vega20_get_gpu_power(struct pp_hwmgr *hwmgr, int idx, ...@@ -2141,7 +2141,7 @@ static int vega20_get_gpu_power(struct pp_hwmgr *hwmgr, int idx,
/* For the 40.46 release, they changed the value name */ /* For the 40.46 release, they changed the value name */
switch (idx) { switch (idx) {
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
if (hwmgr->smu_version == 0x282e00) if (hwmgr->smu_version == 0x282e00)
*query = metrics_table.AverageSocketPower << 8; *query = metrics_table.AverageSocketPower << 8;
else else
...@@ -2260,7 +2260,7 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx, ...@@ -2260,7 +2260,7 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx,
*((uint32_t *)value) = data->vce_power_gated ? 0 : 1; *((uint32_t *)value) = data->vce_power_gated ? 0 : 1;
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
case AMDGPU_PP_SENSOR_GPU_INPUT_POWER: case AMDGPU_PP_SENSOR_GPU_INPUT_POWER:
*size = 16; *size = 16;
ret = vega20_get_gpu_power(hwmgr, idx, (uint32_t *)value); ret = vega20_get_gpu_power(hwmgr, idx, (uint32_t *)value);
......
...@@ -1130,7 +1130,7 @@ static int arcturus_read_sensor(struct smu_context *smu, ...@@ -1130,7 +1130,7 @@ static int arcturus_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = arcturus_get_smu_metrics_data(smu, ret = arcturus_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER, METRICS_AVERAGE_SOCKETPOWER,
(uint32_t *)data); (uint32_t *)data);
......
...@@ -212,7 +212,7 @@ static int cyan_skillfish_read_sensor(struct smu_context *smu, ...@@ -212,7 +212,7 @@ static int cyan_skillfish_read_sensor(struct smu_context *smu,
*(uint32_t *)data *= 100; *(uint32_t *)data *= 100;
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = cyan_skillfish_get_smu_metrics_data(smu, ret = cyan_skillfish_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER, METRICS_AVERAGE_SOCKETPOWER,
(uint32_t *)data); (uint32_t *)data);
......
...@@ -2202,7 +2202,7 @@ static int navi10_read_sensor(struct smu_context *smu, ...@@ -2202,7 +2202,7 @@ static int navi10_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = navi1x_get_smu_metrics_data(smu, ret = navi1x_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER, METRICS_AVERAGE_SOCKETPOWER,
(uint32_t *)data); (uint32_t *)data);
......
...@@ -1902,7 +1902,7 @@ static int sienna_cichlid_read_sensor(struct smu_context *smu, ...@@ -1902,7 +1902,7 @@ static int sienna_cichlid_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = sienna_cichlid_get_smu_metrics_data(smu, ret = sienna_cichlid_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER, METRICS_AVERAGE_SOCKETPOWER,
(uint32_t *)data); (uint32_t *)data);
......
...@@ -1540,7 +1540,7 @@ static int vangogh_read_sensor(struct smu_context *smu, ...@@ -1540,7 +1540,7 @@ static int vangogh_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = vangogh_common_get_smu_metrics_data(smu, ret = vangogh_common_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER, METRICS_AVERAGE_SOCKETPOWER,
(uint32_t *)data); (uint32_t *)data);
......
...@@ -1315,6 +1315,7 @@ static int renoir_read_sensor(struct smu_context *smu, ...@@ -1315,6 +1315,7 @@ static int renoir_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
default: default:
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
break; break;
......
...@@ -1148,6 +1148,7 @@ static int aldebaran_read_sensor(struct smu_context *smu, ...@@ -1148,6 +1148,7 @@ static int aldebaran_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = aldebaran_get_smu_metrics_data(smu, ret = aldebaran_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER, METRICS_AVERAGE_SOCKETPOWER,
(uint32_t *)data); (uint32_t *)data);
......
...@@ -953,7 +953,7 @@ static int smu_v13_0_0_read_sensor(struct smu_context *smu, ...@@ -953,7 +953,7 @@ static int smu_v13_0_0_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = smu_v13_0_0_get_smu_metrics_data(smu, ret = smu_v13_0_0_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER, METRICS_AVERAGE_SOCKETPOWER,
(uint32_t *)data); (uint32_t *)data);
......
...@@ -572,7 +572,7 @@ static int smu_v13_0_4_read_sensor(struct smu_context *smu, ...@@ -572,7 +572,7 @@ static int smu_v13_0_4_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = smu_v13_0_4_get_smu_metrics_data(smu, ret = smu_v13_0_4_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER, METRICS_AVERAGE_SOCKETPOWER,
(uint32_t *)data); (uint32_t *)data);
......
...@@ -388,6 +388,7 @@ static int smu_v13_0_5_read_sensor(struct smu_context *smu, ...@@ -388,6 +388,7 @@ static int smu_v13_0_5_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
default: default:
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
break; break;
......
...@@ -1213,6 +1213,7 @@ static int smu_v13_0_6_read_sensor(struct smu_context *smu, ...@@ -1213,6 +1213,7 @@ static int smu_v13_0_6_read_sensor(struct smu_context *smu,
ret = smu_v13_0_get_gfx_vdd(smu, (uint32_t *)data); ret = smu_v13_0_get_gfx_vdd(smu, (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
default: default:
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
break; break;
......
...@@ -934,7 +934,7 @@ static int smu_v13_0_7_read_sensor(struct smu_context *smu, ...@@ -934,7 +934,7 @@ static int smu_v13_0_7_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = smu_v13_0_7_get_smu_metrics_data(smu, ret = smu_v13_0_7_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER, METRICS_AVERAGE_SOCKETPOWER,
(uint32_t *)data); (uint32_t *)data);
......
...@@ -479,6 +479,7 @@ static int yellow_carp_read_sensor(struct smu_context *smu, ...@@ -479,6 +479,7 @@ static int yellow_carp_read_sensor(struct smu_context *smu,
(uint32_t *)data); (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
default: default:
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
break; break;
......
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