Skip to content

Commit

Permalink
drm/amdgpu/swSMU: handle DC controlled by GPIO for navi1x
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Deucher committed Mar 25, 2020
1 parent 75610fd commit f5cdd2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion drivers/gpu/drm/amd/powerplay/navi10_ppt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f5cdd2b

Please sign in to comment.