drm/amd/powerplay: add STABLE_PSTATE_SCLK and STABLE_PSTATE_MCLK when read sensor...
authorChengming Gui <Jack.Gui@amd.com>
Thu, 24 Jan 2019 09:50:57 +0000 (17:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:04:01 +0000 (15:04 -0500)
add AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK and
AMDGPU_PP_SENSOR_STABLE_PSTATE_MCLK to support
read sensor for SMU11.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Kevin Wang <kevink1.wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index ed2d1996455eee2715cef110085e3a00a046a898..60491d1f674a952154e0ce847fc58b65708801a0 100644 (file)
@@ -73,6 +73,14 @@ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
        int ret = 0;
 
        switch (sensor) {
+       case AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK:
+               *((uint32_t *)data) = smu->pstate_sclk;
+               *size = 4;
+               break;
+       case AMDGPU_PP_SENSOR_STABLE_PSTATE_MCLK:
+               *((uint32_t *)data) = smu->pstate_mclk;
+               *size = 4;
+               break;
        case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK:
                ret = smu_feature_get_enabled_mask(smu, (uint32_t *)data, 2);
                *size = 8;