drm/amdgpu: implement ENABLED_SMC_FEATURES_MASK sensor for vega10
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Sep 2018 03:34:42 +0000 (22:34 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Sep 2018 02:09:10 +0000 (21:09 -0500)
So we can query what features are enabled for debugging.

Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h

index f32951f8c6884bd840b9f911443537c4bcd8bdfa..419a1d77d661e3708fded47180ce2b532592a087 100644 (file)
@@ -3714,6 +3714,11 @@ static int vega10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
                        SMUSVI0_PLANE0_CURRENTVID__CURRENT_SVI0_PLANE0_VID__SHIFT;
                *((uint32_t *)value) = (uint32_t)convert_to_vddc((uint8_t)val_vid);
                return 0;
+       case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK:
+               ret = vega10_get_enabled_smc_features(hwmgr, (uint64_t *)value);
+               if (!ret)
+                       *size = 8;
+               break;
        default:
                ret = -EINVAL;
                break;
index 8176d3371e703651fc1e21b72c46f28bb07b2841..c81acc3192ad2acc3b98bdfe6308f1a942862b5c 100644 (file)
@@ -98,8 +98,8 @@ int vega10_enable_smc_features(struct pp_hwmgr *hwmgr,
                        msg, feature_mask);
 }
 
-static int vega10_get_smc_features(struct pp_hwmgr *hwmgr,
-               uint32_t *features_enabled)
+int vega10_get_enabled_smc_features(struct pp_hwmgr *hwmgr,
+                           uint64_t *features_enabled)
 {
        if (features_enabled == NULL)
                return -EINVAL;
@@ -112,9 +112,9 @@ static int vega10_get_smc_features(struct pp_hwmgr *hwmgr,
 
 static bool vega10_is_dpm_running(struct pp_hwmgr *hwmgr)
 {
-       uint32_t features_enabled = 0;
+       uint64_t features_enabled = 0;
 
-       vega10_get_smc_features(hwmgr, &features_enabled);
+       vega10_get_enabled_smc_features(hwmgr, &features_enabled);
 
        if (features_enabled & SMC_DPM_FEATURES)
                return true;
index 630c0ae4c03d8f8372f894f484bb0d3064437f8d..bad760f22624d5c8362a84b8c32da79c4915bade 100644 (file)
@@ -44,6 +44,8 @@ struct vega10_smumgr {
 
 int vega10_enable_smc_features(struct pp_hwmgr *hwmgr,
                               bool enable, uint32_t feature_mask);
+int vega10_get_enabled_smc_features(struct pp_hwmgr *hwmgr,
+                                   uint64_t *features_enabled);
 
 #endif