drm/amd/pm: enable GPO feature support for SMU13.0.0
Subsystems (3)
PATCH 1/4 drm/amd/pm: enable GPO feature support for SMU13.0.0
The feature is ready with latest firmwares.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +2 -0
@@ -310,6 +310,8 @@ smu_v13_0_0_get_allowed_feature_mask(struct smu_context *smu, *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_VR0HOT_BIT ); + *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_DPM_GFX_POWER_OPTIMIZER_BIT ); +return 0 ; }
Signature · 1 line
2.29.0
PATCH 2/4 drm/amd/pm: update SMU13.0.0 driver_if header
To fit the latest 78.49.0 PMFW. Also, bump the version to 0x2B.
--- .../drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h | 4 ++-- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h +2 -2
@@ -973,8 +973,8 @@ typedef struct {uint16_t Vmin_Hot_Eol[PMFW_VOLT_PLANE_COUNT ];//In mV(Q2) End-of-life Vset to be used at hot. uint16_t Vmin_Cold_Eol[PMFW_VOLT_PLANE_COUNT ];//In mV(Q2) End-of-life Vset to be used at cold. uint16_t Vmin_Aging_Offset[PMFW_VOLT_PLANE_COUNT ];//In mV(Q2) Worst-case aging margin -uint16_t Vmin_Plat_Offset_Hot[PMFW_VOLT_PLANE_COUNT ];//In mV(Q2) Platform offset apply to T0 Hot -uint16_t Vmin_Plat_Offset_Cold[PMFW_VOLT_PLANE_COUNT ];//In mV(Q2) Platform offset apply to T0 Cold +uint16_t Spare_Vmin_Plat_Offset_Hot[PMFW_VOLT_PLANE_COUNT ];//In mV(Q2) Platform offset apply to T0 Hot +uint16_t Spare_Vmin_Plat_Offset_Cold[PMFW_VOLT_PLANE_COUNT ];//In mV(Q2) Platform offset apply to T0 Cold //This is a fixed/minimum VMIN aging degradation offset which is applied at T0. This reflects the minimum amount of aging already accounted for. uint16_t VcBtcFixedVminAgingOffset[PMFW_VOLT_PLANE_COUNT ];
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +1 -1
@@ -30,7 +30,7 @@#define SMU13_DRIVER_IF_VERSION_ALDE 0x08#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_4 0x04#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_5 0x04 -#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0 0x2A +#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0 0x2B#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x2A#define SMU13_MODE1_RESET_WAIT_TIME_IN_MS 500 //500ms
Signature · 1 line
2.29.0
PATCH 3/4 drm/amd/pm: correct smu 13.0.0/7 mp1 state setup
In reply to Evan QuanOnly PP_MP1_STATE_UNLOAD is supported for now. For other mp1 state, we should just ignore it. Otherwise, there will be errors coming out.
--- .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 19 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +18 -1
@@ -1608,6 +1608,23 @@ static bool smu_v13_0_0_is_mode1_reset_supported(struct smu_context *smu)return true; } +static int smu_v13_0_0_set_mp1_state (struct smu_context *smu, +enum pp_mp1_state mp1_state) +{ +int ret; + +switch (mp1_state) { +case PP_MP1_STATE_UNLOAD : + ret =smu_cmn_set_mp1_state (smu, mp1_state); +break ; +default : +/* Ignore others */ + ret =0 ; + } + +return ret; +} +static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { .get_allowed_feature_mask = smu_v13_0_0_get_allowed_feature_mask, .set_default_dpm_table = smu_v13_0_0_set_default_dpm_table,
@@ -1672,7 +1689,7 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { .baco_exit = smu_v13_0_baco_exit, .mode1_reset_is_support = smu_v13_0_0_is_mode1_reset_supported, .mode1_reset = smu_v13_0_mode1_reset, - .set_mp1_state = smu_cmn_set_mp1_state, + .set_mp1_state = smu_v13_0_0_set_mp1_state, };void smu_v13_0_0_set_ppt_funcs (struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +18 -1
@@ -1554,6 +1554,23 @@ static int smu_v13_0_7_set_power_profile_mode(struct smu_context *smu, long *inpreturn ret; } +static int smu_v13_0_7_set_mp1_state (struct smu_context *smu, +enum pp_mp1_state mp1_state) +{ +int ret; + +switch (mp1_state) { +case PP_MP1_STATE_UNLOAD : + ret =smu_cmn_set_mp1_state (smu, mp1_state); +break ; +default : +/* Ignore others */ + ret =0 ; + } + +return ret; +} +static const struct pptable_funcs smu_v13_0_7_ppt_funcs = { .get_allowed_feature_mask = smu_v13_0_7_get_allowed_feature_mask, .set_default_dpm_table = smu_v13_0_7_set_default_dpm_table,
@@ -1611,7 +1628,7 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = { .baco_set_state = smu_v13_0_baco_set_state, .baco_enter = smu_v13_0_baco_enter, .baco_exit = smu_v13_0_baco_exit, - .set_mp1_state = smu_cmn_set_mp1_state, + .set_mp1_state = smu_v13_0_7_set_mp1_state, };void smu_v13_0_7_set_ppt_funcs (struct smu_context *smu)
Signature · 1 line
2.29.0
PATCH 4/4 drm/amd/pm: revise the driver reloading fix for SMU 13.0.0 and 13.0.7
In reply to Evan QuanThe current approach breaks S3/S4 as asic reset is needed for them. And putting SMU out of service(via SMU_MSG_PrepareMp1ForUnload) will make that(asic reset) failed. Considering with current designs, there is actually also asic reset involved on driver reloading. That can make asic back to a clean state. So, the SMU_MSG_PrepareMp1ForUnload operation will be not so necessary. Thus we will just drop the SMU_MSG_PrepareMp1ForUnload operation. We may revise the whole driver reloading sequences when there is a better design.
--v1->v2:
- limit the impacts to legacy ASICs(Hawking)
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -7
@@ -1415,13 +1415,6 @@ static int smu_disable_dpms(struct smu_context *smu)switch (adev->ip_versions[MP1_HWIP ][0 ]) {case IP_VERSION (13 ,0 ,0 ):case IP_VERSION (13 ,0 ,7 ): -if (!(adev->in_runpm ||amdgpu_in_reset (adev))) { - ret =smu_set_mp1_state (smu,PP_MP1_STATE_UNLOAD ); -if (ret) { -dev_err (adev->dev,"Fail set mp1 state to UNLOAD!\n" ); -return ret; - } - }return 0 ;default :break ;
Signature · 1 line
2.29.0