Skip to content

Commit

Permalink
drm/amd/pm: move NAVI1X power mode switching workaround to post_init
Browse files Browse the repository at this point in the history
Since that should be the correct place to put ASIC specific
workarounds.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Evan Quan authored and Alex Deucher committed Sep 17, 2020
1 parent 236b156 commit 1653a17
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
14 changes: 0 additions & 14 deletions drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,20 +1013,6 @@ static int smu_smc_hw_setup(struct smu_context *smu)
return ret;
}

if (!smu->dc_controlled_by_gpio) {
/*
* For Navi1X, manually switch it to AC mode as PMFW
* may boot it with DC mode.
*/
ret = smu_set_power_source(smu,
adev->pm.ac_power ? SMU_POWER_SOURCE_AC :
SMU_POWER_SOURCE_DC);
if (ret) {
dev_err(adev->dev, "Failed to switch to %s mode!\n", adev->pm.ac_power ? "AC" : "DC");
return ret;
}
}

ret = smu_notify_display_change(smu);
if (ret)
return ret;
Expand Down
20 changes: 19 additions & 1 deletion drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2661,8 +2661,26 @@ static int navi10_post_smu_init(struct smu_context *smu)
}

ret = navi10_run_umc_cdr_workaround(smu);
if (ret)
if (ret) {
dev_err(adev->dev, "Failed to apply umc cdr workaround!\n");
return ret;
}

if (!smu->dc_controlled_by_gpio) {
/*
* For Navi1X, manually switch it to AC mode as PMFW
* may boot it with DC mode.
*/
ret = smu_v11_0_set_power_source(smu,
adev->pm.ac_power ?
SMU_POWER_SOURCE_AC :
SMU_POWER_SOURCE_DC);
if (ret) {
dev_err(adev->dev, "Failed to switch to %s mode!\n",
adev->pm.ac_power ? "AC" : "DC");
return ret;
}
}

return ret;
}
Expand Down

0 comments on commit 1653a17

Please sign in to comment.