drm/amd/powerplay: implement sensor of uvd & vce power state for smu11
authorKevin Wang <kevin1.wang@amd.com>
Fri, 25 Jan 2019 08:22:20 +0000 (16:22 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:04:00 +0000 (15:04 -0500)
add functions of uvd & vce for hwmon.

Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/smu_v11_0.c

index cdaf23f8201615234a5dd17fdb53aaf820564bad..3ebf89b3f8151f4151c53a322ada62601e71d575 100644 (file)
@@ -1119,6 +1119,14 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,
                ret = smu_v11_0_get_gfx_vdd(smu, (uint32_t *)data);
                *size = 4;
                break;
+       case AMDGPU_PP_SENSOR_UVD_POWER:
+               *(uint32_t *)data = smu_feature_is_enabled(smu, FEATURE_DPM_UVD_BIT) ? 1 : 0;
+               *size = 4;
+               break;
+       case AMDGPU_PP_SENSOR_VCE_POWER:
+               *(uint32_t *)data = smu_feature_is_enabled(smu, FEATURE_DPM_VCE_BIT) ? 1 : 0;
+               *size = 4;
+               break;
        default:
                ret = smu_common_read_sensor(smu, sensor, data, size);
                break;