drm/amd/powerplay: avoid repeat AVFS enablement/disablement
authorEvan Quan <evan.quan@amd.com>
Mon, 6 May 2019 08:45:13 +0000 (16:45 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:20:52 +0000 (12:20 -0500)
No need to enable or disable AVFS if it's already in wanted
state.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c

index 05f6bf7d703e86f9ec5e91907c83532af08032be..eb9023f02ffa5c91b7dfe7936df8d35582153c1a 100644 (file)
@@ -2364,6 +2364,10 @@ static int vega10_avfs_enable(struct pp_hwmgr *hwmgr, bool enable)
        struct vega10_hwmgr *data = hwmgr->backend;
 
        if (data->smu_features[GNLD_AVFS].supported) {
+               /* Already enabled or disabled */
+               if (!(enable ^ data->smu_features[GNLD_AVFS].enabled))
+                       return 0;
+
                if (enable) {
                        PP_ASSERT_WITH_CODE(!vega10_enable_smc_features(hwmgr,
                                        true,