drm/amd/pm: update pmfw headers for version 85.73.0
Subsystems (3)
PATCH 1/7 drm/amd/pm: update pmfw headers for version 85.73.0
To add message to select PLPD mode.
--- drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h +5 -0
@@ -90,6 +90,7 @@#define PPSMC_MSG_ClearMcaOnRead 0x39#define PPSMC_MSG_QueryValidMcaCeCount 0x3A#define PPSMC_MSG_McaBankCeDumpDW 0x3B +#define PPSMC_MSG_SelectPLPDMode 0x40#define PPSMC_Message_Count 0x41//PPSMC Reset Types for driver msg argument
@@ -107,6 +108,10 @@#define PPSMC_XCD_THM_TYPE 0x3#define PPSMC_HBM_THM_TYPE 0x4 +//PLPD modes +#define PPSMC_PLPD_MODE_DEFAULT 0x1 +#define PPSMC_PLPD_MODE_OPTIMIZED 0x2 +typedef uint32_t PPSMC_Result ;typedef uint32_t PPSMC_MSG ;
Signature · 1 line
2.38.1
PATCH 2/7 drm/amd/pm: add plpd_mode in smu_context to indicate current mode
Add enum pp_xgmi_plpd_mode to describe PLPD policies.
v2: move the enum from amdgpu_smu.h to kgd_pp_interface.h
--- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 8 ++++++++ drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 2 ++ 2 files changed, 10 insertions(+)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +8 -0
@@ -265,6 +265,14 @@ enum pp_power_type PP_PWR_TYPE_FAST, }; +enum pp_xgmi_plpd_mode { +XGMI_PLPD_NONE =-1 , +XGMI_PLPD_DISALLOW , +XGMI_PLPD_DEFAULT , +XGMI_PLPD_OPTIMIZED , +XGMI_PLPD_COUNT , +}; +#define PP_GROUP_MASK 0xF0000000#define PP_GROUP_SHIFT 28
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +2 -0
@@ -563,6 +563,8 @@ struct smu_context {u32 debug_resp_reg;struct delayed_work swctf_delayed_work; + +enum pp_xgmi_plpd_mode plpd_mode; };struct i2c_adapter ;
Signature · 1 line
2.38.1
PATCH 3/7 drm/amd/pm: add xgmi plpd mode selecting interface for smu v13.0.6
In reply to Le MaAdd the interface to change xgmi per-link power down policy.
v2: split from sysfs interface code and miscellaneous updates
v3: check against XGMI_PLPD_DEFAULT/XGMI_PLPD_OPTIMIZED and pass PPSMC param
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 24 ++++++++++++++ drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 9 ++++++ drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 +- .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 31 +++++++++++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +24 -0
@@ -3157,6 +3157,30 @@ static int smu_get_prv_buffer_details(void *handle, void **addr, size_t *size)return 0 ; } +int smu_set_xgmi_plpd_mode (struct smu_context *smu, +enum pp_xgmi_plpd_mode mode) +{ +int ret = -EOPNOTSUPP ; + +if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled) +return ret; + +/* PLPD policy is not supported if it's NONE */ +if (smu->plpd_mode ==XGMI_PLPD_NONE ) +return ret; + +if (smu->plpd_mode == mode) +return 0 ; + +if (smu->ppt_funcs && smu->ppt_funcs->select_xgmi_plpd_policy) + ret = smu->ppt_funcs->select_xgmi_plpd_policy (smu, mode); + +if (!ret) + smu->plpd_mode = mode; + +return ret; +} +static const struct amd_pm_funcs swsmu_pm_funcs = {/* export for sysfs */ .set_fan_control_mode = smu_set_fan_control_mode,
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +9 -0
@@ -840,6 +840,12 @@ struct pptable_funcs {*/ int (*allow_xgmi_power_down)(struct smu_context *smu,bool en); +/** +* @select_xgmi_plpd_policy: Select xgmi per-link power down policy. +*/ +int (*select_xgmi_plpd_policy)(struct smu_context *smu, +enum pp_xgmi_plpd_mode mode); +/** * @update_pcie_parameters: Update and upload the system's PCIe * capabilites to the SMU.
@@ -1487,6 +1493,9 @@ int smu_set_ac_dc(struct smu_context *smu);int smu_allow_xgmi_power_down (struct smu_context *smu,bool en); +int smu_set_xgmi_plpd_mode (struct smu_context *smu, +enum pp_xgmi_plpd_mode mode); +int smu_get_entrycount_gfxoff (struct smu_context *smu,u64 *value);int smu_get_residency_gfxoff (struct smu_context *smu,u32 *value);
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +2 -1
@@ -252,7 +252,8 @@__SMU_DUMMY_MAP (QueryValidMcaCount), \__SMU_DUMMY_MAP (QueryValidMcaCeCount), \__SMU_DUMMY_MAP (McaBankDumpDW), \ -__SMU_DUMMY_MAP (McaBankCeDumpDW), +__SMU_DUMMY_MAP (McaBankCeDumpDW), \ +__SMU_DUMMY_MAP (SelectPLPDMode), #undef __SMU_DUMMY_MAP#define __SMU_DUMMY_MAP (type) SMU_MSG_##type
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +31 -0
@@ -170,6 +170,7 @@ static const struct cmn2asic_msg_mapping smu_v13_0_6_message_map[SMU_MSG_MAX_COUMSG_MAP (QueryValidMcaCeCount, PPSMC_MSG_QueryValidMcaCeCount,0 ),MSG_MAP (McaBankDumpDW, PPSMC_MSG_McaBankDumpDW,0 ),MSG_MAP (McaBankCeDumpDW, PPSMC_MSG_McaBankCeDumpDW,0 ), + MSG_MAP(SelectPLPDMode, PPSMC_MSG_SelectPLPDMode, 0), }; static const struct cmn2asic_mapping smu_v13_0_6_clk_map[SMU_CLK_COUNT] = {
@@ -2716,6 +2717,35 @@ static const struct amdgpu_mca_smu_funcs smu_v13_0_6_mca_smu_funcs = { .mca_get_ras_mca_idx_array = mca_smu_get_ras_mca_idx_array, }; +static int smu_v13_0_6_select_xgmi_plpd_policy (struct smu_context *smu, +enum pp_xgmi_plpd_mode mode) +{ +struct amdgpu_device *adev = smu->adev; +int ret, param; + +switch (mode) { +case XGMI_PLPD_DEFAULT : + param =PPSMC_PLPD_MODE_DEFAULT ; +break ; +case XGMI_PLPD_OPTIMIZED : + param =PPSMC_PLPD_MODE_OPTIMIZED ; +break ; +default : +return -EINVAL ; + } + +/* change xgmi per-link power down policy */ + ret =smu_cmn_send_smc_msg_with_param ( + smu, SMU_MSG_SelectPLPDMode, param,NULL ); + +if (ret) +dev_err (adev->dev, +"select xgmi per-link power down policy %d failed\n" , + mode); + +return ret; +} +static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {/* init dpm */ .get_allowed_feature_mask = smu_v13_0_6_get_allowed_feature_mask,
@@ -2756,6 +2786,7 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = { .od_edit_dpm_table = smu_v13_0_6_usr_edit_dpm_table, .set_df_cstate = smu_v13_0_6_set_df_cstate, .allow_xgmi_power_down = smu_v13_0_6_allow_xgmi_power_down, + .select_xgmi_plpd_policy = smu_v13_0_6_select_xgmi_plpd_policy, .log_thermal_throttling_event = smu_v13_0_6_log_thermal_throttling_event, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask, .get_gpu_metrics = smu_v13_0_6_get_gpu_metrics,
Signature · 1 line
2.38.1
PATCH 5/7 drm/amd/pm: init plpd_mode properly for different asics
In reply to Le MaAssign DEFAULT mode if it supports plpd, otherwise keeps NONE
v2: reduce ip version checks
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +17 -0
@@ -1130,6 +1130,21 @@ static void smu_swctf_delayed_work_handler(struct work_struct *work)orderly_poweroff (true); } +static void smu_init_xgmi_plpd_mode (struct smu_context *smu) +{ +if (amdgpu_ip_version (smu->adev,MP1_HWIP ,0 ) ==IP_VERSION (11 ,0 ,2 )) { + smu->plpd_mode =XGMI_PLPD_DEFAULT ; +return ; + } + +/* PMFW put PLPD into default policy after enabling the feature */ +if (smu_feature_is_enabled (smu, +SMU_FEATURE_XGMI_PER_LINK_PWR_DWN_BIT )) + smu->plpd_mode =XGMI_PLPD_DEFAULT ; +else + smu->plpd_mode =XGMI_PLPD_NONE ; +} +static int smu_sw_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1361,6 +1376,8 @@ static int smu_smc_hw_setup(struct smu_context *smu)return ret; } +smu_init_xgmi_plpd_mode (smu); + ret =smu_feature_get_enabled_mask (smu, &features_supported);if (ret) {dev_err (adev->dev,"Failed to retrieve supported dpm features!\n" );
Signature · 1 line
2.38.1
PATCH 4/7 drm/amd/pm: add xgmi_plpd_policy sysfs node for user to change plpd policy
In reply to Le MaAdd xgmi_plpd_policy sysfs node for users to check and select xgmi per-link power down policy:
- arg 0: disallow plpd
- arg 1: default policy
- arg 2: optimized policy
v2: split from smu v13.0.6 code and miscellaneous updates
v3: add usage comments around set/get functions
--- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 43 ++++++++++++++++ drivers/gpu/drm/amd/pm/amdgpu_pm.c | 68 +++++++++++++++++++++++++ drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 5 ++ 3 files changed, 116 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +43 -0
@@ -365,6 +365,49 @@ int amdgpu_dpm_allow_xgmi_power_down(struct amdgpu_device *adev, bool en)return ret; } +int amdgpu_dpm_get_xgmi_plpd_mode (struct amdgpu_device *adev,char **mode_desc) +{ +struct smu_context *smu = adev->powerplay.pp_handle; +int mode =XGMI_PLPD_NONE ; + +if (is_support_sw_smu (adev)) { + mode = smu->plpd_mode; +if (mode_desc ==NULL ) +return mode; +switch (smu->plpd_mode) { +case XGMI_PLPD_DISALLOW : + *mode_desc ="disallow" ; +break ; +case XGMI_PLPD_DEFAULT : + *mode_desc ="default" ; +break ; +case XGMI_PLPD_OPTIMIZED : + *mode_desc ="optimized" ; +break ; +case XGMI_PLPD_NONE : +default : + *mode_desc ="none" ; +break ; + } + } + +return mode; +} + +int amdgpu_dpm_set_xgmi_plpd_mode (struct amdgpu_device *adev,int mode) +{ +struct smu_context *smu = adev->powerplay.pp_handle; +int ret = -EOPNOTSUPP ; + +if (is_support_sw_smu (adev)) { +mutex_lock (&adev->pm.mutex); + ret =smu_set_xgmi_plpd_mode (smu, mode); +mutex_unlock (&adev->pm.mutex); + } + +return ret; +} +int amdgpu_dpm_enable_mgpu_fan_boost (struct amdgpu_device *adev) {void *pp_handle = adev->powerplay.pp_handle;
drivers/gpu/drm/amd/pm/amdgpu_pm.c +68 -0
86 lines not on this page · raw message
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +5 -0
@@ -426,6 +426,11 @@ int amdgpu_dpm_set_df_cstate(struct amdgpu_device *adev,int amdgpu_dpm_allow_xgmi_power_down (struct amdgpu_device *adev,bool en); +int amdgpu_dpm_get_xgmi_plpd_mode (struct amdgpu_device *adev, +char **mode); + +int amdgpu_dpm_set_xgmi_plpd_mode (struct amdgpu_device *adev,int mode); +int amdgpu_dpm_enable_mgpu_fan_boost (struct amdgpu_device *adev); int amdgpu_dpm_set_clockgating_by_smu(struct amdgpu_device *adev,
Signature · 1 line
2.38.1
PATCH 6/7 drm/amd/pm: integrate plpd allow/disallow into select_xgmi_plpd_policy in ppt level
In reply to Le MaThe allow_xgmi_power_down(true/false) will be generally replaced by:
- allow: select_xgmi_plpd_policy(XGMI_PLPD_DEFAULT)
- disallow: select_xgmi_plpd_policy(XGMI_PLPD_DISALLOW)
--- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 21 +++++++++-------- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 23 ++++++++++++------- .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 22 ++++++++++-------- 3 files changed, 38 insertions(+), 28 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +11 -10
@@ -2227,7 +2227,8 @@ static int arcturus_set_df_cstate(struct smu_context *smu,return smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_DFCstateControl, state,NULL ); } -static int arcturus_allow_xgmi_power_down (struct smu_context *smu,bool en) +static int arcturus_select_xgmi_plpd_policy (struct smu_context *smu, +enum pp_xgmi_plpd_mode mode) {uint32_t smu_version;int ret;
@@ -2244,16 +2245,16 @@ static int arcturus_allow_xgmi_power_down(struct smu_context *smu, bool en)return -EINVAL ; } -if (en) +if (mode ==XGMI_PLPD_DEFAULT )return smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_GmiPwrDnControl, -1 , -NULL ); - -return smu_cmn_send_smc_msg_with_param (smu, - SMU_MSG_GmiPwrDnControl, -0 , -NULL ); +1 ,NULL ); +else if (mode ==XGMI_PLPD_DISALLOW ) +return smu_cmn_send_smc_msg_with_param (smu, + SMU_MSG_GmiPwrDnControl, +0 ,NULL ); +else +return -EINVAL ; } static const struct throttling_logging_label {
@@ -2455,7 +2456,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = { .get_dpm_ultimate_freq = smu_v11_0_get_dpm_ultimate_freq, .set_soft_freq_limited_range = smu_v11_0_set_soft_freq_limited_range, .set_df_cstate = arcturus_set_df_cstate, - .allow_xgmi_power_down = arcturus_allow_xgmi_power_down, + .select_xgmi_plpd_policy = arcturus_select_xgmi_plpd_policy, .log_thermal_throttling_event = arcturus_log_thermal_throttling_event, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask, .set_pp_feature_mask = smu_cmn_set_pp_feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +15 -8
@@ -1604,20 +1604,27 @@ static int aldebaran_set_df_cstate(struct smu_context *smu,return smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_DFCstateControl, state,NULL ); } -static int aldebaran_allow_xgmi_power_down (struct smu_context *smu,bool en) +static int aldebaran_select_xgmi_plpd_policy (struct smu_context *smu, +enum pp_xgmi_plpd_mode mode) {struct amdgpu_device *adev = smu->adev;/* The message only works on master die and NACK will be sent back for other dies, only send it on master die */ -if (!adev->smuio.funcs->get_socket_id (adev) && - !adev->smuio.funcs->get_die_id (adev)) +if (adev->smuio.funcs->get_socket_id (adev) || + adev->smuio.funcs->get_die_id (adev)) +return 0 ; + +if (mode ==XGMI_PLPD_DEFAULT ) +return smu_cmn_send_smc_msg_with_param (smu, + SMU_MSG_GmiPwrDnControl, +0 ,NULL ); +else if (mode ==XGMI_PLPD_DISALLOW )return smu_cmn_send_smc_msg_with_param (smu, - SMU_MSG_GmiPwrDnControl, - en ?0 :1 , -NULL ); + SMU_MSG_GmiPwrDnControl, +1 ,NULL );else -return 0 ; +return -EINVAL ; } static const struct throttling_logging_label {
@@ -2072,7 +2079,7 @@ static const struct pptable_funcs aldebaran_ppt_funcs = { .set_soft_freq_limited_range = aldebaran_set_soft_freq_limited_range, .od_edit_dpm_table = aldebaran_usr_edit_dpm_table, .set_df_cstate = aldebaran_set_df_cstate, - .allow_xgmi_power_down = aldebaran_allow_xgmi_power_down, + .select_xgmi_plpd_policy = aldebaran_select_xgmi_plpd_policy, .log_thermal_throttling_event = aldebaran_log_thermal_throttling_event, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask, .set_pp_feature_mask = smu_cmn_set_pp_feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +12 -10
@@ -1897,12 +1897,6 @@ static int smu_v13_0_6_set_df_cstate(struct smu_context *smu, state, NULL); } -static int smu_v13_0_6_allow_xgmi_power_down (struct smu_context *smu,bool en) -{ -return smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_GmiPwrDnControl, - en ?0 :1 ,NULL ); -} -static const char *const throttling_logging_label[] = { [THROTTLER_PROCHOT_BIT ] ="Prochot" , [THROTTLER_PPT_BIT ] ="PPT" ,
@@ -2730,13 +2724,22 @@ static int smu_v13_0_6_select_xgmi_plpd_policy(struct smu_context *smu,case XGMI_PLPD_OPTIMIZED : param =PPSMC_PLPD_MODE_OPTIMIZED ;break ; +case XGMI_PLPD_DISALLOW : + param =0 ; +break ;default :return -EINVAL ; } -/* change xgmi per-link power down policy */ - ret =smu_cmn_send_smc_msg_with_param ( - smu, SMU_MSG_SelectPLPDMode, param,NULL ); +if (mode ==XGMI_PLPD_DISALLOW ) + ret =smu_cmn_send_smc_msg_with_param (smu, + SMU_MSG_GmiPwrDnControl, + param,NULL ); +else +/* change xgmi per-link power down policy */ + ret =smu_cmn_send_smc_msg_with_param (smu, + SMU_MSG_SelectPLPDMode, + param,NULL );if (ret) dev_err(adev->dev,
@@ -2785,7 +2788,6 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = { .set_soft_freq_limited_range = smu_v13_0_6_set_soft_freq_limited_range, .od_edit_dpm_table = smu_v13_0_6_usr_edit_dpm_table, .set_df_cstate = smu_v13_0_6_set_df_cstate, - .allow_xgmi_power_down = smu_v13_0_6_allow_xgmi_power_down, .select_xgmi_plpd_policy = smu_v13_0_6_select_xgmi_plpd_policy, .log_thermal_throttling_event = smu_v13_0_6_log_thermal_throttling_event, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask,
Signature · 1 line
2.38.1
PATCH 7/7 drm/amd/pm: deprecate allow_xgmi_power_down interface
In reply to Le MaReplace with set_plpd_mode uniformly for places to use.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 ++-- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 14 -------------- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 2 -- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 17 ----------------- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 8 -------- 5 files changed, 2 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2 -2
@@ -1072,7 +1072,7 @@ static int amdgpu_ras_error_inject_xgmi(struct amdgpu_device *adev,if (amdgpu_dpm_set_df_cstate (adev,DF_CSTATE_DISALLOW ))dev_warn (adev->dev,"Failed to disallow df cstate" ); -if (amdgpu_dpm_allow_xgmi_power_down (adev, false)) +if (amdgpu_dpm_set_xgmi_plpd_mode (adev,XGMI_PLPD_DISALLOW ))dev_warn (adev->dev,"Failed to disallow XGMI power down" ); ret =psp_ras_trigger_error (&adev->psp, block_info, instance_mask);
@@ -1080,7 +1080,7 @@ static int amdgpu_ras_error_inject_xgmi(struct amdgpu_device *adev,if (amdgpu_ras_intr_triggered ())return ret; -if (amdgpu_dpm_allow_xgmi_power_down (adev, true)) +if (amdgpu_dpm_set_xgmi_plpd_mode (adev,XGMI_PLPD_DEFAULT ))dev_warn (adev->dev,"Failed to allow XGMI power down" );if (amdgpu_dpm_set_df_cstate (adev,DF_CSTATE_ALLOW ))
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0 -14
@@ -351,20 +351,6 @@ int amdgpu_dpm_set_df_cstate(struct amdgpu_device *adev,return ret; } -int amdgpu_dpm_allow_xgmi_power_down (struct amdgpu_device *adev,bool en) -{ -struct smu_context *smu = adev->powerplay.pp_handle; -int ret =0 ; - -if (is_support_sw_smu (adev)) { -mutex_lock (&adev->pm.mutex); - ret =smu_allow_xgmi_power_down (smu, en); -mutex_unlock (&adev->pm.mutex); - } - -return ret; -} -int amdgpu_dpm_get_xgmi_plpd_mode (struct amdgpu_device *adev,char **mode_desc) {struct smu_context *smu = adev->powerplay.pp_handle;
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +0 -2
@@ -424,8 +424,6 @@ int amdgpu_dpm_baco_enter(struct amdgpu_device *adev);int amdgpu_dpm_set_df_cstate (struct amdgpu_device *adev,uint32_t cstate); -int amdgpu_dpm_allow_xgmi_power_down (struct amdgpu_device *adev,bool en); -int amdgpu_dpm_get_xgmi_plpd_mode (struct amdgpu_device *adev,char **mode);
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -17
@@ -2178,23 +2178,6 @@ static int smu_set_df_cstate(void *handle,return ret; } -int smu_allow_xgmi_power_down (struct smu_context *smu,bool en) -{ -int ret =0 ; - -if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled) -return -EOPNOTSUPP ; - -if (!smu->ppt_funcs || !smu->ppt_funcs->allow_xgmi_power_down) -return 0 ; - - ret = smu->ppt_funcs->allow_xgmi_power_down (smu, en); -if (ret) -dev_err (smu->adev->dev,"[AllowXgmiPowerDown] failed!\n" ); - -return ret; -} -int smu_write_watermarks_table (struct smu_context *smu) {if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled)
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0 -8
@@ -834,12 +834,6 @@ struct pptable_funcs {*/ int (*set_df_cstate)(struct smu_context *smu,enum pp_df_cstate state); -/** -* @allow_xgmi_power_down: Enable/disable external global memory -* interconnect power down. -*/ -int (*allow_xgmi_power_down)(struct smu_context *smu,bool en); -/** * @select_xgmi_plpd_policy: Select xgmi per-link power down policy. */
@@ -1491,8 +1485,6 @@ int smu_set_gfx_power_up_by_imu(struct smu_context *smu);int smu_set_ac_dc (struct smu_context *smu); -int smu_allow_xgmi_power_down (struct smu_context *smu,bool en); -int smu_set_xgmi_plpd_mode (struct smu_context *smu,enum pp_xgmi_plpd_mode mode);
Signature · 1 line
2.38.1
Quoted 4 lines · On 9/25/2023 9:57 AM, Le Ma wrote:
To add message to select PLPD mode.
Signed-off-by Le Ma <[email protected]>Reviewed-by Asad Kamal <[email protected]>
Series is -
Thanks,
Lijo
Quoted 27 lines
--- drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h +5
-0@@ -90,6 +90,7 @@#define PPSMC_MSG_ClearMcaOnRead 0x39#define PPSMC_MSG_QueryValidMcaCeCount 0x3A#define PPSMC_MSG_McaBankCeDumpDW 0x3B +#define PPSMC_MSG_SelectPLPDMode 0x40#define PPSMC_Message_Count 0x41//PPSMC Reset Types for driver msg argument @@ -107,6 +108,10 @@#define PPSMC_XCD_THM_TYPE 0x3#define PPSMC_HBM_THM_TYPE 0x4 +//PLPD modes +#define PPSMC_PLPD_MODE_DEFAULT 0x1 +#define PPSMC_PLPD_MODE_OPTIMIZED 0x2 +typedef uint32_t PPSMC_Result ;typedef uint32_t PPSMC_MSG ;