drm/amd/pm: update the smu v11.5 smc header for vangogh
Subsystems (3)
PATCH v2 1/2 drm/amd/pm: update the smu v11.5 smc header for vangogh
Add new PMFW message to notify RLC engine status.
--- drivers/gpu/drm/amd/pm/inc/smu_types.h | 2 +- drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/inc/smu_types.h +1 -1
@@ -178,7 +178,7 @@__SMU_DUMMY_MAP (SET_DRIVER_DUMMY_TABLE_DRAM_ADDR_LOW ), \__SMU_DUMMY_MAP (GET_UMC_FW_WA ), \__SMU_DUMMY_MAP (Mode1Reset), \ -__SMU_DUMMY_MAP (Spare), \ +__SMU_DUMMY_MAP (RlcPowerNotify), \__SMU_DUMMY_MAP (SetHardMinIspiclkByFreq), \__SMU_DUMMY_MAP (SetHardMinIspxclkByFreq), \ __SMU_DUMMY_MAP(SetSoftMinSocclkByFreq), \
drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h +1 -1
@@ -41,7 +41,7 @@#define PPSMC_MSG_PowerUpIspByTile 0x7#define PPSMC_MSG_PowerDownVcn 0x8 // VCN is power gated by default#define PPSMC_MSG_PowerUpVcn 0x9 -#define PPSMC_MSG_spare 0xA +#define PPSMC_MSG_RlcPowerNotify 0xA#define PPSMC_MSG_SetHardMinVcn 0xB // For wireless display#define PPSMC_MSG_SetSoftMinGfxclk 0xC //Sets SoftMin for GFXCLK. Arg is in MHz#define PPSMC_MSG_ActiveProcessNotify 0xD
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v2 2/2 drm/amd/pm: inform SMU RLC status thus enable/disable DPM feature for vangogh
RLC is halted when system suspend/shutdown. However, due to DPM enabled, PMFW is unaware of RLC being halted and will continue sending messages, which would eventually cause an ACPI hang. Use the system_feature_control interface to notify SMU the status of RLC thus enable/disable DPM feature.
--- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 17 ++++++++++++++++- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +16 -1
@@ -64,7 +64,7 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (PowerUpIspByTile, PPSMC_MSG_PowerUpIspByTile,0 ),MSG_MAP (PowerDownVcn, PPSMC_MSG_PowerDownVcn,0 ),MSG_MAP (PowerUpVcn, PPSMC_MSG_PowerUpVcn,0 ), -MSG_MAP (Spare, PPSMC_MSG_spare,0 ), +MSG_MAP (RlcPowerNotify, PPSMC_MSG_RlcPowerNotify,0 ),MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,0 ),MSG_MAP (SetSoftMinGfxclk, PPSMC_MSG_SetSoftMinGfxclk,0 ), MSG_MAP(ActiveProcessNotify, PPSMC_MSG_ActiveProcessNotify, 0),
@@ -722,6 +722,20 @@ static int vangogh_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)return 0 ; } +static int vangogh_system_features_control (struct smu_context *smu,bool en) +{ +int ret =0 ; + +if (en) + ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_RlcPowerNotify, +RLC_STATUS_NORMAL ,NULL ); +else + ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_RlcPowerNotify, +RLC_STATUS_OFF ,NULL ); + +return ret; +} +static const struct pptable_funcs vangogh_ppt_funcs = { .check_fw_status = smu_v11_0_check_fw_status,
@@ -750,6 +764,7 @@ static const struct pptable_funcs vangogh_ppt_funcs = { .print_clk_levels = vangogh_print_fine_grain_clk, .set_default_dpm_table = vangogh_set_default_dpm_tables, .set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters, + .system_features_control = vangogh_system_features_control, };void vangogh_set_ppt_funcs (struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h +4 -0
@@ -32,4 +32,8 @@ extern void vangogh_set_ppt_funcs(struct smu_context *smu);#define VANGOGH_UMD_PSTATE_SOCCLK 678#define VANGOGH_UMD_PSTATE_FCLK 800 +/* RLC Power Status */ +#define RLC_STATUS_OFF 0 +#define RLC_STATUS_NORMAL 1 +#endif
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH v2 2/2] drm/amd/pm: inform SMU RLC status thus enable/disable DPM feature for vangogh
[AMD Public Use]
Series is Reviewed-by: Lijo Lazar <[email protected]>
-----Original Message-----
From: Hou, Xiaomeng (Matthew) <[email protected]>
Sent: Wednesday, December 9, 2020 6:20 PM
To: [email protected]
Cc: Huang, Ray <[email protected]>; Lazar, Lijo <[email protected]>; Wang, Kevin(Yang) <[email protected]>; Hou, Xiaomeng (Matthew) <[email protected]>
Subject: [PATCH v2 2/2] drm/amd/pm: inform SMU RLC status thus enable/disable DPM feature for vangogh
RLC is halted when system suspend/shutdown. However, due to DPM enabled, PMFW is unaware of RLC being halted and will continue sending messages, which would eventually cause an ACPI hang. Use the system_feature_control interface to notify SMU the status of RLC thus enable/disable DPM feature.
--- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 17 ++++++++++++++++- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +15 -1
@@ -64,7 +64,7 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (PowerUpIspByTile, PPSMC_MSG_PowerUpIspByTile,0 ),MSG_MAP (PowerDownVcn, PPSMC_MSG_PowerDownVcn,0 ),MSG_MAP (PowerUpVcn, PPSMC_MSG_PowerUpVcn,0 ), -MSG_MAP (Spare, PPSMC_MSG_spare,0 ), +MSG_MAP (RlcPowerNotify, PPSMC_MSG_RlcPowerNotify,0 ),MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,0 ),MSG_MAP (SetSoftMinGfxclk, PPSMC_MSG_SetSoftMinGfxclk,0 ), MSG_MAP(ActiveProcessNotify, PPSMC_MSG_ActiveProcessNotify, 0),
@@ -722,6 +722,20 @@ static int vangogh_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)return 0 ; } +static int vangogh_system_features_control (struct smu_context *smu, +bool en) { +int ret =0 ; + +if (en) + ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_RlcPowerNotify, +RLC_STATUS_NORMAL ,NULL ); +else + ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_RlcPowerNotify, +RLC_STATUS_OFF ,NULL ); + +return ret; +} + static const struct pptable_funcs vangogh_ppt_funcs = { .check_fw_status = smu_v11_0_check_fw_status, @@ -750,6 +764,7 @@ static const struct pptable_funcs vangogh_ppt_funcs = {
.print_clk_levels = vangogh_print_fine_grain_clk, .set_default_dpm_table = vangogh_set_default_dpm_tables, .set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters,
+ .system_features_control = vangogh_system_features_control,
};
void vangogh_set_ppt_funcs(struct smu_context *smu) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h
index 8756766296cd..eab455493076 100644
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h +4 -0
@@ -32,4 +32,8 @@ extern void vangogh_set_ppt_funcs(struct smu_context *smu);#define VANGOGH_UMD_PSTATE_SOCCLK 678#define VANGOGH_UMD_PSTATE_FCLK 800 +/* RLC Power Status */ +#define RLC_STATUS_OFF 0 +#define RLC_STATUS_NORMAL 1 +#endif
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH v2 2/2] drm/amd/pm: inform SMU RLC status thus enable/disable DPM feature for vangogh
In reply to Xiaomeng HouQuoted 29 lines · Xiaomeng (Matthew)
RLC is halted when system suspend/shutdown. However, due to DPM enabled, PMFW is unaware of RLC being halted and will continue sending messages, which would eventually cause an ACPI hang. Use the
system_feature_controlinterface to notify SMU the status of RLC thus enable/disable DPM feature.Signed-off-by Xiaomeng Hou <[email protected]>Change-Id I2f1a7de23df7315a7b220ba6d0a4bcaa75c93fea--- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 17 ++++++++++++++++- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1
-1@@ -64,7 +64,7 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (PowerUpIspByTile, PPSMC_MSG_PowerUpIspByTile,0 ),MSG_MAP (PowerDownVcn, PPSMC_MSG_PowerDownVcn,0 ),MSG_MAP (PowerUpVcn, PPSMC_MSG_PowerUpVcn,0 ), -MSG_MAP (Spare, PPSMC_MSG_spare,0 ), +MSG_MAP (RlcPowerNotify, PPSMC_MSG_RlcPowerNotify,0 ),MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,0 ),MSG_MAP (SetSoftMinGfxclk, PPSMC_MSG_SetSoftMinGfxclk,0 ), MSG_MAP(ActiveProcessNotify, PPSMC_MSG_ActiveProcessNotify, 0),@@ -722,6 +722,20 @@ static int vangogh_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)return 0 ; }
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_set_fine_grain_gfx_freq_parameters(struct smu_context *smu) · line 734
Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +10
-0+static int vangogh_system_features_control (struct smu_context *smu,bool en) +{ +int ret =0 ; + +if (en) + ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_RlcPowerNotify, +RLC_STATUS_NORMAL ,NULL ); +else + ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_RlcPowerNotify, +RLC_STATUS_OFF ,NULL );
I think we can simplify the codes as below:
return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_RlcPowerNotify,
en ? RLC_STATUS_NORMAL : RLC_STATUS_OFF, NULL);
With that update, series are Reviewed-by: Huang Rui <[email protected]>
Quoted 31 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +5
-0+ +return ret; +} +static const struct pptable_funcs vangogh_ppt_funcs = { .check_fw_status = smu_v11_0_check_fw_status,@@ -750,6 +764,7 @@ static const struct pptable_funcs vangogh_ppt_funcs = { .print_clk_levels = vangogh_print_fine_grain_clk, .set_default_dpm_table = vangogh_set_default_dpm_tables, .set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters, + .system_features_control = vangogh_system_features_control, };void vangogh_set_ppt_funcs (struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h +4
-0@@ -32,4 +32,8 @@ extern void vangogh_set_ppt_funcs(struct smu_context *smu);#define VANGOGH_UMD_PSTATE_SOCCLK 678#define VANGOGH_UMD_PSTATE_FCLK 800 +/* RLC Power Status */ +#define RLC_STATUS_OFF 0 +#define RLC_STATUS_NORMAL 1 +#endif Signature · 1 line
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx