drm/amdgpu/pm: drop pp_power_profile_mode support for APUs
Subsystems (3)
PATCH 1/1 drm/amdgpu/pm: drop pp_power_profile_mode support for APUs
Although this has been plumbed for Renoir, Green Sardine, Van Gogh, and Yellow Carp the functionality in the SMU doesn't do anything for these APUs. Drop the associated code with them.
--- .../gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h | 4 +- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 86 ------------------ .../gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 87 ------------------- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 87 ------------------- 4 files changed, 2 insertions(+), 262 deletions(-)
drivers/gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h +2 -2
@@ -51,7 +51,7 @@#define PPSMC_MSG_PowerUpVcn 0x07 ///< Power up VCN; VCN is power gated by default#define PPSMC_MSG_SetHardMinVcn 0x08 ///< For wireless display#define PPSMC_MSG_SetSoftMinGfxclk 0x09 ///< Set SoftMin for GFXCLK, argument is frequency in MHz -#define PPSMC_MSG_ActiveProcessNotify 0x0A ///< Set active work load type +#define PPSMC_MSG_SPARE0 0x0A ///< Spare#define PPSMC_MSG_ForcePowerDownGfx 0x0B ///< Force power down GFX, i.e. enter GFXOFF#define PPSMC_MSG_PrepareMp1ForUnload 0x0C ///< Prepare PMFW for GFX driver unload#define PPSMC_MSG_SetDriverDramAddrHigh 0x0D ///< Set high 32 bits of DRAM address for Driver table transfer
@@ -63,7 +63,7 @@#define PPSMC_MSG_SetHardMinSocclkByFreq 0x13 ///< Set hard min for SOC CLK#define PPSMC_MSG_SetSoftMinFclk 0x14 ///< Set hard min for FCLK#define PPSMC_MSG_SetSoftMinVcn 0x15 ///< Set soft min for VCN clocks (VCLK and DCLK) -#define PPSMC_MSG_SPARE0 0x16 ///< Spared +#define PPSMC_MSG_SPARE1 0x16 ///< Spare#define PPSMC_MSG_GetGfxclkFrequency 0x17 ///< Get GFX clock frequency#define PPSMC_MSG_GetFclkFrequency 0x18 ///< Get FCLK frequency#define PPSMC_MSG_AllowGfxOff 0x19 ///< Inform PMFW of allowing GFXOFF entry
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0 -86
115 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0 -87
126 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0 -87
116 lines not on this page · raw message
Signature · 1 line
2.25.1
[AMD Official Use Only]
--
Best Regards
Aaron Liu
Quoted 529 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Mario Limonciello
Sent: Thursday, October 28, 2021 11:54 PM
To: [email protected]
Cc: Limonciello, Mario <[email protected]>
Subject: [PATCH] drm/amdgpu/pm: droppp_power_profile_modesupport for APUsAlthough this has been plumbed for Renoir, Green Sardine, Van Gogh, and Yellow Carp the functionality in the SMU doesn't do anything for these APUs. Drop the associated code with them.
Signed-off-by Mario Limonciello <[email protected]>--- .../gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h | 4 +- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 86 ------------------ .../gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 87 ------------------- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 87 ------------------- 4 files changed, 2 insertions(+), 262 deletions(-)drivers/gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h +0
-0@@ -51,7 +51,7 @@#define PPSMC_MSG_PowerUpVcn 0x07 ///< Power up VCN;VCN is power gated by default
#definePPSMC_MSG_SetHardMinVcn0x08///< For wireless
display
#definePPSMC_MSG_SetSoftMinGfxclk0x09///< Set SoftMin for
GFXCLK, argument is frequency in MHz
-#definePPSMC_MSG_ActiveProcessNotify0x0A///< Set active work
load type
+#definePPSMC_MSG_SPARE00x0A///< Spare
#definePPSMC_MSG_ForcePowerDownGfx0x0B///< Force power
down GFX, i.e. enter GFXOFF
#definePPSMC_MSG_PrepareMp1ForUnload0x0C///< Prepare
PMFW for GFX driver unload
#definePPSMC_MSG_SetDriverDramAddrHigh0x0D///< Set high 32
bits of DRAM address for Driver table transferdrivers/gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h +0
-0@@ -63,7 +63,7 @@#define PPSMC_MSG_SetHardMinSocclkByFreq 0x13 ///< Set hard minfor SOC CLK
#definePPSMC_MSG_SetSoftMinFclk0x14///< Set hard min for
FCLK
#definePPSMC_MSG_SetSoftMinVcn0x15///< Set soft min for
VCN clocks (VCLK and DCLK)drivers/gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h +1
-1-#define PPSMC_MSG_SPARE0 0x16 ///< Spared +#define PPSMC_MSG_SPARE1 0x16 ///< Spare#define PPSMC_MSG_GetGfxclkFrequency 0x17 ///< Get GFX clockfrequency
#definePPSMC_MSG_GetFclkFrequency0x18///< Get FCLK
frequency
#definePPSMC_MSG_AllowGfxOff0x19///< Inform PMFW of
allowing GFXOFF entrydrivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -72,7 +72,6 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (RlcPowerNotify, PPSMC_MSG_RlcPowerNotify,0 ),MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,0 ), MSG_MAP(SetSoftMinGfxclk, PPSMC_MSG_SetSoftMinGfxclk,0),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- MSG_MAP(ActiveProcessNotify,
PPSMC_MSG_ActiveProcessNotify, 0),
MSG_MAP(SetHardMinIspiclkByFreq,PPSMC_MSG_SetHardMinIspiclkByFreq, 0),
MSG_MAP(SetHardMinIspxclkByFreq,PPSMC_MSG_SetHardMinIspxclkByFreq, 0),
MSG_MAP(SetDriverDramAddrHigh,PPSMC_MSG_SetDriverDramAddrHigh, 0),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-3@@ -182,14 +181,6 @@ static struct cmn2asic_mapping vangogh_table_map[SMU_TABLE_COUNT] = {TAB_MAP_VALID (DPMCLOCKS ), }; -static struct cmn2asic_mapping vangogh_workload_map[PP_SMC_POWER_PROFILE_COUNT] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D , WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT), - WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VIDEO,
WORKLOAD_PPLIB_VIDEO_BIT),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR,
WORKLOAD_PPLIB_VR_BIT),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE,
WORKLOAD_PPLIB_COMPUTE_BIT),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM,
WORKLOAD_PPLIB_CUSTOM_BIT),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-22-}; -static const uint8_t vangogh_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL ] = (SMU_THROTTLER_SPL_BIT ), [THROTTLER_STATUS_BIT_FPPT ] = (SMU_THROTTLER_FPPT_BIT ),@@ -1010,80 +1001,6 @@ static int vangogh_get_dpm_ultimate_freq(structsmu_context *smu, return ret; } -static int vangogh_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-4-* Not all profile modes are supported on vangogh. -*/ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-7- i); - -if (workload_type <0 ) -continue ; - - size += sysfs_emit_at(buf, size, "%2d %14s%s\n", - i, profile_name[i], (i == smu->power_profile_mode) ?"*" : " ");
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-6- } - -return size; -} - -static int vangogh_set_power_profile_mode(struct smu_context *smu, long*input,
uint32_tsize) -{drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-5-int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { - dev_err(smu->adev->dev, "Invalid power profile mode %d\n",
profile_mode);drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-5-return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==
PP_SMC_POWER_PROFILE_POWERSAVING)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-5-return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-3- profile_mode); -if (workload_type <0 ) { - dev_dbg(smu->adev->dev, "Unsupported power profilemode %d on VANGOGH\n",
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-5- profile_mode); -return -EINVAL ; - } - - ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_ActiveProcessNotify,drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-4-1 << workload_type, - NULL); -if (ret) { - dev_err_once(smu->adev->dev, "Fail to set workloadtype %d\n",
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-11- workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} - static int vangogh_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_type clk_type, uint32_t min,@@ -2190,8 +2107,6 @@ static const struct pptable_funcs vangogh_ppt_funcs = { .set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters, .system_features_control = vangogh_system_features_control, .feature_is_enabled = smu_cmn_feature_is_enabled, - .set_power_profile_mode = vangogh_set_power_profile_mode, - .get_power_profile_mode = vangogh_get_power_profile_mode, .get_dpm_clock_table = vangogh_get_dpm_clock_table,drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0.force_clk_levels = vangogh_force_clk_levels, .set_performance_level = vangogh_set_performance_level, @@ -2210,6 +2125,5 @@ void
vangogh_set_ppt_funcs(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1smu->message_map = vangogh_message_map; smu->feature_map = vangogh_feature_mask_map; smu->table_map = vangogh_table_map; - smu->workload_map = vangogh_workload_map; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-0@@ -58,7 +58,6 @@ static struct cmn2asic_msg_mapping renoir_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,1 ),MSG_MAP (SetAllowFclkSwitch, PPSMC_MSG_SetAllowFclkSwitch,1 ), MSG_MAP(SetMinVideoGfxclkFreq,
PPSMC_MSG_SetMinVideoGfxclkFreq, 1),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1- MSG_MAP(ActiveProcessNotify,
PPSMC_MSG_ActiveProcessNotify, 1),
MSG_MAP(SetCustomPolicy,PPSMC_MSG_SetCustomPolicy,
1),
MSG_MAP(SetVideoFps,PPSMC_MSG_SetVideoFps,
1),
MSG_MAP(NumOfDisplays,PPSMC_MSG_SetDisplayCount,
1),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-3@@ -120,14 +119,6 @@ static struct cmn2asic_mapping renoir_table_map[SMU_TABLE_COUNT] = {TAB_MAP_VALID (SMU_METRICS ), }; -static struct cmn2asic_mapping renoir_workload_map[PP_SMC_POWER_PROFILE_COUNT] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D , WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT), - WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VIDEO,
WORKLOAD_PPLIB_VIDEO_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR,
WORKLOAD_PPLIB_VR_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE,
WORKLOAD_PPLIB_COMPUTE_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM,
WORKLOAD_PPLIB_CUSTOM_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-2-}; -static const uint8_t renoir_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL] =(
SMU_THROTTLER_SPL_BIT),
[THROTTLER_STATUS_BIT_FPPT] =
(SMU_THROTTLER_FPPT_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-11@@ -854,46 +845,6 @@ static int renoir_force_clk_levels(structsmu_context *smu, return ret; } -static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, uint32_t size) -{ - int workload_type, ret; - uint32_t profile_mode = input[size]; - - if (profile_mode > PP_SMC_POWER_PROFILE_CUSTOM) { - dev_err(smu->adev->dev, "Invalid power profile mode %d\n", profile_mode); - return -EINVAL; - } - - if (profile_mode == PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==
PP_SMC_POWER_PROFILE_POWERSAVING)drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-5-return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-4- profile_mode); -if (workload_type <0 ) { -/* -* TODO: If some case need switch to powersave/default power mode
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1-* then can consider enter WORKLOAD_COMPUTE/WORKLOAD_CUSTOM for power saving.
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-2-*/ - dev_dbg(smu->adev->dev, "Unsupported power profilemode %d on RENOIR\n",
profile_mode);drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-4-return -EINVAL ; - } - - ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_ActiveProcessNotify,drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-4-1 << workload_type, - NULL); -if (ret) { - dev_err_once(smu->adev->dev, "Fail to set workloadtype %d\n",
workload_type);drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-28-return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static int renoir_set_peak_clock_by_device (struct smu_context *smu) {int ret =0 ;@@ -1092,41 +1043,6 @@ static int renoir_set_watermarks_table(return 0 ; } -static int renoir_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-4-* Not all profile modes are supported on arcturus. -*/ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-6- i); -if (workload_type <0 ) -continue ; - - size += sysfs_emit_at(buf, size, "%2d %14s%s\n", - i, profile_name[i], (i == smu->power_profile_mode) ?"*" : " ");
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-7- } - -return size; -} -static int renoir_get_smu_metrics_data (struct smu_context *smu,MetricsMember_t member,uint32_t *value)@@ -1389,11 +1305,9 @@ static const struct pptable_funcs renoir_ppt_funcs = { .dpm_set_vcn_enable = renoir_dpm_set_vcn_enable, .dpm_set_jpeg_enable = renoir_dpm_set_jpeg_enable, .force_clk_levels = renoir_force_clk_levels, - .set_power_profile_mode = renoir_set_power_profile_mode, .set_performance_level = renoir_set_performance_level, .get_dpm_clock_table = renoir_get_dpm_clock_table, .set_watermarks_table = renoir_set_watermarks_table, - .get_power_profile_mode = renoir_get_power_profile_mode, .read_sensor = renoir_read_sensor, .check_fw_status = smu_v12_0_check_fw_status,drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +1
-1.check_fw_version = smu_v12_0_check_fw_version, @@ -1429,7 +1343,6 @@ void renoir_set_ppt_funcs(struct smu_context *smu) smu->message_map = renoir_message_map; smu->clock_map = renoir_clk_map; smu->table_map = renoir_table_map; - smu->workload_map = renoir_workload_map; smu->smc_driver_if_version =SMU12_DRIVER_IF_VERSION ; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -64,7 +64,6 @@ static struct cmn2asic_msg_mappingyellow_carp_message_map[SMU_MSG_MAX_COUNT] =
MSG_MAP(PowerDownVcn,PPSMC_MSG_PowerDownVcn,1), MSG_MAP(PowerUpVcn, PPSMC_MSG_PowerUpVcn, 1), MSG_MAP(SetHardMinVcn, PPSMC_MSG_SetHardMinVcn, 1),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1- MSG_MAP(ActiveProcessNotify,
PPSMC_MSG_ActiveProcessNotify, 1),
MSG_MAP(PrepareMp1ForUnload,PPSMC_MSG_PrepareMp1ForUnload, 1),
MSG_MAP(SetDriverDramAddrHigh,PPSMC_MSG_SetDriverDramAddrHigh, 1),
MSG_MAP(SetDriverDramAddrLow,PPSMC_MSG_SetDriverDramAddrLow, 1),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-4@@ -135,14 +134,6 @@ static struct cmn2asic_mapping yellow_carp_table_map[SMU_TABLE_COUNT] = {TAB_MAP_VALID (CUSTOM_DPM ),TAB_MAP_VALID (DPMCLOCKS ), }; - -static struct cmn2asic_mapping yellow_carp_workload_map[PP_SMC_POWER_PROFILE_COUNT] = { - WORKLOAD_MAP(PP_SMC_POWER_PROFILE_FULLSCREEN3D, WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT), - WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VIDEO,
WORKLOAD_PPLIB_VIDEO_BIT),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR,
WORKLOAD_PPLIB_VR_BIT),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE,
WORKLOAD_PPLIB_COMPUTE_BIT),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM,
WORKLOAD_PPLIB_CUSTOM_BIT),
-};static int
yellow_carp_init_smc_tables(struct smu_context *smu){ @@ -
543,81 +534,6 @@ static int yellow_carp_set_watermarks_table(structsmu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-20return 0 ; } -static int yellow_carp_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT.
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-4-* Not all profile modes are supported on yellow carp. -*/ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-7- i); - -if (workload_type <0 ) -continue ; - - size += sysfs_emit_at(buf, size, "%2d %14s%s\n", - i, profile_name[i], (i == smu->power_profile_mode) ?"*" : " ");
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-13- } - -return size; -} - -static int yellow_carp_set_power_profile_mode (struct smu_context *smu, -long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { - dev_err(smu->adev->dev, "Invalid power profile mode %d\n",
profile_mode);drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-5-return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==
PP_SMC_POWER_PROFILE_POWERSAVING)drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-5-return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-3- profile_mode); -if (workload_type <0 ) { - dev_dbg(smu->adev->dev, "Unsupported power profilemode %d on YELLOWCARP\n",
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-5- profile_mode); -return -EINVAL ; - } - - ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_ActiveProcessNotify,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-4-1 << workload_type, - NULL); -if (ret) { - dev_err_once(smu->adev->dev, "Fail to set workloadtype %d\n",
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-11- workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static ssize_t yellow_carp_get_gpu_metrics (struct smu_context *smu,void **table) {@@ -1238,8 +1154,6 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = { .read_sensor = yellow_carp_read_sensor, .is_dpm_running = yellow_carp_is_dpm_running, .set_watermarks_table = yellow_carp_set_watermarks_table, - .get_power_profile_mode = yellow_carp_get_power_profile_mode, - .set_power_profile_mode = yellow_carp_set_power_profile_mode, .get_gpu_metrics = yellow_carp_get_gpu_metrics, .get_enabled_mask = smu_cmn_get_enabled_32_bits_mask,.get_pp_feature_mask =
smu_cmn_get_pp_feature_mask, @@ -
1261,6 +1175,5 @@ voidyellow_carp_set_ppt_funcs(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-2smu->message_map = yellow_carp_message_map; smu->feature_map = yellow_carp_feature_mask_map; smu->table_map = yellow_carp_table_map; - smu->workload_map = yellow_carp_workload_map; smu->is_apu = true; } --2.25.1
[AMD Official Use Only]
Sorry, Mario.
Please don't upstream.
We need to discuss whether to drop pp_power_profile_mode support for RN/VGH.
--
Best Regards
Aaron Liu
Quoted 552 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Liu, Aaron
Sent: Friday, October 29, 2021 10:03 AM
To: Limonciello, Mario <[email protected]>; amd- [email protected]
Cc: Limonciello, Mario <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/pm: droppp_power_profile_modesupport for APUs[AMD Official Use Only]
Reviewed-by Aaron Liu <[email protected]>--
Best Regards
Aaron LiuQuoted 7 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Mario Limonciello
Sent: Thursday, October 28, 2021 11:54 PM
To: [email protected]
Cc: Limonciello, Mario <[email protected]>
Subject: [PATCH] drm/amdgpu/pm: droppp_power_profile_modesupportfor
Quoted 4 lines
APUs
Although this has been plumbed for Renoir, Green Sardine, Van Gogh, and Yellow Carp the functionality in the SMU doesn't do anything for
these APUs.
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int
Quoted 90 lines
Drop the associated code with them.
Signed-off-by Mario Limonciello <[email protected]>--- .../gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h | 4 +- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 86 ------------------ .../gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 87 ------------------- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 87 ------------------- 4 files changed, 2 insertions(+), 262 deletions(-)drivers/gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h +0
-0@@ -51,7 +51,7 @@#define PPSMC_MSG_PowerUpVcn 0x07 ///< Power up VCN;VCN is power gated by default
#definePPSMC_MSG_SetHardMinVcn0x08///< For wireless
display
#definePPSMC_MSG_SetSoftMinGfxclk0x09///< Set SoftMin for
GFXCLK, argument is frequency in MHz
-#definePPSMC_MSG_ActiveProcessNotify0x0A///< Set active work
load type
+#definePPSMC_MSG_SPARE00x0A///< Spare
#definePPSMC_MSG_ForcePowerDownGfx0x0B///< Force power
down GFX, i.e. enter GFXOFF
#definePPSMC_MSG_PrepareMp1ForUnload0x0C///< Prepare
PMFW for GFX driver unload
#definePPSMC_MSG_SetDriverDramAddrHigh0x0D///< Set high 32
bits of DRAM address for Driver table transfer @@ -63,7 +63,7 @@
#definePPSMC_MSG_SetHardMinSocclkByFreq0x13///< Set hard min
for SOC CLK
#definePPSMC_MSG_SetSoftMinFclk0x14///< Set hard min for
FCLK
#definePPSMC_MSG_SetSoftMinVcn0x15///< Set soft min for
VCN clocks (VCLK and DCLK)drivers/gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h +1
-1-#define PPSMC_MSG_SPARE0 0x16 ///< Spared +#define PPSMC_MSG_SPARE1 0x16 ///< Spare#define PPSMC_MSG_GetGfxclkFrequency 0x17 ///< Get GFX clockfrequency
#definePPSMC_MSG_GetFclkFrequency0x18///< Get FCLK
frequency
#definePPSMC_MSG_AllowGfxOff0x19///< Inform PMFW of
allowing GFXOFF entrydrivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -72,7 +72,6 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (RlcPowerNotify, PPSMC_MSG_RlcPowerNotify,0 ),MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,0 ), MSG_MAP(SetSoftMinGfxclk, PPSMC_MSG_SetSoftMinGfxclk,0),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- MSG_MAP(ActiveProcessNotify,
PPSMC_MSG_ActiveProcessNotify, 0),
MSG_MAP(SetHardMinIspiclkByFreq,PPSMC_MSG_SetHardMinIspiclkByFreq, 0),
MSG_MAP(SetHardMinIspxclkByFreq,PPSMC_MSG_SetHardMinIspxclkByFreq, 0),
MSG_MAP(SetDriverDramAddrHigh,PPSMC_MSG_SetDriverDramAddrHigh, 0),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-3@@ -182,14 +181,6 @@ static struct cmn2asic_mapping vangogh_table_map[SMU_TABLE_COUNT] = {TAB_MAP_VALID (DPMCLOCKS ), }; -static struct cmn2asic_mapping vangogh_workload_map[PP_SMC_POWER_PROFILE_COUNT] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D , WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT), - WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VIDEO,
WORKLOAD_PPLIB_VIDEO_BIT),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR,
WORKLOAD_PPLIB_VR_BIT),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE,
WORKLOAD_PPLIB_COMPUTE_BIT),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM,
WORKLOAD_PPLIB_CUSTOM_BIT),drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-2-}; -static const uint8_t vangogh_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL ] = (SMU_THROTTLER_SPL_BIT ), [THROTTLER_STATUS_BIT_FPPT ] = (SMU_THROTTLER_FPPT_BIT ),@@ -1010,80 +1001,6 @@ static intvangogh_get_dpm_ultimate_freq(struct
Quoted 101 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-20smu_context *smu, return ret; } -static int vangogh_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-4-* Not all profile modes are supported on vangogh. -*/ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-7- i); - -if (workload_type <0 ) -continue ; - - size += sysfs_emit_at(buf, size, "%2d %14s%s\n", - i, profile_name[i], (i == smu->power_profile_mode) ?"*" : " ");
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-6- } - -return size; -} - -static int vangogh_set_power_profile_mode(struct smu_context *smu,long *input,
uint32_tsize) -{drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-5-int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { - dev_err(smu->adev->dev, "Invalid power profile mode %d\n",
profile_mode);drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-5-return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==
PP_SMC_POWER_PROFILE_POWERSAVING)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-5-return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-3- profile_mode); -if (workload_type <0 ) { - dev_dbg(smu->adev->dev, "Unsupported power profilemode %d on VANGOGH\n",
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-5- profile_mode); -return -EINVAL ; - } - - ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_ActiveProcessNotify,drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-4-1 << workload_type, - NULL); -if (ret) { - dev_err_once(smu->adev->dev, "Fail to set workloadtype %d\n",
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-11- workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} - static int vangogh_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_type clk_type, uint32_t min,@@ -2190,8 +2107,6 @@ static const struct pptable_funcs vangogh_ppt_funcs = { .set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters, .system_features_control = vangogh_system_features_control, .feature_is_enabled = smu_cmn_feature_is_enabled, - .set_power_profile_mode = vangogh_set_power_profile_mode, - .get_power_profile_mode = vangogh_get_power_profile_mode, .get_dpm_clock_table = vangogh_get_dpm_clock_table,drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0.force_clk_levels = vangogh_force_clk_levels, .set_performance_level = vangogh_set_performance_level, @@ -Quoted 1 line
2210,6 +2125,5 @@ void vangogh_set_ppt_funcs(struct
smu_context*smu)
Quoted 327 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1smu->message_map = vangogh_message_map; smu->feature_map = vangogh_feature_mask_map; smu->table_map = vangogh_table_map; - smu->workload_map = vangogh_workload_map; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-0@@ -58,7 +58,6 @@ static struct cmn2asic_msg_mapping renoir_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,1 ),MSG_MAP (SetAllowFclkSwitch, PPSMC_MSG_SetAllowFclkSwitch,1 ), MSG_MAP(SetMinVideoGfxclkFreq,
PPSMC_MSG_SetMinVideoGfxclkFreq, 1),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1- MSG_MAP(ActiveProcessNotify,
PPSMC_MSG_ActiveProcessNotify, 1),
MSG_MAP(SetCustomPolicy,PPSMC_MSG_SetCustomPolicy,
1),
MSG_MAP(SetVideoFps,PPSMC_MSG_SetVideoFps,
1),
MSG_MAP(NumOfDisplays,PPSMC_MSG_SetDisplayCount,
1),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-3@@ -120,14 +119,6 @@ static struct cmn2asic_mapping renoir_table_map[SMU_TABLE_COUNT] = {TAB_MAP_VALID (SMU_METRICS ), }; -static struct cmn2asic_mapping renoir_workload_map[PP_SMC_POWER_PROFILE_COUNT] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D , WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT), - WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VIDEO,
WORKLOAD_PPLIB_VIDEO_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR,
WORKLOAD_PPLIB_VR_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE,
WORKLOAD_PPLIB_COMPUTE_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM,
WORKLOAD_PPLIB_CUSTOM_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-2-}; -static const uint8_t renoir_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL] =(
SMU_THROTTLER_SPL_BIT),
[THROTTLER_STATUS_BIT_FPPT] =
(SMU_THROTTLER_FPPT_BIT),drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-11@@ -854,46 +845,6 @@ static int renoir_force_clk_levels(structsmu_context *smu, return ret; } -static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, uint32_t size) -{ - int workload_type, ret; - uint32_t profile_mode = input[size]; - - if (profile_mode > PP_SMC_POWER_PROFILE_CUSTOM) { - dev_err(smu->adev->dev, "Invalid power profile mode %d\n", profile_mode); - return -EINVAL; - } - - if (profile_mode == PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==
PP_SMC_POWER_PROFILE_POWERSAVING)drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-5-return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-4- profile_mode); -if (workload_type <0 ) { -/* -* TODO: If some case need switch to powersave/default power mode
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-1-* then can consider enter WORKLOAD_COMPUTE/WORKLOAD_CUSTOM for power saving.
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-2-*/ - dev_dbg(smu->adev->dev, "Unsupported power profilemode %d on RENOIR\n",
profile_mode);drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-4-return -EINVAL ; - } - - ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_ActiveProcessNotify,drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-4-1 << workload_type, - NULL); -if (ret) { - dev_err_once(smu->adev->dev, "Fail to set workloadtype %d\n",
workload_type);drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-28-return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static int renoir_set_peak_clock_by_device (struct smu_context *smu) {int ret =0 ;@@ -1092,41 +1043,6 @@ static int renoir_set_watermarks_table(return 0 ; } -static int renoir_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-4-* Not all profile modes are supported on arcturus. -*/ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-6- i); -if (workload_type <0 ) -continue ; - - size += sysfs_emit_at(buf, size, "%2d %14s%s\n", - i, profile_name[i], (i == smu->power_profile_mode) ?"*" : " ");
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-7- } - -return size; -} -static int renoir_get_smu_metrics_data (struct smu_context *smu,MetricsMember_t member,uint32_t *value)@@ -1389,11 +1305,9 @@ static const struct pptable_funcs renoir_ppt_funcs = { .dpm_set_vcn_enable = renoir_dpm_set_vcn_enable, .dpm_set_jpeg_enable = renoir_dpm_set_jpeg_enable, .force_clk_levels = renoir_force_clk_levels, - .set_power_profile_mode = renoir_set_power_profile_mode, .set_performance_level = renoir_set_performance_level, .get_dpm_clock_table = renoir_get_dpm_clock_table, .set_watermarks_table = renoir_set_watermarks_table, - .get_power_profile_mode = renoir_get_power_profile_mode, .read_sensor = renoir_read_sensor, .check_fw_status = smu_v12_0_check_fw_status,drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +1
-1.check_fw_version = smu_v12_0_check_fw_version, @@ -1429,7 +1343,6 @@ void renoir_set_ppt_funcs(struct smu_context *smu) smu->message_map = renoir_message_map; smu->clock_map = renoir_clk_map; smu->table_map = renoir_table_map; - smu->workload_map = renoir_workload_map; smu->smc_driver_if_version =SMU12_DRIVER_IF_VERSION ; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -64,7 +64,6 @@ static struct cmn2asic_msg_mappingyellow_carp_message_map[SMU_MSG_MAX_COUNT] =
MSG_MAP(PowerDownVcn,PPSMC_MSG_PowerDownVcn,1), MSG_MAP(PowerUpVcn, PPSMC_MSG_PowerUpVcn, 1), MSG_MAP(SetHardMinVcn, PPSMC_MSG_SetHardMinVcn, 1),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1- MSG_MAP(ActiveProcessNotify,
PPSMC_MSG_ActiveProcessNotify, 1),
MSG_MAP(PrepareMp1ForUnload,PPSMC_MSG_PrepareMp1ForUnload, 1),
MSG_MAP(SetDriverDramAddrHigh,PPSMC_MSG_SetDriverDramAddrHigh, 1),
MSG_MAP(SetDriverDramAddrLow,PPSMC_MSG_SetDriverDramAddrLow, 1),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-4@@ -135,14 +134,6 @@ static struct cmn2asic_mapping yellow_carp_table_map[SMU_TABLE_COUNT] = {TAB_MAP_VALID (CUSTOM_DPM ),TAB_MAP_VALID (DPMCLOCKS ), }; - -static struct cmn2asic_mapping yellow_carp_workload_map[PP_SMC_POWER_PROFILE_COUNT] = { - WORKLOAD_MAP(PP_SMC_POWER_PROFILE_FULLSCREEN3D, WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT), - WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VIDEO,
WORKLOAD_PPLIB_VIDEO_BIT),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR,
WORKLOAD_PPLIB_VR_BIT),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE,
WORKLOAD_PPLIB_COMPUTE_BIT),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1- WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM,
WORKLOAD_PPLIB_CUSTOM_BIT),drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-2-}; static int yellow_carp_init_smc_tables(struct smu_context *smu) { @@ -543,81 +534,6 @@ static int yellow_carp_set_watermarks_table(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-20return 0 ; } -static int yellow_carp_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT.
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-4-* Not all profile modes are supported on yellow carp. -*/ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-7- i); - -if (workload_type <0 ) -continue ; - - size += sysfs_emit_at(buf, size, "%2d %14s%s\n", - i, profile_name[i], (i == smu->power_profile_mode) ?"*" : " ");
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-13- } - -return size; -} - -static int yellow_carp_set_power_profile_mode (struct smu_context *smu, -long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { - dev_err(smu->adev->dev, "Invalid power profile mode %d\n",
profile_mode);drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-5-return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==
PP_SMC_POWER_PROFILE_POWERSAVING)drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-5-return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_WORKLOAD,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-3- profile_mode); -if (workload_type <0 ) { - dev_dbg(smu->adev->dev, "Unsupported power profilemode %d on YELLOWCARP\n",
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-5- profile_mode); -return -EINVAL ; - } - - ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_ActiveProcessNotify,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-4-1 << workload_type, - NULL); -if (ret) { - dev_err_once(smu->adev->dev, "Fail to set workloadtype %d\n",
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-11- workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static ssize_t yellow_carp_get_gpu_metrics (struct smu_context *smu,void **table) {@@ -1238,8 +1154,6 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = { .read_sensor = yellow_carp_read_sensor, .is_dpm_running = yellow_carp_is_dpm_running, .set_watermarks_table = yellow_carp_set_watermarks_table, - .get_power_profile_mode = yellow_carp_get_power_profile_mode, - .set_power_profile_mode = yellow_carp_set_power_profile_mode, .get_gpu_metrics = yellow_carp_get_gpu_metrics, .get_enabled_mask = smu_cmn_get_enabled_32_bits_mask,.get_pp_feature_mask =
smu_cmn_get_pp_feature_mask, @@ -
1261,6 +1175,5 @@ voidyellow_carp_set_ppt_funcs(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-2smu->message_map = yellow_carp_message_map; smu->feature_map = yellow_carp_feature_mask_map; smu->table_map = yellow_carp_table_map; - smu->workload_map = yellow_carp_workload_map; smu->is_apu = true; } --2.25.1
Quoted 2 lines · Mario Limonciello
Although this has been plumbed for Renoir, Green Sardine, Van Gogh, and Yellow Carp the functionality in the SMU doesn't do anything for
I double confirmed them in the firmware. These messages are actually existed in SMU firmware of Renoir, Van Gogh, and Green Sardine, we should not remove them in these platforms.
And for Yellow Carp, it is better to use a firmware check to skip the function than remove them entirely in case somebody doesn't upgrade his/her SBIOS.
Thanks,
Ray
Quoted 420 lines
these APUs. Drop the associated code with them.
Signed-off-by Mario Limonciello <[email protected]>--- .../gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h | 4 +- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 86 ------------------ .../gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 87 ------------------- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 87 ------------------- 4 files changed, 2 insertions(+), 262 deletions(-)drivers/gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h +2
-2@@ -51,7 +51,7 @@#define PPSMC_MSG_PowerUpVcn 0x07 ///< Power up VCN; VCN is power gated by default#define PPSMC_MSG_SetHardMinVcn 0x08 ///< For wireless display#define PPSMC_MSG_SetSoftMinGfxclk 0x09 ///< Set SoftMin for GFXCLK, argument is frequency in MHz -#define PPSMC_MSG_ActiveProcessNotify 0x0A ///< Set active work load type +#define PPSMC_MSG_SPARE0 0x0A ///< Spare#define PPSMC_MSG_ForcePowerDownGfx 0x0B ///< Force power down GFX, i.e. enter GFXOFF#define PPSMC_MSG_PrepareMp1ForUnload 0x0C ///< Prepare PMFW for GFX driver unload#define PPSMC_MSG_SetDriverDramAddrHigh 0x0D ///< Set high 32 bits of DRAM address for Driver table transfer@@ -63,7 +63,7 @@#define PPSMC_MSG_SetHardMinSocclkByFreq 0x13 ///< Set hard min for SOC CLK#define PPSMC_MSG_SetSoftMinFclk 0x14 ///< Set hard min for FCLK#define PPSMC_MSG_SetSoftMinVcn 0x15 ///< Set soft min for VCN clocks (VCLK and DCLK) -#define PPSMC_MSG_SPARE0 0x16 ///< Spared +#define PPSMC_MSG_SPARE1 0x16 ///< Spare#define PPSMC_MSG_GetGfxclkFrequency 0x17 ///< Get GFX clock frequency#define PPSMC_MSG_GetFclkFrequency 0x18 ///< Get FCLK frequency#define PPSMC_MSG_AllowGfxOff 0x19 ///< Inform PMFW of allowing GFXOFF entrydrivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-86@@ -72,7 +72,6 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {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 ),MSG_MAP (SetHardMinIspiclkByFreq, PPSMC_MSG_SetHardMinIspiclkByFreq,0 ),MSG_MAP (SetHardMinIspxclkByFreq, PPSMC_MSG_SetHardMinIspxclkByFreq,0 ), MSG_MAP(SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh, 0),@@ -182,14 +181,6 @@ static struct cmn2asic_mapping vangogh_table_map[SMU_TABLE_COUNT] = { TAB_MAP_VALID(DPMCLOCKS), }; -static struct cmn2asic_mapping vangogh_workload_map[PP_SMC_POWER_PROFILE_COUNT ] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D ,WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VIDEO ,WORKLOAD_PPLIB_VIDEO_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VR ,WORKLOAD_PPLIB_VR_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_COMPUTE ,WORKLOAD_PPLIB_COMPUTE_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_CUSTOM ,WORKLOAD_PPLIB_CUSTOM_BIT ), -}; -static const uint8_t vangogh_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL ] = (SMU_THROTTLER_SPL_BIT ), [THROTTLER_STATUS_BIT_FPPT ] = (SMU_THROTTLER_FPPT_BIT ),@@ -1010,80 +1001,6 @@ static int vangogh_get_dpm_ultimate_freq(struct smu_context *smu,return ret; } -static int vangogh_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT -* Not all profile modes are supported on vangogh. -*/ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - i); - -if (workload_type <0 ) -continue ; - - size +=sysfs_emit_at (buf, size,"%2d %14s%s\n" , - i, profile_name[i], (i == smu->power_profile_mode) ?"*" :" " ); - } - -return size; -} - -static int vangogh_set_power_profile_mode (struct smu_context *smu,long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { -dev_err (smu->adev->dev,"Invalid power profile mode %d\n" , profile_mode); -return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==PP_SMC_POWER_PROFILE_POWERSAVING ) -return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - profile_mode); -if (workload_type <0 ) { -dev_dbg (smu->adev->dev,"Unsupported power profile mode %d on VANGOGH\n" , - profile_mode); -return -EINVAL ; - } - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ActiveProcessNotify, -1 << workload_type, -NULL ); -if (ret) { -dev_err_once (smu->adev->dev,"Fail to set workload type %d\n" , - workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} - static int vangogh_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_type clk_type, uint32_t min,@@ -2190,8 +2107,6 @@ static const struct pptable_funcs vangogh_ppt_funcs = { .set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters, .system_features_control = vangogh_system_features_control, .feature_is_enabled = smu_cmn_feature_is_enabled, - .set_power_profile_mode = vangogh_set_power_profile_mode, - .get_power_profile_mode = vangogh_get_power_profile_mode, .get_dpm_clock_table = vangogh_get_dpm_clock_table, .force_clk_levels = vangogh_force_clk_levels, .set_performance_level = vangogh_set_performance_level,@@ -2210,6 +2125,5 @@ void vangogh_set_ppt_funcs(struct smu_context *smu) smu->message_map = vangogh_message_map; smu->feature_map = vangogh_feature_mask_map; smu->table_map = vangogh_table_map; - smu->workload_map = vangogh_workload_map; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-87@@ -58,7 +58,6 @@ static struct cmn2asic_msg_mapping renoir_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,1 ),MSG_MAP (SetAllowFclkSwitch, PPSMC_MSG_SetAllowFclkSwitch,1 ),MSG_MAP (SetMinVideoGfxclkFreq, PPSMC_MSG_SetMinVideoGfxclkFreq,1 ), -MSG_MAP (ActiveProcessNotify, PPSMC_MSG_ActiveProcessNotify,1 ),MSG_MAP (SetCustomPolicy, PPSMC_MSG_SetCustomPolicy,1 ),MSG_MAP (SetVideoFps, PPSMC_MSG_SetVideoFps,1 ), MSG_MAP(NumOfDisplays, PPSMC_MSG_SetDisplayCount, 1),@@ -120,14 +119,6 @@ static struct cmn2asic_mapping renoir_table_map[SMU_TABLE_COUNT] = { TAB_MAP_VALID(SMU_METRICS), }; -static struct cmn2asic_mapping renoir_workload_map[PP_SMC_POWER_PROFILE_COUNT ] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D ,WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VIDEO ,WORKLOAD_PPLIB_VIDEO_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VR ,WORKLOAD_PPLIB_VR_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_COMPUTE ,WORKLOAD_PPLIB_COMPUTE_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_CUSTOM ,WORKLOAD_PPLIB_CUSTOM_BIT ), -}; -static const uint8_t renoir_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL ] = (SMU_THROTTLER_SPL_BIT ), [THROTTLER_STATUS_BIT_FPPT ] = (SMU_THROTTLER_FPPT_BIT ),@@ -854,46 +845,6 @@ static int renoir_force_clk_levels(struct smu_context *smu,return ret; } -static int renoir_set_power_profile_mode (struct smu_context *smu,long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { -dev_err (smu->adev->dev,"Invalid power profile mode %d\n" , profile_mode); -return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==PP_SMC_POWER_PROFILE_POWERSAVING ) -return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - profile_mode); -if (workload_type <0 ) { -/* -* TODO: If some case need switch to powersave/default power mode -* then can consider enter WORKLOAD_COMPUTE/WORKLOAD_CUSTOM for power saving. -*/ -dev_dbg (smu->adev->dev,"Unsupported power profile mode %d on RENOIR\n" , profile_mode); -return -EINVAL ; - } - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ActiveProcessNotify, -1 << workload_type, -NULL ); -if (ret) { -dev_err_once (smu->adev->dev,"Fail to set workload type %d\n" , workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static int renoir_set_peak_clock_by_device (struct smu_context *smu) {int ret =0 ;@@ -1092,41 +1043,6 @@ static int renoir_set_watermarks_table(return 0 ; } -static int renoir_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT -* Not all profile modes are supported on arcturus. -*/ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - i); -if (workload_type <0 ) -continue ; - - size +=sysfs_emit_at (buf, size,"%2d %14s%s\n" , - i, profile_name[i], (i == smu->power_profile_mode) ?"*" :" " ); - } - -return size; -} -static int renoir_get_smu_metrics_data (struct smu_context *smu,MetricsMember_t member,uint32_t *value)@@ -1389,11 +1305,9 @@ static const struct pptable_funcs renoir_ppt_funcs = { .dpm_set_vcn_enable = renoir_dpm_set_vcn_enable, .dpm_set_jpeg_enable = renoir_dpm_set_jpeg_enable, .force_clk_levels = renoir_force_clk_levels, - .set_power_profile_mode = renoir_set_power_profile_mode, .set_performance_level = renoir_set_performance_level, .get_dpm_clock_table = renoir_get_dpm_clock_table, .set_watermarks_table = renoir_set_watermarks_table, - .get_power_profile_mode = renoir_get_power_profile_mode, .read_sensor = renoir_read_sensor, .check_fw_status = smu_v12_0_check_fw_status, .check_fw_version = smu_v12_0_check_fw_version,@@ -1429,7 +1343,6 @@ void renoir_set_ppt_funcs(struct smu_context *smu) smu->message_map = renoir_message_map; smu->clock_map = renoir_clk_map; smu->table_map = renoir_table_map; - smu->workload_map = renoir_workload_map; smu->smc_driver_if_version =SMU12_DRIVER_IF_VERSION ; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-87@@ -64,7 +64,6 @@ static struct cmn2asic_msg_mapping yellow_carp_message_map[SMU_MSG_MAX_COUNT] =MSG_MAP (PowerDownVcn, PPSMC_MSG_PowerDownVcn,1 ),MSG_MAP (PowerUpVcn, PPSMC_MSG_PowerUpVcn,1 ),MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,1 ), -MSG_MAP (ActiveProcessNotify, PPSMC_MSG_ActiveProcessNotify,1 ),MSG_MAP (PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload,1 ),MSG_MAP (SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,1 ), MSG_MAP(SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow, 1),@@ -135,14 +134,6 @@ static struct cmn2asic_mapping yellow_carp_table_map[SMU_TABLE_COUNT] = {TAB_MAP_VALID (CUSTOM_DPM ), TAB_MAP_VALID(DPMCLOCKS), }; - -static struct cmn2asic_mapping yellow_carp_workload_map[PP_SMC_POWER_PROFILE_COUNT ] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D ,WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VIDEO ,WORKLOAD_PPLIB_VIDEO_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VR ,WORKLOAD_PPLIB_VR_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_COMPUTE ,WORKLOAD_PPLIB_COMPUTE_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_CUSTOM ,WORKLOAD_PPLIB_CUSTOM_BIT ), -};static int yellow_carp_init_smc_tables (struct smu_context *smu) {@@ -543,81 +534,6 @@ static int yellow_carp_set_watermarks_table(struct smu_context *smu,return 0 ; } -static int yellow_carp_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT. -* Not all profile modes are supported on yellow carp. -*/ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - i); - -if (workload_type <0 ) -continue ; - - size +=sysfs_emit_at (buf, size,"%2d %14s%s\n" , - i, profile_name[i], (i == smu->power_profile_mode) ?"*" :" " ); - } - -return size; -} - -static int yellow_carp_set_power_profile_mode (struct smu_context *smu, -long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { -dev_err (smu->adev->dev,"Invalid power profile mode %d\n" , profile_mode); -return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==PP_SMC_POWER_PROFILE_POWERSAVING ) -return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - profile_mode); -if (workload_type <0 ) { -dev_dbg (smu->adev->dev,"Unsupported power profile mode %d on YELLOWCARP\n" , - profile_mode); -return -EINVAL ; - } - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ActiveProcessNotify, -1 << workload_type, -NULL ); -if (ret) { -dev_err_once (smu->adev->dev,"Fail to set workload type %d\n" , - workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static ssize_t yellow_carp_get_gpu_metrics (struct smu_context *smu,void **table) {@@ -1238,8 +1154,6 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = { .read_sensor = yellow_carp_read_sensor, .is_dpm_running = yellow_carp_is_dpm_running, .set_watermarks_table = yellow_carp_set_watermarks_table, - .get_power_profile_mode = yellow_carp_get_power_profile_mode, - .set_power_profile_mode = yellow_carp_set_power_profile_mode, .get_gpu_metrics = yellow_carp_get_gpu_metrics, .get_enabled_mask = smu_cmn_get_enabled_32_bits_mask, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask,@@ -1261,6 +1175,5 @@ void yellow_carp_set_ppt_funcs(struct smu_context *smu) smu->message_map = yellow_carp_message_map; smu->feature_map = yellow_carp_feature_mask_map; smu->table_map = yellow_carp_table_map; - smu->workload_map = yellow_carp_workload_map; smu->is_apu = true; }Signature · 1 line
2.25.1
Quoted 8 lines · Huang Rui
Quoted 2 lines · Mario Limonciello
Although this has been plumbed for Renoir, Green Sardine, Van Gogh, and Yellow Carp the functionality in the SMU doesn't do anything for
I double confirmed them in the firmware. These messages are actually existed in SMU firmware of Renoir, Van Gogh, and Green Sardine, we should not remove them in these platforms.
I heard that at least on renoir variants, the messages still exist, but they no longer do anything.
Alex
Quoted 428 lines
And for Yellow Carp, it is better to use a firmware check to skip the function than remove them entirely in case somebody doesn't upgrade his/her SBIOS.
Thanks,
RayQuoted 420 lines
these APUs. Drop the associated code with them.
Signed-off-by Mario Limonciello <[email protected]>--- .../gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h | 4 +- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 86 ------------------ .../gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 87 ------------------- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 87 ------------------- 4 files changed, 2 insertions(+), 262 deletions(-)drivers/gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h +2
-2@@ -51,7 +51,7 @@#define PPSMC_MSG_PowerUpVcn 0x07 ///< Power up VCN; VCN is power gated by default#define PPSMC_MSG_SetHardMinVcn 0x08 ///< For wireless display#define PPSMC_MSG_SetSoftMinGfxclk 0x09 ///< Set SoftMin for GFXCLK, argument is frequency in MHz -#define PPSMC_MSG_ActiveProcessNotify 0x0A ///< Set active work load type +#define PPSMC_MSG_SPARE0 0x0A ///< Spare#define PPSMC_MSG_ForcePowerDownGfx 0x0B ///< Force power down GFX, i.e. enter GFXOFF#define PPSMC_MSG_PrepareMp1ForUnload 0x0C ///< Prepare PMFW for GFX driver unload#define PPSMC_MSG_SetDriverDramAddrHigh 0x0D ///< Set high 32 bits of DRAM address for Driver table transfer@@ -63,7 +63,7 @@#define PPSMC_MSG_SetHardMinSocclkByFreq 0x13 ///< Set hard min for SOC CLK#define PPSMC_MSG_SetSoftMinFclk 0x14 ///< Set hard min for FCLK#define PPSMC_MSG_SetSoftMinVcn 0x15 ///< Set soft min for VCN clocks (VCLK and DCLK) -#define PPSMC_MSG_SPARE0 0x16 ///< Spared +#define PPSMC_MSG_SPARE1 0x16 ///< Spare#define PPSMC_MSG_GetGfxclkFrequency 0x17 ///< Get GFX clock frequency#define PPSMC_MSG_GetFclkFrequency 0x18 ///< Get FCLK frequency#define PPSMC_MSG_AllowGfxOff 0x19 ///< Inform PMFW of allowing GFXOFF entrydrivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-86@@ -72,7 +72,6 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {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 ),MSG_MAP (SetHardMinIspiclkByFreq, PPSMC_MSG_SetHardMinIspiclkByFreq,0 ),MSG_MAP (SetHardMinIspxclkByFreq, PPSMC_MSG_SetHardMinIspxclkByFreq,0 ), MSG_MAP(SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh, 0),@@ -182,14 +181,6 @@ static struct cmn2asic_mapping vangogh_table_map[SMU_TABLE_COUNT] = { TAB_MAP_VALID(DPMCLOCKS), }; -static struct cmn2asic_mapping vangogh_workload_map[PP_SMC_POWER_PROFILE_COUNT ] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D ,WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VIDEO ,WORKLOAD_PPLIB_VIDEO_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VR ,WORKLOAD_PPLIB_VR_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_COMPUTE ,WORKLOAD_PPLIB_COMPUTE_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_CUSTOM ,WORKLOAD_PPLIB_CUSTOM_BIT ), -}; -static const uint8_t vangogh_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL ] = (SMU_THROTTLER_SPL_BIT ), [THROTTLER_STATUS_BIT_FPPT ] = (SMU_THROTTLER_FPPT_BIT ),@@ -1010,80 +1001,6 @@ static int vangogh_get_dpm_ultimate_freq(struct smu_context *smu,return ret; } -static int vangogh_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT -* Not all profile modes are supported on vangogh. -*/ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - i); - -if (workload_type <0 ) -continue ; - - size +=sysfs_emit_at (buf, size,"%2d %14s%s\n" , - i, profile_name[i], (i == smu->power_profile_mode) ?"*" :" " ); - } - -return size; -} - -static int vangogh_set_power_profile_mode (struct smu_context *smu,long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { -dev_err (smu->adev->dev,"Invalid power profile mode %d\n" , profile_mode); -return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==PP_SMC_POWER_PROFILE_POWERSAVING ) -return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - profile_mode); -if (workload_type <0 ) { -dev_dbg (smu->adev->dev,"Unsupported power profile mode %d on VANGOGH\n" , - profile_mode); -return -EINVAL ; - } - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ActiveProcessNotify, -1 << workload_type, -NULL ); -if (ret) { -dev_err_once (smu->adev->dev,"Fail to set workload type %d\n" , - workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} - static int vangogh_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_type clk_type, uint32_t min,@@ -2190,8 +2107,6 @@ static const struct pptable_funcs vangogh_ppt_funcs = { .set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters, .system_features_control = vangogh_system_features_control, .feature_is_enabled = smu_cmn_feature_is_enabled, - .set_power_profile_mode = vangogh_set_power_profile_mode, - .get_power_profile_mode = vangogh_get_power_profile_mode, .get_dpm_clock_table = vangogh_get_dpm_clock_table, .force_clk_levels = vangogh_force_clk_levels, .set_performance_level = vangogh_set_performance_level,@@ -2210,6 +2125,5 @@ void vangogh_set_ppt_funcs(struct smu_context *smu) smu->message_map = vangogh_message_map; smu->feature_map = vangogh_feature_mask_map; smu->table_map = vangogh_table_map; - smu->workload_map = vangogh_workload_map; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-87@@ -58,7 +58,6 @@ static struct cmn2asic_msg_mapping renoir_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,1 ),MSG_MAP (SetAllowFclkSwitch, PPSMC_MSG_SetAllowFclkSwitch,1 ),MSG_MAP (SetMinVideoGfxclkFreq, PPSMC_MSG_SetMinVideoGfxclkFreq,1 ), -MSG_MAP (ActiveProcessNotify, PPSMC_MSG_ActiveProcessNotify,1 ),MSG_MAP (SetCustomPolicy, PPSMC_MSG_SetCustomPolicy,1 ),MSG_MAP (SetVideoFps, PPSMC_MSG_SetVideoFps,1 ), MSG_MAP(NumOfDisplays, PPSMC_MSG_SetDisplayCount, 1),@@ -120,14 +119,6 @@ static struct cmn2asic_mapping renoir_table_map[SMU_TABLE_COUNT] = { TAB_MAP_VALID(SMU_METRICS), }; -static struct cmn2asic_mapping renoir_workload_map[PP_SMC_POWER_PROFILE_COUNT ] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D ,WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VIDEO ,WORKLOAD_PPLIB_VIDEO_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VR ,WORKLOAD_PPLIB_VR_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_COMPUTE ,WORKLOAD_PPLIB_COMPUTE_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_CUSTOM ,WORKLOAD_PPLIB_CUSTOM_BIT ), -}; -static const uint8_t renoir_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL ] = (SMU_THROTTLER_SPL_BIT ), [THROTTLER_STATUS_BIT_FPPT ] = (SMU_THROTTLER_FPPT_BIT ),@@ -854,46 +845,6 @@ static int renoir_force_clk_levels(struct smu_context *smu,return ret; } -static int renoir_set_power_profile_mode (struct smu_context *smu,long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { -dev_err (smu->adev->dev,"Invalid power profile mode %d\n" , profile_mode); -return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==PP_SMC_POWER_PROFILE_POWERSAVING ) -return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - profile_mode); -if (workload_type <0 ) { -/* -* TODO: If some case need switch to powersave/default power mode -* then can consider enter WORKLOAD_COMPUTE/WORKLOAD_CUSTOM for power saving. -*/ -dev_dbg (smu->adev->dev,"Unsupported power profile mode %d on RENOIR\n" , profile_mode); -return -EINVAL ; - } - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ActiveProcessNotify, -1 << workload_type, -NULL ); -if (ret) { -dev_err_once (smu->adev->dev,"Fail to set workload type %d\n" , workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static int renoir_set_peak_clock_by_device (struct smu_context *smu) {int ret =0 ;@@ -1092,41 +1043,6 @@ static int renoir_set_watermarks_table(return 0 ; } -static int renoir_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT -* Not all profile modes are supported on arcturus. -*/ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - i); -if (workload_type <0 ) -continue ; - - size +=sysfs_emit_at (buf, size,"%2d %14s%s\n" , - i, profile_name[i], (i == smu->power_profile_mode) ?"*" :" " ); - } - -return size; -} -static int renoir_get_smu_metrics_data (struct smu_context *smu,MetricsMember_t member,uint32_t *value)@@ -1389,11 +1305,9 @@ static const struct pptable_funcs renoir_ppt_funcs = { .dpm_set_vcn_enable = renoir_dpm_set_vcn_enable, .dpm_set_jpeg_enable = renoir_dpm_set_jpeg_enable, .force_clk_levels = renoir_force_clk_levels, - .set_power_profile_mode = renoir_set_power_profile_mode, .set_performance_level = renoir_set_performance_level, .get_dpm_clock_table = renoir_get_dpm_clock_table, .set_watermarks_table = renoir_set_watermarks_table, - .get_power_profile_mode = renoir_get_power_profile_mode, .read_sensor = renoir_read_sensor, .check_fw_status = smu_v12_0_check_fw_status, .check_fw_version = smu_v12_0_check_fw_version,@@ -1429,7 +1343,6 @@ void renoir_set_ppt_funcs(struct smu_context *smu) smu->message_map = renoir_message_map; smu->clock_map = renoir_clk_map; smu->table_map = renoir_table_map; - smu->workload_map = renoir_workload_map; smu->smc_driver_if_version =SMU12_DRIVER_IF_VERSION ; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-88@@ -64,7 +64,6 @@ static struct cmn2asic_msg_mapping yellow_carp_message_map[SMU_MSG_MAX_COUNT] =MSG_MAP (PowerDownVcn, PPSMC_MSG_PowerDownVcn,1 ),MSG_MAP (PowerUpVcn, PPSMC_MSG_PowerUpVcn,1 ),MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,1 ), -MSG_MAP (ActiveProcessNotify, PPSMC_MSG_ActiveProcessNotify,1 ),MSG_MAP (PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload,1 ),MSG_MAP (SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,1 ), MSG_MAP(SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow, 1),@@ -135,14 +134,6 @@ static struct cmn2asic_mapping yellow_carp_table_map[SMU_TABLE_COUNT] = {TAB_MAP_VALID (CUSTOM_DPM ), TAB_MAP_VALID(DPMCLOCKS), }; - -static struct cmn2asic_mapping yellow_carp_workload_map[PP_SMC_POWER_PROFILE_COUNT ] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D ,WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VIDEO ,WORKLOAD_PPLIB_VIDEO_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VR ,WORKLOAD_PPLIB_VR_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_COMPUTE ,WORKLOAD_PPLIB_COMPUTE_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_CUSTOM ,WORKLOAD_PPLIB_CUSTOM_BIT ), -};static int yellow_carp_init_smc_tables (struct smu_context *smu) {@@ -543,81 +534,6 @@ static int yellow_carp_set_watermarks_table(struct smu_context *smu,return 0 ; } -static int yellow_carp_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT. -* Not all profile modes are supported on yellow carp. -*/ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - i); - -if (workload_type <0 ) -continue ; - - size +=sysfs_emit_at (buf, size,"%2d %14s%s\n" , - i, profile_name[i], (i == smu->power_profile_mode) ?"*" :" " ); - } - -return size; -} - -static int yellow_carp_set_power_profile_mode (struct smu_context *smu, -long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { -dev_err (smu->adev->dev,"Invalid power profile mode %d\n" , profile_mode); -return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==PP_SMC_POWER_PROFILE_POWERSAVING ) -return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - profile_mode); -if (workload_type <0 ) { -dev_dbg (smu->adev->dev,"Unsupported power profile mode %d on YELLOWCARP\n" , - profile_mode); -return -EINVAL ; - } - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ActiveProcessNotify, -1 << workload_type, -NULL ); -if (ret) { -dev_err_once (smu->adev->dev,"Fail to set workload type %d\n" , - workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static ssize_t yellow_carp_get_gpu_metrics (struct smu_context *smu,void **table) {@@ -1238,8 +1154,6 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = { .read_sensor = yellow_carp_read_sensor, .is_dpm_running = yellow_carp_is_dpm_running, .set_watermarks_table = yellow_carp_set_watermarks_table, - .get_power_profile_mode = yellow_carp_get_power_profile_mode, - .set_power_profile_mode = yellow_carp_set_power_profile_mode, .get_gpu_metrics = yellow_carp_get_gpu_metrics, .get_enabled_mask = smu_cmn_get_enabled_32_bits_mask, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask,@@ -1261,6 +1175,5 @@ void yellow_carp_set_ppt_funcs(struct smu_context *smu) smu->message_map = yellow_carp_message_map; smu->feature_map = yellow_carp_feature_mask_map; smu->table_map = yellow_carp_table_map; - smu->workload_map = yellow_carp_workload_map; smu->is_apu = true; } --2.25.1
Quoted 6 lines · Alex Deucher
Quoted 5 lines · Huang Rui
Quoted 2 lines · Mario Limonciello
Although this has been plumbed for Renoir, Green Sardine, Van Gogh, and Yellow Carp the functionality in the SMU doesn't do anything for
Quoted 13 lines
Quoted 3 lines
I double confirmed them in the firmware. These messages are actually existed in SMU firmware of Renoir, Van Gogh, and Green Sardine, we should not remove them in these platforms.
I heard that at least on renoir variants, the messages still exist, but they no longer do anything. >
AlexQuoted 4 lines
And for Yellow Carp, it is better to use a firmware check to skip the function than remove them entirely in case somebody doesn't upgrade his/her SBIOS.
For YC even on older SBIOS the function is a no-op and doesn't "do anything" from my understanding.
Quoted 424 lines
Quoted 424 lines
Thanks,
RayQuoted 420 lines
these APUs. Drop the associated code with them.
Signed-off-by Mario Limonciello <[email protected]>--- .../gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h | 4 +- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 86 ------------------ .../gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 87 ------------------- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 87 ------------------- 4 files changed, 2 insertions(+), 262 deletions(-)drivers/gpu/drm/amd/pm/inc/smu_v13_0_1_ppsmc.h +2
-2@@ -51,7 +51,7 @@#define PPSMC_MSG_PowerUpVcn 0x07 ///< Power up VCN; VCN is power gated by default#define PPSMC_MSG_SetHardMinVcn 0x08 ///< For wireless display#define PPSMC_MSG_SetSoftMinGfxclk 0x09 ///< Set SoftMin for GFXCLK, argument is frequency in MHz -#define PPSMC_MSG_ActiveProcessNotify 0x0A ///< Set active work load type +#define PPSMC_MSG_SPARE0 0x0A ///< Spare#define PPSMC_MSG_ForcePowerDownGfx 0x0B ///< Force power down GFX, i.e. enter GFXOFF#define PPSMC_MSG_PrepareMp1ForUnload 0x0C ///< Prepare PMFW for GFX driver unload#define PPSMC_MSG_SetDriverDramAddrHigh 0x0D ///< Set high 32 bits of DRAM address for Driver table transfer@@ -63,7 +63,7 @@#define PPSMC_MSG_SetHardMinSocclkByFreq 0x13 ///< Set hard min for SOC CLK#define PPSMC_MSG_SetSoftMinFclk 0x14 ///< Set hard min for FCLK#define PPSMC_MSG_SetSoftMinVcn 0x15 ///< Set soft min for VCN clocks (VCLK and DCLK) -#define PPSMC_MSG_SPARE0 0x16 ///< Spared +#define PPSMC_MSG_SPARE1 0x16 ///< Spare#define PPSMC_MSG_GetGfxclkFrequency 0x17 ///< Get GFX clock frequency#define PPSMC_MSG_GetFclkFrequency 0x18 ///< Get FCLK frequency#define PPSMC_MSG_AllowGfxOff 0x19 ///< Inform PMFW of allowing GFXOFF entrydrivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-86@@ -72,7 +72,6 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {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 ),MSG_MAP (SetHardMinIspiclkByFreq, PPSMC_MSG_SetHardMinIspiclkByFreq,0 ),MSG_MAP (SetHardMinIspxclkByFreq, PPSMC_MSG_SetHardMinIspxclkByFreq,0 ), MSG_MAP(SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh, 0),@@ -182,14 +181,6 @@ static struct cmn2asic_mapping vangogh_table_map[SMU_TABLE_COUNT] = { TAB_MAP_VALID(DPMCLOCKS), }; -static struct cmn2asic_mapping vangogh_workload_map[PP_SMC_POWER_PROFILE_COUNT ] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D ,WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VIDEO ,WORKLOAD_PPLIB_VIDEO_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VR ,WORKLOAD_PPLIB_VR_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_COMPUTE ,WORKLOAD_PPLIB_COMPUTE_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_CUSTOM ,WORKLOAD_PPLIB_CUSTOM_BIT ), -}; -static const uint8_t vangogh_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL ] = (SMU_THROTTLER_SPL_BIT ), [THROTTLER_STATUS_BIT_FPPT ] = (SMU_THROTTLER_FPPT_BIT ),@@ -1010,80 +1001,6 @@ static int vangogh_get_dpm_ultimate_freq(struct smu_context *smu,return ret; } -static int vangogh_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT -* Not all profile modes are supported on vangogh. -*/ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - i); - -if (workload_type <0 ) -continue ; - - size +=sysfs_emit_at (buf, size,"%2d %14s%s\n" , - i, profile_name[i], (i == smu->power_profile_mode) ?"*" :" " ); - } - -return size; -} - -static int vangogh_set_power_profile_mode (struct smu_context *smu,long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { -dev_err (smu->adev->dev,"Invalid power profile mode %d\n" , profile_mode); -return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==PP_SMC_POWER_PROFILE_POWERSAVING ) -return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - profile_mode); -if (workload_type <0 ) { -dev_dbg (smu->adev->dev,"Unsupported power profile mode %d on VANGOGH\n" , - profile_mode); -return -EINVAL ; - } - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ActiveProcessNotify, -1 << workload_type, -NULL ); -if (ret) { -dev_err_once (smu->adev->dev,"Fail to set workload type %d\n" , - workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} - static int vangogh_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_type clk_type, uint32_t min,@@ -2190,8 +2107,6 @@ static const struct pptable_funcs vangogh_ppt_funcs = { .set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters, .system_features_control = vangogh_system_features_control, .feature_is_enabled = smu_cmn_feature_is_enabled, - .set_power_profile_mode = vangogh_set_power_profile_mode, - .get_power_profile_mode = vangogh_get_power_profile_mode, .get_dpm_clock_table = vangogh_get_dpm_clock_table, .force_clk_levels = vangogh_force_clk_levels, .set_performance_level = vangogh_set_performance_level,@@ -2210,6 +2125,5 @@ void vangogh_set_ppt_funcs(struct smu_context *smu) smu->message_map = vangogh_message_map; smu->feature_map = vangogh_feature_mask_map; smu->table_map = vangogh_table_map; - smu->workload_map = vangogh_workload_map; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +0
-87@@ -58,7 +58,6 @@ static struct cmn2asic_msg_mapping renoir_message_map[SMU_MSG_MAX_COUNT] = {MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,1 ),MSG_MAP (SetAllowFclkSwitch, PPSMC_MSG_SetAllowFclkSwitch,1 ),MSG_MAP (SetMinVideoGfxclkFreq, PPSMC_MSG_SetMinVideoGfxclkFreq,1 ), -MSG_MAP (ActiveProcessNotify, PPSMC_MSG_ActiveProcessNotify,1 ),MSG_MAP (SetCustomPolicy, PPSMC_MSG_SetCustomPolicy,1 ),MSG_MAP (SetVideoFps, PPSMC_MSG_SetVideoFps,1 ), MSG_MAP(NumOfDisplays, PPSMC_MSG_SetDisplayCount, 1),@@ -120,14 +119,6 @@ static struct cmn2asic_mapping renoir_table_map[SMU_TABLE_COUNT] = { TAB_MAP_VALID(SMU_METRICS), }; -static struct cmn2asic_mapping renoir_workload_map[PP_SMC_POWER_PROFILE_COUNT ] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D ,WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VIDEO ,WORKLOAD_PPLIB_VIDEO_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VR ,WORKLOAD_PPLIB_VR_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_COMPUTE ,WORKLOAD_PPLIB_COMPUTE_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_CUSTOM ,WORKLOAD_PPLIB_CUSTOM_BIT ), -}; -static const uint8_t renoir_throttler_map[] = { [THROTTLER_STATUS_BIT_SPL ] = (SMU_THROTTLER_SPL_BIT ), [THROTTLER_STATUS_BIT_FPPT ] = (SMU_THROTTLER_FPPT_BIT ),@@ -854,46 +845,6 @@ static int renoir_force_clk_levels(struct smu_context *smu,return ret; } -static int renoir_set_power_profile_mode (struct smu_context *smu,long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { -dev_err (smu->adev->dev,"Invalid power profile mode %d\n" , profile_mode); -return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==PP_SMC_POWER_PROFILE_POWERSAVING ) -return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - profile_mode); -if (workload_type <0 ) { -/* -* TODO: If some case need switch to powersave/default power mode -* then can consider enter WORKLOAD_COMPUTE/WORKLOAD_CUSTOM for power saving. -*/ -dev_dbg (smu->adev->dev,"Unsupported power profile mode %d on RENOIR\n" , profile_mode); -return -EINVAL ; - } - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ActiveProcessNotify, -1 << workload_type, -NULL ); -if (ret) { -dev_err_once (smu->adev->dev,"Fail to set workload type %d\n" , workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static int renoir_set_peak_clock_by_device (struct smu_context *smu) {int ret =0 ;@@ -1092,41 +1043,6 @@ static int renoir_set_watermarks_table(return 0 ; } -static int renoir_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT -* Not all profile modes are supported on arcturus. -*/ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - i); -if (workload_type <0 ) -continue ; - - size +=sysfs_emit_at (buf, size,"%2d %14s%s\n" , - i, profile_name[i], (i == smu->power_profile_mode) ?"*" :" " ); - } - -return size; -} -static int renoir_get_smu_metrics_data (struct smu_context *smu,MetricsMember_t member,uint32_t *value)@@ -1389,11 +1305,9 @@ static const struct pptable_funcs renoir_ppt_funcs = { .dpm_set_vcn_enable = renoir_dpm_set_vcn_enable, .dpm_set_jpeg_enable = renoir_dpm_set_jpeg_enable, .force_clk_levels = renoir_force_clk_levels, - .set_power_profile_mode = renoir_set_power_profile_mode, .set_performance_level = renoir_set_performance_level, .get_dpm_clock_table = renoir_get_dpm_clock_table, .set_watermarks_table = renoir_set_watermarks_table, - .get_power_profile_mode = renoir_get_power_profile_mode, .read_sensor = renoir_read_sensor, .check_fw_status = smu_v12_0_check_fw_status, .check_fw_version = smu_v12_0_check_fw_version,@@ -1429,7 +1343,6 @@ void renoir_set_ppt_funcs(struct smu_context *smu) smu->message_map = renoir_message_map; smu->clock_map = renoir_clk_map; smu->table_map = renoir_table_map; - smu->workload_map = renoir_workload_map; smu->smc_driver_if_version =SMU12_DRIVER_IF_VERSION ; smu->is_apu = true; }drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-88@@ -64,7 +64,6 @@ static struct cmn2asic_msg_mapping yellow_carp_message_map[SMU_MSG_MAX_COUNT] =MSG_MAP (PowerDownVcn, PPSMC_MSG_PowerDownVcn,1 ),MSG_MAP (PowerUpVcn, PPSMC_MSG_PowerUpVcn,1 ),MSG_MAP (SetHardMinVcn, PPSMC_MSG_SetHardMinVcn,1 ), -MSG_MAP (ActiveProcessNotify, PPSMC_MSG_ActiveProcessNotify,1 ),MSG_MAP (PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload,1 ),MSG_MAP (SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,1 ), MSG_MAP(SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow, 1),@@ -135,14 +134,6 @@ static struct cmn2asic_mapping yellow_carp_table_map[SMU_TABLE_COUNT] = {TAB_MAP_VALID (CUSTOM_DPM ), TAB_MAP_VALID(DPMCLOCKS), }; - -static struct cmn2asic_mapping yellow_carp_workload_map[PP_SMC_POWER_PROFILE_COUNT ] = { -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_FULLSCREEN3D ,WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VIDEO ,WORKLOAD_PPLIB_VIDEO_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_VR ,WORKLOAD_PPLIB_VR_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_COMPUTE ,WORKLOAD_PPLIB_COMPUTE_BIT ), -WORKLOAD_MAP (PP_SMC_POWER_PROFILE_CUSTOM ,WORKLOAD_PPLIB_CUSTOM_BIT ), -};static int yellow_carp_init_smc_tables (struct smu_context *smu) {@@ -543,81 +534,6 @@ static int yellow_carp_set_watermarks_table(struct smu_context *smu,return 0 ; } -static int yellow_carp_get_power_profile_mode (struct smu_context *smu, -char *buf) -{ -static const char *profile_name[] = { -"BOOTUP_DEFAULT" , -"3D_FULL_SCREEN" , -"POWER_SAVING" , -"VIDEO" , -"VR" , -"COMPUTE" , -"CUSTOM" }; -uint32_t i, size =0 ; -int16_t workload_type =0 ; - -if (!buf) -return -EINVAL ; - -for (i =0 ; i <=PP_SMC_POWER_PROFILE_CUSTOM ; i++) { -/* -* Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT. -* Not all profile modes are supported on yellow carp. -*/ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - i); - -if (workload_type <0 ) -continue ; - - size +=sysfs_emit_at (buf, size,"%2d %14s%s\n" , - i, profile_name[i], (i == smu->power_profile_mode) ?"*" :" " ); - } - -return size; -} - -static int yellow_carp_set_power_profile_mode (struct smu_context *smu, -long *input,uint32_t size) -{ -int workload_type, ret; -uint32_t profile_mode = input[size]; - -if (profile_mode >PP_SMC_POWER_PROFILE_CUSTOM ) { -dev_err (smu->adev->dev,"Invalid power profile mode %d\n" , profile_mode); -return -EINVAL ; - } - -if (profile_mode ==PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT || - profile_mode ==PP_SMC_POWER_PROFILE_POWERSAVING ) -return 0 ; - -/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_WORKLOAD , - profile_mode); -if (workload_type <0 ) { -dev_dbg (smu->adev->dev,"Unsupported power profile mode %d on YELLOWCARP\n" , - profile_mode); -return -EINVAL ; - } - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ActiveProcessNotify, -1 << workload_type, -NULL ); -if (ret) { -dev_err_once (smu->adev->dev,"Fail to set workload type %d\n" , - workload_type); -return ret; - } - - smu->power_profile_mode = profile_mode; - -return 0 ; -} -static ssize_t yellow_carp_get_gpu_metrics (struct smu_context *smu,void **table) {@@ -1238,8 +1154,6 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = { .read_sensor = yellow_carp_read_sensor, .is_dpm_running = yellow_carp_is_dpm_running, .set_watermarks_table = yellow_carp_set_watermarks_table, - .get_power_profile_mode = yellow_carp_get_power_profile_mode, - .set_power_profile_mode = yellow_carp_set_power_profile_mode, .get_gpu_metrics = yellow_carp_get_gpu_metrics, .get_enabled_mask = smu_cmn_get_enabled_32_bits_mask, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask,@@ -1261,6 +1175,5 @@ void yellow_carp_set_ppt_funcs(struct smu_context *smu) smu->message_map = yellow_carp_message_map; smu->feature_map = yellow_carp_feature_mask_map; smu->table_map = yellow_carp_table_map; - smu->workload_map = yellow_carp_workload_map; smu->is_apu = true; } --2.25.1