drm/amd/powerplay: refine AMDGPU_PP_SENSOR_XXX index for powerplay

Submitted by Deucher, Alexander on July 19, 2019, 1:26 p.m.

Details

Message ID BN6PR12MB1809F9A641D069E726088390F7CB0@BN6PR12MB1809.namprd12.prod.outlook.com
State New
Headers show
Series "drm/amd/powerplay: refine AMDGPU_PP_SENSOR_XXX index for powerplay" ( rev: 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Deucher, Alexander July 19, 2019, 1:26 p.m.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
index d57e75e5c71f..9f120333dc71 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
@@ -8012,6 +8012,7 @@  static int si_dpm_read_sensor(void *handle, int idx,
                 }
                 return -EINVAL;
         case AMDGPU_PP_SENSOR_GPU_TEMP:
+       case AMDGPU_PP_SENSOR_EDGE_TEMP:
                 *((uint32_t *)value) = si_dpm_get_temp(adev);
                 *size = 4;
                 return 0;
diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
index 9733bbf9bc72..af71da7d9896 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -112,9 +112,6 @@  enum amd_pp_sensors {
         AMDGPU_PP_SENSOR_MEM_LOAD,
         AMDGPU_PP_SENSOR_GFX_MCLK,
         AMDGPU_PP_SENSOR_GPU_TEMP,
-       AMDGPU_PP_SENSOR_EDGE_TEMP = AMDGPU_PP_SENSOR_GPU_TEMP,
-       AMDGPU_PP_SENSOR_HOTSPOT_TEMP,
-       AMDGPU_PP_SENSOR_MEM_TEMP,
         AMDGPU_PP_SENSOR_VCE_POWER,
         AMDGPU_PP_SENSOR_UVD_POWER,
         AMDGPU_PP_SENSOR_GPU_POWER,
@@ -123,6 +120,9 @@  enum amd_pp_sensors {
         AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK,
         AMDGPU_PP_SENSOR_MIN_FAN_RPM,
         AMDGPU_PP_SENSOR_MAX_FAN_RPM,
+       AMDGPU_PP_SENSOR_EDGE_TEMP,
+       AMDGPU_PP_SENSOR_HOTSPOT_TEMP,
+       AMDGPU_PP_SENSOR_MEM_TEMP,
 };

 enum amd_pp_task {
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
index e32ae9d3373c..c6d8b399cc80 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
@@ -1130,6 +1130,7 @@  static int smu10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
                 *size = 4;
                 break;
         case AMDGPU_PP_SENSOR_GPU_TEMP:
+       case AMDGPU_PP_SENSOR_EDGE_TEMP:
                 *((uint32_t *)value) = smu10_thermal_get_temperature(hwmgr);
                 break;
         default:
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 10d66e3c7a9f..1195f86f86af 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3546,6 +3546,7 @@  static int smu7_read_sensor(struct pp_hwmgr *hwmgr, int idx,
                 *size = 4;
                 return 0;
         case AMDGPU_PP_SENSOR_GPU_TEMP:
+       case AMDGPU_PP_SENSOR_EDGE_TEMP:
                 *((uint32_t *)value) = smu7_thermal_get_temperature(hwmgr);
                 *size = 4;
                 return 0;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
index 019d6a206492..b2fc57dfb467 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
@@ -1769,6 +1769,7 @@  static int smu8_read_sensor(struct pp_hwmgr *hwmgr, int idx,
                 *((uint32_t *)value) = data->vce_power_gated ? 0 : 1;
                 return 0;
         case AMDGPU_PP_SENSOR_GPU_TEMP:
+       case AMDGPU_PP_SENSOR_EDGE_TEMP:
                 *((uint32_t *)value) = smu8_thermal_get_temperature(hwmgr);
                 return 0;
         default:
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index 1d9bb29adaef..a309aeed53ab 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -3794,6 +3794,7 @@  static int vega10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
                 *size = 4;
                 break;
         case AMDGPU_PP_SENSOR_GPU_TEMP:
+       case AMDGPU_PP_SENSOR_EDGE_TEMP:
                 *((uint32_t *)value) = vega10_thermal_get_temperature(hwmgr);
                 *size = 4;
                 break;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
index efb6d3762feb..69d1255db091 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
@@ -1368,6 +1368,7 @@  static int vega12_read_sensor(struct pp_hwmgr *hwmgr, int idx,
                         *size = 4;
                 break;
         case AMDGPU_PP_SENSOR_GPU_TEMP:
+       case AMDGPU_PP_SENSOR_EDGE_TEMP:
                 *((uint32_t *)value) = vega12_thermal_get_temperature(hwmgr);
                 *size = 4;
                 break;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
index f27c6fbb192e..172321f44940 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
@@ -2185,6 +2185,7 @@  static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx,
                 *((uint32_t *)value) = vega20_thermal_get_temperature(hwmgr);
                 *size = 4;
                 break;
+       case AMDGPU_PP_SENSOR_GPU_TEMP:
         case AMDGPU_PP_SENSOR_EDGE_TEMP:
                 ret = vega20_get_metrics_table(hwmgr, &metrics_table);
                 if (ret)
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index 0a53695785b6..35e5aa152ee1 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -1341,6 +1341,7 @@  static int navi10_thermal_get_temperature(struct smu_context *smu,
                 *value = metrics.TemperatureHotspot *
                         SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
                 break;
+       case AMDGPU_PP_SENSOR_GPU_TEMP:
         case AMDGPU_PP_SENSOR_EDGE_TEMP:
                 *value = metrics.TemperatureEdge *
                         SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
@@ -1384,6 +1385,7 @@  static int navi10_read_sensor(struct smu_context *smu,
                 break;
         case AMDGPU_PP_SENSOR_HOTSPOT_TEMP:
         case AMDGPU_PP_SENSOR_EDGE_TEMP:
+       case AMDGPU_PP_SENSOR_GPU_TEMP:
         case AMDGPU_PP_SENSOR_MEM_TEMP:
                 ret = navi10_thermal_get_temperature(smu, sensor, (uint32_t *)data);
                 *size = 4;
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
index b44ec7c670c5..55996f3a1883 100644
--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
@@ -3123,6 +3123,7 @@  static int vega20_thermal_get_temperature(struct smu_context *smu,

                 *value = temp;
                 break;
+       case AMDGPU_PP_SENSOR_GPU_TEMP:
         case AMDGPU_PP_SENSOR_EDGE_TEMP:
                 *value = metrics.TemperatureEdge *
                         SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
@@ -3166,6 +3167,7 @@  static int vega20_read_sensor(struct smu_context *smu,
                 *size = 4;
                 break;
         case AMDGPU_PP_SENSOR_HOTSPOT_TEMP:
+       case AMDGPU_PP_SENSOR_GPU_TEMP:
         case AMDGPU_PP_SENSOR_EDGE_TEMP:
         case AMDGPU_PP_SENSOR_MEM_TEMP:
                 ret = vega20_thermal_get_temperature(smu, sensor, (uint32_t *)data);