drm/amdgpu/powerplay: add get_argument callback for vega20
Subsystems (2)
PATCH 1/9 drm/amdgpu/powerplay: add get_argument callback for vega20
For consistency with other vega parts.
--- drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 18 ++++++++--------- .../gpu/drm/amd/powerplay/hwmgr/vega20_thermal.c | 5 +---- .../gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c | 23 +++++----------------- .../gpu/drm/amd/powerplay/smumgr/vega20_smumgr.h | 1 - 4 files changed, 15 insertions(+), 32 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +9 -9
@@ -461,7 +461,7 @@ static int vega20_get_number_of_dpm_level(struct pp_hwmgr *hwmgr,"[GetNumOfDpmLevel] failed to get dpm levels!" , return ret); -vega20_read_arg_from_smc (hwmgr, num_of_levels); + *num_of_levels =smum_get_argument (hwmgr);PP_ASSERT_WITH_CODE (*num_of_levels >0 ,"[GetNumOfDpmLevel] number of clk levels is invalid!" , return -EINVAL );
@@ -481,7 +481,7 @@ static int vega20_get_dpm_frequency_by_index(struct pp_hwmgr *hwmgr,"[GetDpmFreqByIndex] failed to get dpm freq by index!" , return ret); -vega20_read_arg_from_smc (hwmgr, clk); + *clk =smum_get_argument (hwmgr);PP_ASSERT_WITH_CODE (*clk,"[GetDpmFreqByIndex] clk value is invalid!" , return -EINVAL );
@@ -1044,7 +1044,7 @@ static int vega20_od8_get_gfx_clock_base_voltage("[GetBaseVoltage] failed to get GFXCLK AVFS voltage from SMU!" , return ret); -vega20_read_arg_from_smc (hwmgr, voltage); + *voltage =smum_get_argument (hwmgr); *voltage = *voltage /VOLTAGE_SCALE ;return 0 ;
@@ -1401,7 +1401,7 @@ static int vega20_get_max_sustainable_clock(struct pp_hwmgr *hwmgr, (clock_select << 16))) == 0,"[GetMaxSustainableClock] Failed to get max DC clock from SMC!" , return ret); -vega20_read_arg_from_smc (hwmgr, clock); + *clock =smum_get_argument (hwmgr);/* if DC limit is zero, return AC limit */ if (*clock ==0 ) {
@@ -1410,7 +1410,7 @@ static int vega20_get_max_sustainable_clock(struct pp_hwmgr *hwmgr, (clock_select << 16))) == 0,"[GetMaxSustainableClock] failed to get max AC clock from SMC!" , return ret); -vega20_read_arg_from_smc (hwmgr, clock); + *clock =smum_get_argument (hwmgr); }return 0 ;
@@ -1770,14 +1770,14 @@ static int vega20_get_clock_ranges(struct pp_hwmgr *hwmgr, PPSMC_MSG_GetMaxDpmFreq, (clock_select << 16))) == 0,"[GetClockRanges] Failed to get max clock from SMC!" , return ret); -vega20_read_arg_from_smc (hwmgr, clock); + *clock =smum_get_argument (hwmgr); }else {PP_ASSERT_WITH_CODE ((ret =smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_GetMinDpmFreq, (clock_select <<16 ))) ==0 ,"[GetClockRanges] Failed to get min clock from SMC!" , return ret); -vega20_read_arg_from_smc (hwmgr, clock); + *clock =smum_get_argument (hwmgr); }return 0 ;
@@ -1862,7 +1862,7 @@ static int vega20_get_current_gfx_clk_freq(struct pp_hwmgr *hwmgr, uint32_t *gfx PPSMC_MSG_GetDpmClockFreq, (PPCLK_GFXCLK << 16))) == 0,"[GetCurrentGfxClkFreq] Attempt to get Current GFXCLK Frequency Failed!" , return ret); -vega20_read_arg_from_smc (hwmgr, &gfx_clk); + gfx_clk =smum_get_argument (hwmgr); *gfx_freq = gfx_clk *100 ;
@@ -1880,7 +1880,7 @@ static int vega20_get_current_mclk_freq(struct pp_hwmgr *hwmgr, uint32_t *mclk_f PPSMC_MSG_GetDpmClockFreq, (PPCLK_UCLK << 16))) == 0,"[GetCurrentMClkFreq] Attempt to get Current MCLK Frequency Failed!" , return ret); -vega20_read_arg_from_smc (hwmgr, &mem_clk); + mem_clk =smum_get_argument (hwmgr); *mclk_freq = mem_clk *100 ;
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_thermal.c +1 -4
@@ -37,10 +37,7 @@ static int vega20_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm) PPSMC_MSG_GetCurrentRpm)) == 0,"Attempt to get current RPM from SMC Failed!" , return ret); -PP_ASSERT_WITH_CODE ((ret =vega20_read_arg_from_smc (hwmgr, - current_rpm)) ==0 , -"Attempt to read current RPM from SMC Failed!" , - return ret); + *current_rpm =smum_get_argument (hwmgr);return 0 ; }
drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c +5 -18
@@ -148,19 +148,11 @@ static int vega20_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr,return (ret == PPSMC_Result_OK) ?0 : -EIO ; } -/* -* Retrieve an argument from SMC. -* @param hwmgr the address of the powerplay hardware manager. -* @param arg pointer to store the argument from SMC. -* @return Always return 0. -*/ -int vega20_read_arg_from_smc (struct pp_hwmgr *hwmgr,uint32_t *arg) +static uint32_t vega20_get_argument (struct pp_hwmgr *hwmgr) {struct amdgpu_device *adev = hwmgr->adev; - *arg =RREG32_SOC15 (MP1 ,0 , mmMP1_SMN_C2PMSG_82); - -return 0 ; +return RREG32_SOC15 (MP1 ,0 , mmMP1_SMN_C2PMSG_82); }/*
@@ -345,18 +337,12 @@ int vega20_get_enabled_smc_features(struct pp_hwmgr *hwmgr, PPSMC_MSG_GetEnabledSmuFeaturesLow)) == 0,"[GetEnabledSMCFeatures] Attemp to get SMU features Low failed!" , return ret); -PP_ASSERT_WITH_CODE ((ret =vega20_read_arg_from_smc (hwmgr, - &smc_features_low)) ==0 , -"[GetEnabledSMCFeatures] Attemp to read SMU features Low argument failed!" , - return ret); + smc_features_low =vega20_get_argument (hwmgr);PP_ASSERT_WITH_CODE ((ret =vega20_send_msg_to_smc (hwmgr, PPSMC_MSG_GetEnabledSmuFeaturesHigh)) ==0 ,"[GetEnabledSMCFeatures] Attemp to get SMU features High failed!" , return ret); -PP_ASSERT_WITH_CODE ((ret =vega20_read_arg_from_smc (hwmgr, - &smc_features_high)) ==0 , -"[GetEnabledSMCFeatures] Attemp to read SMU features High argument failed!" , - return ret); + smc_features_high =vega20_get_argument (hwmgr); *features_enabled = ((((uint64_t )smc_features_low <<SMU_FEATURES_LOW_SHIFT ) &SMU_FEATURES_LOW_MASK ) | (((uint64_t )smc_features_high <<SMU_FEATURES_HIGH_SHIFT ) &SMU_FEATURES_HIGH_MASK ));
@@ -584,4 +570,5 @@ const struct pp_smumgr_func vega20_smu_funcs = { .download_pptable_settings = NULL, .upload_pptable_settings = NULL, .is_dpm_running = vega20_is_dpm_running, + .get_argument = vega20_get_argument, };
drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.h +0 -1
@@ -47,7 +47,6 @@ struct vega20_smumgr {#define SMU_FEATURES_HIGH_MASK 0xFFFFFFFF00000000#define SMU_FEATURES_HIGH_SHIFT 32 -int vega20_read_arg_from_smc (struct pp_hwmgr *hwmgr,uint32_t *arg);int vega20_copy_table_from_smc (struct pp_hwmgr *hwmgr,uint8_t *table,int16_t table_id); int vega20_copy_table_to_smc(struct pp_hwmgr *hwmgr,
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180921035449.6996-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 2/9 drm/amdgpu/powerplay: Move vega10_enable_smc_features
to vega10_smumgr.c. For consistency with other vega parts.
--- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 11 +---------- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h | 2 -- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 1 + drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | 1 + drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c | 10 ++++++++++ drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h | 2 ++ 6 files changed, 15 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -10
@@ -39,6 +39,7 @@#include "soc15_common.h" #include "pppcielanes.h" #include "vega10_hwmgr.h" +#include "vega10_smumgr.h" #include "vega10_processpptables.h" #include "vega10_pptable.h" #include "vega10_thermal.h"
@@ -4940,16 +4941,6 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = { .get_performance_level = vega10_get_performance_level, }; -int vega10_enable_smc_features (struct pp_hwmgr *hwmgr, -bool enable,uint32_t feature_mask) -{ -int msg = enable ? PPSMC_MSG_EnableSmuFeatures : - PPSMC_MSG_DisableSmuFeatures; - -return smum_send_msg_to_smc_with_parameter (hwmgr, - msg, feature_mask); -} -int vega10_hwmgr_init (struct pp_hwmgr *hwmgr) { hwmgr->hwmgr_func = &vega10_hwmgr_funcs;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h +0 -2
@@ -441,7 +441,5 @@ int vega10_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate);int vega10_update_samu_dpm (struct pp_hwmgr *hwmgr,bool bgate);int vega10_update_acp_dpm (struct pp_hwmgr *hwmgr,bool bgate);int vega10_enable_disable_vce_dpm (struct pp_hwmgr *hwmgr,bool enable); -int vega10_enable_smc_features (struct pp_hwmgr *hwmgr, -bool enable,uint32_t feature_mask);#endif /* _VEGA10_HWMGR_H_ */
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c +1 -0
@@ -23,6 +23,7 @@#include "hwmgr.h" #include "vega10_hwmgr.h" +#include "vega10_smumgr.h" #include "vega10_powertune.h" #include "vega10_ppsmc.h" #include "vega10_inc.h"
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +1 -0
@@ -23,6 +23,7 @@#include "vega10_thermal.h" #include "vega10_hwmgr.h" +#include "vega10_smumgr.h" #include "vega10_ppsmc.h" #include "vega10_inc.h" #include "soc15_common.h"
drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c +10 -0
@@ -88,6 +88,16 @@ static int vega10_copy_table_to_smc(struct pp_hwmgr *hwmgr,return 0 ; } +int vega10_enable_smc_features (struct pp_hwmgr *hwmgr, +bool enable,uint32_t feature_mask) +{ +int msg = enable ? PPSMC_MSG_EnableSmuFeatures : + PPSMC_MSG_DisableSmuFeatures; + +return smum_send_msg_to_smc_with_parameter (hwmgr, + msg, feature_mask); +} +static int vega10_get_smc_features (struct pp_hwmgr *hwmgr,uint32_t *features_enabled) {
drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h +2 -0
@@ -42,6 +42,8 @@ struct vega10_smumgr { struct smu_table_array smu_tables; }; +int vega10_enable_smc_features (struct pp_hwmgr *hwmgr, +bool enable,uint32_t feature_mask);#endif
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/9 drm/amdgpu/powerplay: add smu smc_table_manager callback for vega12
In reply to a message not in the archiveFor consistency with other asics.
--- drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 8 ++++---- .../gpu/drm/amd/powerplay/smumgr/vega12_smumgr.c | 22 ++++++++++++++++++---- .../gpu/drm/amd/powerplay/smumgr/vega12_smumgr.h | 4 ---- 3 files changed, 22 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +4 -4
@@ -745,8 +745,8 @@ static int vega12_init_smc_table(struct pp_hwmgr *hwmgr)memcpy (pp_table, pptable_information->smc_pptable,sizeof (PPTable_t)); - result =vega12_copy_table_to_smc (hwmgr, - (uint8_t *)pp_table,TABLE_PPTABLE ); + result =smum_smc_table_manager (hwmgr, + (uint8_t *)pp_table,TABLE_PPTABLE , false);PP_ASSERT_WITH_CODE (!result, "Failed to upload PPtable!", return result);
@@ -2103,8 +2103,8 @@ static int vega12_display_configuration_changed_task(struct pp_hwmgr *hwmgr)if ((data->water_marks_bitmap & WaterMarksExist) && !(data->water_marks_bitmap & WaterMarksLoaded)) { - result =vega12_copy_table_to_smc (hwmgr, - (uint8_t *)wm_table,TABLE_WATERMARKS ); + result =smum_smc_table_manager (hwmgr, + (uint8_t *)wm_table,TABLE_WATERMARKS , false); PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return EINVAL); data->water_marks_bitmap |= WaterMarksLoaded; }
drivers/gpu/drm/amd/powerplay/smumgr/vega12_smumgr.c +18 -4
@@ -37,8 +37,8 @@* @param hwmgr the address of the HW manager * @param table_id the driver's table ID to copy from */ -int vega12_copy_table_from_smc (struct pp_hwmgr *hwmgr, -uint8_t *table,int16_t table_id) +static int vega12_copy_table_from_smc (struct pp_hwmgr *hwmgr, +uint8_t *table,int16_t table_id) {struct vega12_smumgr *priv = (struct vega12_smumgr *)(hwmgr->smu_backend);
@@ -75,8 +75,8 @@ int vega12_copy_table_from_smc(struct pp_hwmgr *hwmgr,* @param hwmgr the address of the HW manager * @param table_id the table to copy from */ -int vega12_copy_table_to_smc (struct pp_hwmgr *hwmgr, -uint8_t *table,int16_t table_id) +static int vega12_copy_table_to_smc (struct pp_hwmgr *hwmgr, +uint8_t *table,int16_t table_id) {struct vega12_smumgr *priv = (struct vega12_smumgr *)(hwmgr->smu_backend);
@@ -351,6 +351,19 @@ static int vega12_start_smu(struct pp_hwmgr *hwmgr)return 0 ; } +static int vega12_smc_table_manager (struct pp_hwmgr *hwmgr,uint8_t *table, +uint16_t table_id,bool rw) +{ +int ret; + +if (rw) + ret =vega12_copy_table_from_smc (hwmgr, table, table_id); +else + ret =vega12_copy_table_to_smc (hwmgr, table, table_id); + +return ret; +} +const struct pp_smumgr_func vega12_smu_funcs = { .smu_init = &vega12_smu_init, .smu_fini = &vega12_smu_fini,
@@ -362,4 +375,5 @@ const struct pp_smumgr_func vega12_smu_funcs = { .upload_pptable_settings = NULL, .is_dpm_running = vega12_is_dpm_running, .get_argument = smu9_get_argument, + .smc_table_manager = vega12_smc_table_manager, };
drivers/gpu/drm/amd/powerplay/smumgr/vega12_smumgr.h +0 -4
@@ -48,10 +48,6 @@ struct vega12_smumgr {#define SMU_FEATURES_HIGH_MASK 0xFFFFFFFF00000000#define SMU_FEATURES_HIGH_SHIFT 32 -int vega12_copy_table_from_smc (struct pp_hwmgr *hwmgr, -uint8_t *table,int16_t table_id); -int vega12_copy_table_to_smc (struct pp_hwmgr *hwmgr, -uint8_t *table,int16_t table_id);int vega12_enable_smc_features (struct pp_hwmgr *hwmgr,bool enable,uint64_t feature_mask); int vega12_get_enabled_smc_features(struct pp_hwmgr *hwmgr,
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/9 drm/amdgpu/powerplay: add smu smc_table_manager callback for vega20
In reply to a message not in the archiveFor consistency with other asics.
--- drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 32 +++++++++++----------- .../gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c | 22 ++++++++++++--- .../gpu/drm/amd/powerplay/smumgr/vega20_smumgr.h | 4 --- 3 files changed, 34 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +16 -16
@@ -743,8 +743,8 @@ static int vega20_init_smc_table(struct pp_hwmgr *hwmgr)memcpy (pp_table, pptable_information->smc_pptable,sizeof (PPTable_t)); - result =vega20_copy_table_to_smc (hwmgr, - (uint8_t *)pp_table,TABLE_PPTABLE ); + result =smum_smc_table_manager (hwmgr, + (uint8_t *)pp_table,TABLE_PPTABLE , false);PP_ASSERT_WITH_CODE (!result,"[InitSMCTable] Failed to upload PPtable!" , return result);
@@ -1067,7 +1067,7 @@ static int vega20_od8_initialize_default_settings(vega20_od8_set_feature_id (hwmgr);/* Set default values */ - ret =vega20_copy_table_from_smc (hwmgr, (uint8_t *)od_table,TABLE_OVERDRIVE ); + ret =smum_smc_table_manager (hwmgr, (uint8_t *)od_table,TABLE_OVERDRIVE , true);PP_ASSERT_WITH_CODE (!ret,"Failed to export over drive table!" , return ret);
@@ -1195,7 +1195,7 @@ static int vega20_od8_initialize_default_settings( } } - ret =vega20_copy_table_to_smc (hwmgr, (uint8_t *)od_table,TABLE_OVERDRIVE ); + ret =smum_smc_table_manager (hwmgr, (uint8_t *)od_table,TABLE_OVERDRIVE , false);PP_ASSERT_WITH_CODE (!ret,"Failed to import over drive table!" , return ret);
@@ -1214,7 +1214,7 @@ static int vega20_od8_set_settings(struct vega20_od8_single_setting *od8_settings = data->od8_settings.od8_settings_array; - ret =vega20_copy_table_from_smc (hwmgr, (uint8_t *)(&od_table),TABLE_OVERDRIVE ); + ret =smum_smc_table_manager (hwmgr, (uint8_t *)(&od_table),TABLE_OVERDRIVE , true);PP_ASSERT_WITH_CODE (!ret,"Failed to export over drive table!" , return ret);
@@ -1271,7 +1271,7 @@ static int vega20_od8_set_settings(break ; } - ret =vega20_copy_table_to_smc (hwmgr, (uint8_t *)(&od_table),TABLE_OVERDRIVE ); + ret =smum_smc_table_manager (hwmgr, (uint8_t *)(&od_table),TABLE_OVERDRIVE , false);PP_ASSERT_WITH_CODE (!ret,"Failed to import over drive table!" , return ret);
@@ -1841,7 +1841,7 @@ static int vega20_get_gpu_power(struct pp_hwmgr *hwmgr,int ret =0 ;SmuMetrics_t metrics_table; - ret =vega20_copy_table_from_smc (hwmgr, (uint8_t *)&metrics_table,TABLE_SMU_METRICS ); + ret =smum_smc_table_manager (hwmgr, (uint8_t *)&metrics_table,TABLE_SMU_METRICS , true);PP_ASSERT_WITH_CODE (!ret,"Failed to export SMU METRICS table!" , return ret);
@@ -1893,7 +1893,7 @@ static int vega20_get_current_activity_percent(struct pp_hwmgr *hwmgr,int ret =0 ;SmuMetrics_t metrics_table; - ret =vega20_copy_table_from_smc (hwmgr, (uint8_t *)&metrics_table,TABLE_SMU_METRICS ); + ret =smum_smc_table_manager (hwmgr, (uint8_t *)&metrics_table,TABLE_SMU_METRICS , true);PP_ASSERT_WITH_CODE (!ret,"Failed to export SMU METRICS table!" , return ret);
@@ -2612,18 +2612,18 @@ static int vega20_odn_edit_dpm_table(struct pp_hwmgr *hwmgr, data->gfxclk_overdrive = false; data->memclk_overdrive = false; - ret =vega20_copy_table_from_smc (hwmgr, - (uint8_t *)od_table, -TABLE_OVERDRIVE ); + ret =smum_smc_table_manager (hwmgr, + (uint8_t *)od_table, +TABLE_OVERDRIVE , true);PP_ASSERT_WITH_CODE (!ret,"Failed to export overdrive table!" , return ret);break ;case PP_OD_COMMIT_DPM_TABLE : - ret =vega20_copy_table_to_smc (hwmgr, - (uint8_t *)od_table, -TABLE_OVERDRIVE ); + ret =smum_smc_table_manager (hwmgr, + (uint8_t *)od_table, +TABLE_OVERDRIVE , false);PP_ASSERT_WITH_CODE (!ret,"Failed to import overdrive table!" , return ret);
@@ -2847,8 +2847,8 @@ static int vega20_display_configuration_changed_task(struct pp_hwmgr *hwmgr)if ((data->water_marks_bitmap & WaterMarksExist) && !(data->water_marks_bitmap & WaterMarksLoaded)) { - result =vega20_copy_table_to_smc (hwmgr, - (uint8_t *)wm_table,TABLE_WATERMARKS ); + result =smum_smc_table_manager (hwmgr, + (uint8_t *)wm_table,TABLE_WATERMARKS , false);PP_ASSERT_WITH_CODE (!result,"Failed to update WMTABLE!" , return result);
drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c +18 -4
@@ -160,8 +160,8 @@ static uint32_t vega20_get_argument(struct pp_hwmgr *hwmgr)* @param hwmgr the address of the HW manager * @param table_id the driver's table ID to copy from */ -int vega20_copy_table_from_smc (struct pp_hwmgr *hwmgr, -uint8_t *table,int16_t table_id) +static int vega20_copy_table_from_smc (struct pp_hwmgr *hwmgr, +uint8_t *table,int16_t table_id) {struct vega20_smumgr *priv = (struct vega20_smumgr *)(hwmgr->smu_backend);
@@ -200,8 +200,8 @@ int vega20_copy_table_from_smc(struct pp_hwmgr *hwmgr,* @param hwmgr the address of the HW manager * @param table_id the table to copy from */ -int vega20_copy_table_to_smc (struct pp_hwmgr *hwmgr, -uint8_t *table,int16_t table_id) +static int vega20_copy_table_to_smc (struct pp_hwmgr *hwmgr, +uint8_t *table,int16_t table_id) {struct vega20_smumgr *priv = (struct vega20_smumgr *)(hwmgr->smu_backend);
@@ -560,6 +560,19 @@ static bool vega20_is_dpm_running(struct pp_hwmgr *hwmgr)return false; } +static int vega20_smc_table_manager (struct pp_hwmgr *hwmgr,uint8_t *table, +uint16_t table_id,bool rw) +{ +int ret; + +if (rw) + ret =vega20_copy_table_from_smc (hwmgr, table, table_id); +else + ret =vega20_copy_table_to_smc (hwmgr, table, table_id); + +return ret; +} +const struct pp_smumgr_func vega20_smu_funcs = { .smu_init = &vega20_smu_init, .smu_fini = &vega20_smu_fini,
@@ -571,4 +584,5 @@ const struct pp_smumgr_func vega20_smu_funcs = { .upload_pptable_settings = NULL, .is_dpm_running = vega20_is_dpm_running, .get_argument = vega20_get_argument, + .smc_table_manager = vega20_smc_table_manager, };
drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.h +0 -4
@@ -47,10 +47,6 @@ struct vega20_smumgr {#define SMU_FEATURES_HIGH_MASK 0xFFFFFFFF00000000#define SMU_FEATURES_HIGH_SHIFT 32 -int vega20_copy_table_from_smc (struct pp_hwmgr *hwmgr, -uint8_t *table,int16_t table_id); -int vega20_copy_table_to_smc (struct pp_hwmgr *hwmgr, -uint8_t *table,int16_t table_id);int vega20_enable_smc_features (struct pp_hwmgr *hwmgr,bool enable,uint64_t feature_mask); int vega20_get_enabled_smc_features(struct pp_hwmgr *hwmgr,
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/9 drm/amdgpu: add new AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK sensor
In reply to a message not in the archiveFor getting the 64 bit enabled smc feature mask from vega parts.
--- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +1 -0
@@ -113,6 +113,7 @@ enum amd_pp_sensors {AMDGPU_PP_SENSOR_GPU_POWER ,AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK ,AMDGPU_PP_SENSOR_STABLE_PSTATE_MCLK , + AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK, }; enum amd_pp_task {
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/9 drm/amdgpu: implement ENABLED_SMC_FEATURES_MASK sensor for vega10
In reply to a message not in the archiveSo we can query what features are enabled for debugging.
--- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 5 +++++ drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c | 8 ++++---- drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +5 -0
@@ -3714,6 +3714,11 @@ static int vega10_read_sensor(struct pp_hwmgr *hwmgr, int idx,SMUSVI0_PLANE0_CURRENTVID__CURRENT_SVI0_PLANE0_VID__SHIFT ; *((uint32_t *)value) = (uint32_t )convert_to_vddc ((uint8_t )val_vid);return 0 ; +case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK : + ret =vega10_get_enabled_smc_features (hwmgr, (uint64_t *)value); +if (!ret) + *size =8 ; +break ;default : ret = -EINVAL ;break ;
drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c +4 -4
@@ -98,8 +98,8 @@ int vega10_enable_smc_features(struct pp_hwmgr *hwmgr, msg, feature_mask); } -static int vega10_get_smc_features (struct pp_hwmgr *hwmgr, -uint32_t *features_enabled) +int vega10_get_enabled_smc_features (struct pp_hwmgr *hwmgr, +uint64_t *features_enabled) {if (features_enabled ==NULL )return -EINVAL ;
@@ -112,9 +112,9 @@ static int vega10_get_smc_features(struct pp_hwmgr *hwmgr,static bool vega10_is_dpm_running (struct pp_hwmgr *hwmgr) { -uint32_t features_enabled =0 ; +uint64_t features_enabled =0 ; -vega10_get_smc_features (hwmgr, &features_enabled); +vega10_get_enabled_smc_features (hwmgr, &features_enabled);if (features_enabled &SMC_DPM_FEATURES )return true;
drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h +2 -0
@@ -44,6 +44,8 @@ struct vega10_smumgr {int vega10_enable_smc_features (struct pp_hwmgr *hwmgr,bool enable,uint32_t feature_mask); +int vega10_get_enabled_smc_features (struct pp_hwmgr *hwmgr, +uint64_t *features_enabled);#endif
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/9 drm/amdgpu: implement ENABLED_SMC_FEATURES_MASK sensor for vega12
In reply to a message not in the archiveSo we can query what features are enabled for debugging.
--- drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +5 -1
@@ -1317,7 +1317,11 @@ static int vega12_read_sensor(struct pp_hwmgr *hwmgr, int idx,break ;case AMDGPU_PP_SENSOR_GPU_POWER : ret =vega12_get_gpu_power (hwmgr, (uint32_t *)value); - +break ; +case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK : + ret =vega12_get_enabled_smc_features (hwmgr, (uint64_t *)value); +if (!ret) + *size =8 ;break ;default : ret = -EINVAL ;
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/9 drm/amdgpu: implement ENABLED_SMC_FEATURES_MASK sensor for vega20
In reply to a message not in the archiveSo we can query what features are enabled for debugging.
--- drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +5 -0
@@ -1941,6 +1941,11 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx, *size =16 ; ret =vega20_get_gpu_power (hwmgr, (uint32_t *)value);break ; +case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK : + ret =vega20_get_enabled_smc_features (hwmgr, (uint64_t *)value); +if (!ret) + *size =8 ; +break ;default : ret = -EINVAL ;break ;
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/9 drm/amdgpu: print smc feature mask in debugfs amdgpu_pm_info
In reply to a message not in the archivePrint the enabled smc feature mask in amdgpu_pm_info for debugging.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +5 -0
@@ -1976,6 +1976,7 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev)static int amdgpu_debugfs_pm_info_pp (struct seq_file *m,struct amdgpu_device *adev) {uint32_t value; +uint64_t value64;uint32_t query =0 ;int size;
@@ -2014,6 +2015,10 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *aseq_printf (m,"GPU Load: %u %%\n" , value);seq_printf (m,"\n" ); +/* SMC feature mask */ +if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK , (void *)&value64, &size)) +seq_printf (m,"SMC Feature Mask: 0x%016llx\n" , value64); +/* UVD clocks */ if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_UVD_POWER , (void *)&value, &size)) {if (!value) {
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180921035449.6996-9-alexander.deucher-5C7GfCeVMHo@public.gmane.org
Zhu, Rex
Reviewed-by Rex ZhuRE: [PATCH 9/9] drm/amdgpu: print smc feature mask in debugfs amdgpu_pm_info
Series is:
Regards
Rex
Quoted 47 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, September 21, 2018 11:55 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 9/9] drm/amdgpu: print smc feature mask in debugfsamdgpu_pm_infoPrint the enabled smc feature mask in
amdgpu_pm_infofor debugging.Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0
-0@@ -1976,6 +1976,7 @@ void amdgpu_pm_compute_clocks(struct
amdgpu_device*adev) static intamdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *adev){drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1
-0uint32_t value; +uint64_t value64;uint32_t query =0 ;int size;@@ -2014,6 +2015,10 @@ static int amdgpu_debugfs_pm_info_pp(struct
seq_file*m, structamdgpu_device*adrivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2
-0seq_printf (m,"GPU Load: %u %%\n" , value);seq_printf (m,"\n" ); +/* SMC feature mask */ + if (!amdgpu_dpm_read_sensor(adev,
AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK, (void *)&value64, &size))drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2
-0+seq_printf (m,"SMC Feature Mask: 0x%016llx\n" , value64); +/* UVD clocks */ if (!amdgpu_dpm_read_sensor(adev,
AMDGPU_PP_SENSOR_UVD_POWER, (void *)&value, &size)) {
if (!value) {
--
2.13.6
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx