diff options
author | Evan Quan <evan.quan@amd.com> | 2020-02-12 11:52:20 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-02-13 16:16:45 -0500 |
commit | c16904b0f305c5f6bc31de118d4b1e60a5da5408 (patch) | |
tree | fc5bd5793bee30fce27d41de982ffd7335b81943 /drivers | |
parent | 434cbcb1bd5dea181e6e2379f9f4d4949b51d445 (diff) | |
download | linux-stable-c16904b0f305c5f6bc31de118d4b1e60a5da5408.tar.gz linux-stable-c16904b0f305c5f6bc31de118d4b1e60a5da5408.tar.bz2 linux-stable-c16904b0f305c5f6bc31de118d4b1e60a5da5408.zip |
drm/amd/powerplay: correct the way for checking SMU_FEATURE_BACO_BIT support
Since 'smu_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)' will always return
false considering the 'smu_system_features_control(smu, false)' disabled
all SMU features.
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index 4720aa58a150..9f2428fd98f6 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -1488,7 +1488,18 @@ static int smu_disable_dpm(struct smu_context *smu) /* For baco, need to leave BACO feature enabled */ if (use_baco) { - if (smu_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)) { + /* + * Correct the way for checking whether SMU_FEATURE_BACO_BIT + * is supported. + * + * Since 'smu_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)' will + * always return false as the 'smu_system_features_control(smu, false)' + * was just issued above which disabled all SMU features. + * + * Thus 'smu_feature_get_index(smu, SMU_FEATURE_BACO_BIT)' is used + * now for the checking. + */ + if (smu_feature_get_index(smu, SMU_FEATURE_BACO_BIT) >= 0) { ret = smu_feature_set_enabled(smu, SMU_FEATURE_BACO_BIT, true); if (ret) { pr_warn("set BACO feature enabled failed, return %d\n", ret); |