drm/amd/powerplay: move read sensor of UVD[VCE]_POWER to amdgpu_smu file
authorKevin Wang <kevin1.wang@amd.com>
Tue, 23 Apr 2019 03:20:46 +0000 (11:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Jun 2019 23:59:30 +0000 (18:59 -0500)
This part of code is asic unrelated and moves to top code level.

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

index 6183b8f6d6c19f0f1697344a98dddf3c48030ea1..6a6f36006f804fae4726643a199754138e83aa3a 100644 (file)
@@ -255,6 +255,14 @@ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
                ret = smu_feature_get_enabled_mask(smu, (uint32_t *)data, 2);
                *size = 8;
                break;
+       case AMDGPU_PP_SENSOR_UVD_POWER:
+               *(uint32_t *)data = smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UVD_BIT) ? 1 : 0;
+               *size = 4;
+               break;
+       case AMDGPU_PP_SENSOR_VCE_POWER:
+               *(uint32_t *)data = smu_feature_is_enabled(smu, SMU_FEATURE_DPM_VCE_BIT) ? 1 : 0;
+               *size = 4;
+               break;
        default:
                ret = -EINVAL;
                break;
index 63697fd3445f1acb05602b679354ae808254dcfc..d4379c99489c3c8ebb1f08d2cbc5dceb0338bc08 100644 (file)
@@ -2946,14 +2946,6 @@ static int vega20_read_sensor(struct smu_context *smu,
        PPTable_t *pptable = table_context->driver_pptable;
 
        switch (sensor) {
-       case AMDGPU_PP_SENSOR_UVD_POWER:
-               *(uint32_t *)data = smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UVD_BIT) ? 1 : 0;
-               *size = 4;
-               break;
-       case AMDGPU_PP_SENSOR_VCE_POWER:
-               *(uint32_t *)data = smu_feature_is_enabled(smu, SMU_FEATURE_DPM_VCE_BIT) ? 1 : 0;
-               *size = 4;
-               break;
        case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
                *(uint32_t *)data = pptable->FanMaximumRpm;
                *size = 4;