OSDN Git Service

drm/amdgpu/swSMU: handle DC controlled by GPIO for navi1x
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 20 Mar 2020 16:37:23 +0000 (12:37 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 25 Mar 2020 21:00:11 +0000 (17:00 -0400)
Check the platform caps in the vbios pptable to decide
whether to enable automatic AC/DC transitions.

Bug: https://gitlab.freedesktop.org/drm/amd/issues/1043
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
drivers/gpu/drm/amd/powerplay/navi10_ppt.c

index 323e7e6..18172df 100644 (file)
@@ -408,6 +408,7 @@ struct smu_context
        uint32_t smc_if_version;
 
        bool uploading_custom_pp_table;
+       bool dc_controlled_by_gpio;
 };
 
 struct i2c_adapter;
index a23eaac..9c60b38 100644 (file)
@@ -347,7 +347,6 @@ navi10_get_allowed_feature_mask(struct smu_context *smu,
                                | FEATURE_MASK(FEATURE_DS_DCEFCLK_BIT)
                                | FEATURE_MASK(FEATURE_FW_DSTATE_BIT)
                                | FEATURE_MASK(FEATURE_BACO_BIT)
-                               | FEATURE_MASK(FEATURE_ACDC_BIT)
                                | FEATURE_MASK(FEATURE_GFX_SS_BIT)
                                | FEATURE_MASK(FEATURE_APCC_DFLL_BIT)
                                | FEATURE_MASK(FEATURE_FW_CTF_BIT)
@@ -391,6 +390,9 @@ navi10_get_allowed_feature_mask(struct smu_context *smu,
        if (smu->adev->pg_flags & AMD_PG_SUPPORT_JPEG)
                *(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_JPEG_PG_BIT);
 
+       if (smu->dc_controlled_by_gpio)
+               *(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_ACDC_BIT);
+
        /* disable DPM UCLK and DS SOCCLK on navi10 A0 secure board */
        if (is_asic_secure(smu)) {
                /* only for navi10 A0 */
@@ -525,6 +527,9 @@ static int navi10_store_powerplay_table(struct smu_context *smu)
 
        table_context->thermal_controller_type = powerplay_table->thermal_controller_type;
 
+       if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_HARDWAREDC)
+               smu->dc_controlled_by_gpio = true;
+
        mutex_lock(&smu_baco->mutex);
        if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
            powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO)