A new set of Linux OD interfaces
Subsystems (3)
cover A new set of Linux OD interfaces
The existing OD interface pp_od_clk_voltage is unable to meet the growing demands for more OD functionalities. Since the buf used within it comes with size limit as one page. With more OD functionalities added, we will hit that limit soon.
To better meet the growing demainds, a new set of OD interfaces are designed. With this new design, there will be multiple interfaces exposed with each representing a single OD functionality. And all those interfaces will be arranged in a tree liked hierarchy as below. Meanwhile all functionalities for the same component will be arranged under the same directory.
gpu_od/
├── fan_ctrl
├── acoustic_limit_rpm_threshold
├── acoustic_target_rpm_threshold
├── fan_curve
├── fan_minimum_pwm
├── fan_mode
├── fan_target_temperature...
...(more to be added)
Evan Quan (8):
drm/amd/pm: introduce a new set of OD interfaces drm/amdgpu: revise the device initialization sequences drm/amd/pm: add fan mode OD setting support for SMU13 drm/amd/pm: add fan temperature/pwm curve OD setting support for SMU13 drm/amd/pm: add fan acoustic limit OD setting support for SMU13 drm/amd/pm: add fan acoustic target OD setting support for SMU13 drm/amd/pm: add fan target temperature OD setting support for SMU13 drm/amd/pm: add fan minimum pwm OD setting support for SMU13
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 39 +- .../gpu/drm/amd/include/kgd_pp_interface.h | 14 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 676 +++++++++++++++++- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 16 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 6 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 316 +++++++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 316 +++++++- 8 files changed, 1370 insertions(+), 25 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/8 drm/amd/pm: introduce a new set of OD interfaces
There will be multiple interfaces(sysfs files) exposed with each representing a single OD functionality. And all those interface will be arranged in a tree liked hierarchy with the top dir as "gpu_od". Meanwhile all functionalities for the same component will be arranged under the same directory.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 264 ++++++++++++++++++++- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 2 + 3 files changed, 266 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
@@ -3622,6 +3622,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,INIT_LIST_HEAD (&adev->ras_list); +INIT_LIST_HEAD (&adev->pm.od_kobj_list); +INIT_DELAYED_WORK (&adev->delayed_init_work, amdgpu_device_delayed_init_work_handler); INIT_DELAYED_WORK(&adev->gfx.gfx_off_delay_work,
drivers/gpu/drm/amd/pm/amdgpu_pm.c +262 -2
293 lines not on this page · raw message
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +2 -0
@@ -366,6 +366,8 @@ struct amdgpu_pm {struct config_table_setting config_table;/* runtime mode */ enum amdgpu_runpm_mode rpm_mode; + +struct list_head od_kobj_list; }; int amdgpu_dpm_read_sensor(struct amdgpu_device *adev, enum amd_pp_sensors sensor,
Signature · 1 line
2.34.1
PATCH 2/8 drm/amdgpu: revise the device initialization sequences
In reply to Evan QuanBy placing the sysfs interfaces creation after .late_int. Since some operations performed during .late_init may affect how the sysfs interfaces should be created.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 37 ++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +21 -16
@@ -3860,22 +3860,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,/* Get a log2 for easy divisions. */ adev->mm_stats.log2_max_MBps =ilog2 (max (1u , max_MBps)); - r =amdgpu_atombios_sysfs_init (adev); -if (r) -drm_err (&adev->ddev, -"registering atombios sysfs failed (%d).\n" , r); - - r =amdgpu_pm_sysfs_init (adev); -if (r) -DRM_ERROR ("registering pm sysfs failed (%d).\n" , r); - - r =amdgpu_ucode_sysfs_init (adev); -if (r) { - adev->ucode_sysfs_en = false; -DRM_ERROR ("Creating firmware sysfs failed (%d).\n" , r); - }else - adev->ucode_sysfs_en = true; -/* * Register gpu instance before amdgpu_device_enable_mgpu_fan_boost. * Otherwise the mgpu fan boost feature will be skipped due to the
@@ -3904,6 +3888,27 @@ int amdgpu_device_init(struct amdgpu_device *adev,flush_delayed_work (&adev->delayed_init_work); } +/* +* Place those sysfs registering after `late_init`. As some of those +* operations performed in `late_init` might affect the sysfs +* interfaces creating. +*/ + r =amdgpu_atombios_sysfs_init (adev); +if (r) +drm_err (&adev->ddev, +"registering atombios sysfs failed (%d).\n" , r); + + r =amdgpu_pm_sysfs_init (adev); +if (r) +DRM_ERROR ("registering pm sysfs failed (%d).\n" , r); + + r =amdgpu_ucode_sysfs_init (adev); +if (r) { + adev->ucode_sysfs_en = false; +DRM_ERROR ("Creating firmware sysfs failed (%d).\n" , r); + }else + adev->ucode_sysfs_en = true; + r =sysfs_create_files (&adev->dev->kobj, amdgpu_dev_attributes);if (r)dev_err (adev->dev,"Could not create amdgpu device attr\n" );
Signature · 1 line
2.34.1
PATCH 3/8 drm/amd/pm: add fan mode OD setting support for SMU13
In reply to Evan QuanAdd SMU13 fan mode OD setting support.
--- .../gpu/drm/amd/include/kgd_pp_interface.h | 4 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 189 +++++++++++++++++- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 4 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 1 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 35 +++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 35 +++- 7 files changed, 262 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +3 -1
@@ -113,6 +113,7 @@ enum pp_clock_type {OD_RANGE ,OD_VDDGFX_OFFSET ,OD_CCLK , + OD_FAN_MODE, }; enum amd_pp_sensors {
@@ -185,7 +186,8 @@ enum PP_OD_DPM_TABLE_COMMAND {PP_OD_EDIT_VDDC_CURVE ,PP_OD_RESTORE_DEFAULT_TABLE ,PP_OD_COMMIT_DPM_TABLE , -PP_OD_EDIT_VDDGFX_OFFSET +PP_OD_EDIT_VDDGFX_OFFSET , + PP_OD_EDIT_FAN_MODE, }; struct pp_states_info {
drivers/gpu/drm/amd/pm/amdgpu_pm.c +188 -1
195 lines not on this page · raw message
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +4 -0
@@ -314,6 +314,9 @@ struct config_table_settinguint16_t fclk_average_tau; }; +#define OD_OPS_SUPPORT_FAN_MODE_RETRIEVE BIT(0) +#define OD_OPS_SUPPORT_FAN_MODE_SET BIT(1) +struct amdgpu_pm {struct mutex mutex;u32 current_sclk;
@@ -368,6 +371,7 @@ struct amdgpu_pm {enum amdgpu_runpm_mode rpm_mode;struct list_head od_kobj_list; +uint32_t od_feature_mask; }; int amdgpu_dpm_read_sensor(struct amdgpu_device *adev, enum amd_pp_sensors sensor,
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -0
@@ -2481,6 +2481,8 @@ static enum smu_clk_type smu_convert_to_smuclk(enum pp_clock_type type) clk_type =SMU_OD_VDDGFX_OFFSET ;break ;case OD_CCLK : clk_type =SMU_OD_CCLK ;break ; +case OD_FAN_MODE : + clk_type =SMU_OD_FAN_MODE ;break ;default : clk_type =SMU_CLK_COUNT ;break ; }
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +1 -0
@@ -278,6 +278,7 @@ enum smu_clk_type {SMU_OD_VDDC_CURVE ,SMU_OD_RANGE ,SMU_OD_VDDGFX_OFFSET , +SMU_OD_FAN_MODE , SMU_CLK_COUNT, };
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +32 -3
@@ -101,6 +101,7 @@#define PP_OD_FEATURE_UCLK_FMIN 2#define PP_OD_FEATURE_UCLK_FMAX 3#define PP_OD_FEATURE_GFX_VF_CURVE 4 +#define PP_OD_FEATURE_FAN_MODE 5static struct cmn2asic_msg_mapping smu_v13_0_0_message_map[SMU_MSG_MAX_COUNT ] = {MSG_MAP (TestMessage, PPSMC_MSG_TestMessage,1 ),
@@ -1083,6 +1084,10 @@ static void smu_v13_0_0_get_od_setting_limits(struct smu_context *smu, od_min_setting = overdrive_lowerlimits->VoltageOffsetPerZoneBoundary; od_max_setting = overdrive_upperlimits->VoltageOffsetPerZoneBoundary;break ; +case PP_OD_FEATURE_FAN_MODE : + od_min_setting = overdrive_lowerlimits->FanMode; + od_max_setting = overdrive_upperlimits->FanMode; +break ;default : od_min_setting = od_max_setting =INT_MAX ;break ;
@@ -1300,6 +1305,16 @@ static int smu_v13_0_0_print_clk_levels(struct smu_context *smu, od_table->OverDriveTable.VoltageOffsetPerZoneBoundary[i]);break ; +case SMU_OD_FAN_MODE : +if (!smu_v13_0_0_is_od_feature_supported (smu, +PP_OD_FEATURE_FAN_CURVE_BIT )) +break ; + + size +=sysfs_emit_at (buf, size,"OD_FAN_MODE:\n" ); + size +=sysfs_emit_at (buf, size,"%d\n" , + (int )od_table->OverDriveTable.FanMode); +break ; +case SMU_OD_RANGE : if (!smu_v13_0_0_is_od_feature_supported(smu, PP_OD_FEATURE_GFXCLK_BIT) && !smu_v13_0_0_is_od_feature_supported(smu, PP_OD_FEATURE_UCLK_BIT) &&
@@ -1760,6 +1775,15 @@ static ssize_t smu_v13_0_0_get_gpu_metrics(struct smu_context *smu,return sizeof (struct gpu_metrics_v1_3 ); } +static void smu_v13_0_0_set_supported_od_feature_mask (struct smu_context *smu) +{ +struct amdgpu_device *adev = smu->adev; + +if (smu_v13_0_0_is_od_feature_supported (smu, +PP_OD_FEATURE_FAN_CURVE_BIT )) + adev->pm.od_feature_mask |=OD_OPS_SUPPORT_FAN_MODE_RETRIEVE ; +} +static int smu_v13_0_0_set_default_od_settings (struct smu_context *smu) { OverDriveTableExternal_t *od_table =
@@ -1809,8 +1833,12 @@ static int smu_v13_0_0_set_default_od_settings(struct smu_context *smu)for (i =0 ; i <PP_NUM_OD_VF_CURVE_POINTS ; i++) user_od_table->OverDriveTable.VoltageOffsetPerZoneBoundary[i] = user_od_table_bak.OverDriveTable.VoltageOffsetPerZoneBoundary[i]; + user_od_table->OverDriveTable.FanMode = + user_od_table_bak.OverDriveTable.FanMode; } +smu_v13_0_0_set_supported_od_feature_mask (smu); +return 0 ; }
@@ -1821,9 +1849,10 @@ static int smu_v13_0_0_restore_user_od_settings(struct smu_context *smu)OverDriveTableExternal_t *user_od_table = table_context->user_overdrive_table;int res; - user_od_table->OverDriveTable.FeatureCtrlMask =1U <<PP_OD_FEATURE_GFXCLK_BIT | -1U <<PP_OD_FEATURE_UCLK_BIT | -1U <<PP_OD_FEATURE_GFX_VF_CURVE_BIT ; + user_od_table->OverDriveTable.FeatureCtrlMask =BIT (PP_OD_FEATURE_GFXCLK_BIT ) | +BIT (PP_OD_FEATURE_UCLK_BIT ) | +BIT (PP_OD_FEATURE_GFX_VF_CURVE_BIT ) | +BIT (PP_OD_FEATURE_FAN_CURVE_BIT ); res =smu_v13_0_0_upload_overdrive_table (smu, user_od_table); user_od_table->OverDriveTable.FeatureCtrlMask =0 ;if (res ==0 )
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +32 -3
@@ -77,6 +77,7 @@#define PP_OD_FEATURE_UCLK_FMIN 2#define PP_OD_FEATURE_UCLK_FMAX 3#define PP_OD_FEATURE_GFX_VF_CURVE 4 +#define PP_OD_FEATURE_FAN_MODE 5static struct cmn2asic_msg_mapping smu_v13_0_7_message_map[SMU_MSG_MAX_COUNT ] = {MSG_MAP (TestMessage, PPSMC_MSG_TestMessage,1 ),
@@ -1070,6 +1071,10 @@ static void smu_v13_0_7_get_od_setting_limits(struct smu_context *smu, od_min_setting = overdrive_lowerlimits->VoltageOffsetPerZoneBoundary; od_max_setting = overdrive_upperlimits->VoltageOffsetPerZoneBoundary;break ; +case PP_OD_FEATURE_FAN_MODE : + od_min_setting = overdrive_lowerlimits->FanMode; + od_max_setting = overdrive_upperlimits->FanMode; +break ;default : od_min_setting = od_max_setting =INT_MAX ;break ;
@@ -1287,6 +1292,16 @@ static int smu_v13_0_7_print_clk_levels(struct smu_context *smu, od_table->OverDriveTable.VoltageOffsetPerZoneBoundary[i]);break ; +case SMU_OD_FAN_MODE : +if (!smu_v13_0_7_is_od_feature_supported (smu, +PP_OD_FEATURE_FAN_CURVE_BIT )) +break ; + + size +=sysfs_emit_at (buf, size,"OD_FAN_MODE:\n" ); + size +=sysfs_emit_at (buf, size,"%d\n" , + (int )od_table->OverDriveTable.FanMode); +break ; +case SMU_OD_RANGE : if (!smu_v13_0_7_is_od_feature_supported(smu, PP_OD_FEATURE_GFXCLK_BIT) && !smu_v13_0_7_is_od_feature_supported(smu, PP_OD_FEATURE_UCLK_BIT) &&
@@ -1742,6 +1757,15 @@ static ssize_t smu_v13_0_7_get_gpu_metrics(struct smu_context *smu,return sizeof (struct gpu_metrics_v1_3 ); } +static void smu_v13_0_7_set_supported_od_feature_mask (struct smu_context *smu) +{ +struct amdgpu_device *adev = smu->adev; + +if (smu_v13_0_7_is_od_feature_supported (smu, +PP_OD_FEATURE_FAN_CURVE_BIT )) + adev->pm.od_feature_mask |=OD_OPS_SUPPORT_FAN_MODE_RETRIEVE ; +} +static int smu_v13_0_7_set_default_od_settings (struct smu_context *smu) { OverDriveTableExternal_t *od_table =
@@ -1791,8 +1815,12 @@ static int smu_v13_0_7_set_default_od_settings(struct smu_context *smu)for (i =0 ; i <PP_NUM_OD_VF_CURVE_POINTS ; i++) user_od_table->OverDriveTable.VoltageOffsetPerZoneBoundary[i] = user_od_table_bak.OverDriveTable.VoltageOffsetPerZoneBoundary[i]; + user_od_table->OverDriveTable.FanMode = + user_od_table_bak.OverDriveTable.FanMode; } +smu_v13_0_7_set_supported_od_feature_mask (smu); +return 0 ; }
@@ -1803,9 +1831,10 @@ static int smu_v13_0_7_restore_user_od_settings(struct smu_context *smu)OverDriveTableExternal_t *user_od_table = table_context->user_overdrive_table;int res; - user_od_table->OverDriveTable.FeatureCtrlMask =1U <<PP_OD_FEATURE_GFXCLK_BIT | -1U <<PP_OD_FEATURE_UCLK_BIT | -1U <<PP_OD_FEATURE_GFX_VF_CURVE_BIT ; + user_od_table->OverDriveTable.FeatureCtrlMask =BIT (PP_OD_FEATURE_GFXCLK_BIT ) | +BIT (PP_OD_FEATURE_UCLK_BIT ) | +BIT (PP_OD_FEATURE_GFX_VF_CURVE_BIT ) | +BIT (PP_OD_FEATURE_FAN_CURVE_BIT ); res =smu_v13_0_7_upload_overdrive_table (smu, user_od_table); user_od_table->OverDriveTable.FeatureCtrlMask =0 ;if (res ==0 )
Signature · 1 line
2.34.1
PATCH 4/8 drm/amd/pm: add fan temperature/pwm curve OD setting support for SMU13
In reply to Evan QuanAdd SMU13 fan temperature/pwm curve OD setting support.
--- .../gpu/drm/amd/include/kgd_pp_interface.h | 2 + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 45 ++++++++++ drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 2 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 1 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 87 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 87 ++++++++++++++++++- 7 files changed, 224 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
@@ -114,6 +114,7 @@ enum pp_clock_type {OD_VDDGFX_OFFSET ,OD_CCLK ,OD_FAN_MODE , + OD_FAN_CURVE, }; enum amd_pp_sensors {
@@ -188,6 +189,7 @@ enum PP_OD_DPM_TABLE_COMMAND {PP_OD_COMMIT_DPM_TABLE ,PP_OD_EDIT_VDDGFX_OFFSET ,PP_OD_EDIT_FAN_MODE , + PP_OD_EDIT_FAN_CURVE, }; struct pp_states_info {
drivers/gpu/drm/amd/pm/amdgpu_pm.c +45 -0
57 lines not on this page · raw message
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +2 -0
@@ -316,6 +316,8 @@ struct config_table_setting#define OD_OPS_SUPPORT_FAN_MODE_RETRIEVE BIT(0)#define OD_OPS_SUPPORT_FAN_MODE_SET BIT(1) +#define OD_OPS_SUPPORT_FAN_CURVE_RETRIEVE BIT(2) +#define OD_OPS_SUPPORT_FAN_CURVE_SET BIT(3)struct amdgpu_pm {struct mutex mutex;
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -0
@@ -2483,6 +2483,8 @@ static enum smu_clk_type smu_convert_to_smuclk(enum pp_clock_type type) clk_type =SMU_OD_CCLK ;break ;case OD_FAN_MODE : clk_type =SMU_OD_FAN_MODE ;break ; +case OD_FAN_CURVE : + clk_type =SMU_OD_FAN_CURVE ;break ;default : clk_type =SMU_CLK_COUNT ;break ; }
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +1 -0
@@ -279,6 +279,7 @@ enum smu_clk_type {SMU_OD_RANGE ,SMU_OD_VDDGFX_OFFSET ,SMU_OD_FAN_MODE , +SMU_OD_FAN_CURVE , SMU_CLK_COUNT, };
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +86 -1
123 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +86 -1
123 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 5/8 drm/amd/pm: add fan acoustic limit OD setting support for SMU13
In reply to Evan QuanAdd SMU13 fan acoustic limit OD setting support.
--- .../gpu/drm/amd/include/kgd_pp_interface.h | 2 + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 45 ++++++++++++++++ drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 2 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 1 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 51 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 51 ++++++++++++++++++- 7 files changed, 152 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
@@ -115,6 +115,7 @@ enum pp_clock_type {OD_CCLK ,OD_FAN_MODE ,OD_FAN_CURVE , + OD_ACOUSTIC_LIMIT, }; enum amd_pp_sensors {
@@ -190,6 +191,7 @@ enum PP_OD_DPM_TABLE_COMMAND {PP_OD_EDIT_VDDGFX_OFFSET ,PP_OD_EDIT_FAN_MODE ,PP_OD_EDIT_FAN_CURVE , + PP_OD_EDIT_ACOUSTIC_LIMIT, }; struct pp_states_info {
drivers/gpu/drm/amd/pm/amdgpu_pm.c +45 -0
57 lines not on this page · raw message
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +2 -0
@@ -318,6 +318,8 @@ struct config_table_setting#define OD_OPS_SUPPORT_FAN_MODE_SET BIT(1)#define OD_OPS_SUPPORT_FAN_CURVE_RETRIEVE BIT(2)#define OD_OPS_SUPPORT_FAN_CURVE_SET BIT(3) +#define OD_OPS_SUPPORT_ACOUSTIC_LIMIT_THRESHOLD_RETRIEVE BIT(4) +#define OD_OPS_SUPPORT_ACOUSTIC_LIMIT_THRESHOLD_SET BIT(5)struct amdgpu_pm {struct mutex mutex;
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -0
@@ -2485,6 +2485,8 @@ static enum smu_clk_type smu_convert_to_smuclk(enum pp_clock_type type) clk_type =SMU_OD_FAN_MODE ;break ;case OD_FAN_CURVE : clk_type =SMU_OD_FAN_CURVE ;break ; +case OD_ACOUSTIC_LIMIT : + clk_type =SMU_OD_ACOUSTIC_LIMIT ;break ;default : clk_type =SMU_CLK_COUNT ;break ; }
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +1 -0
@@ -280,6 +280,7 @@ enum smu_clk_type {SMU_OD_VDDGFX_OFFSET ,SMU_OD_FAN_MODE ,SMU_OD_FAN_CURVE , +SMU_OD_ACOUSTIC_LIMIT , SMU_CLK_COUNT, };
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +50 -1
87 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +50 -1
87 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 6/8 drm/amd/pm: add fan acoustic target OD setting support for SMU13
In reply to Evan QuanAdd SMU13 fan acoustic target OD setting support.
--- .../gpu/drm/amd/include/kgd_pp_interface.h | 2 + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 45 ++++++++++++++++ drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 2 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 1 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 51 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 51 ++++++++++++++++++- 7 files changed, 152 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
@@ -116,6 +116,7 @@ enum pp_clock_type {OD_FAN_MODE ,OD_FAN_CURVE ,OD_ACOUSTIC_LIMIT , + OD_ACOUSTIC_TARGET, }; enum amd_pp_sensors {
@@ -192,6 +193,7 @@ enum PP_OD_DPM_TABLE_COMMAND {PP_OD_EDIT_FAN_MODE ,PP_OD_EDIT_FAN_CURVE ,PP_OD_EDIT_ACOUSTIC_LIMIT , + PP_OD_EDIT_ACOUSTIC_TARGET, }; struct pp_states_info {
drivers/gpu/drm/amd/pm/amdgpu_pm.c +45 -0
57 lines not on this page · raw message
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +2 -0
@@ -320,6 +320,8 @@ struct config_table_setting#define OD_OPS_SUPPORT_FAN_CURVE_SET BIT(3)#define OD_OPS_SUPPORT_ACOUSTIC_LIMIT_THRESHOLD_RETRIEVE BIT(4)#define OD_OPS_SUPPORT_ACOUSTIC_LIMIT_THRESHOLD_SET BIT(5) +#define OD_OPS_SUPPORT_ACOUSTIC_TARGET_THRESHOLD_RETRIEVE BIT(6) +#define OD_OPS_SUPPORT_ACOUSTIC_TARGET_THRESHOLD_SET BIT(7)struct amdgpu_pm {struct mutex mutex;
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -0
@@ -2487,6 +2487,8 @@ static enum smu_clk_type smu_convert_to_smuclk(enum pp_clock_type type) clk_type =SMU_OD_FAN_CURVE ;break ;case OD_ACOUSTIC_LIMIT : clk_type =SMU_OD_ACOUSTIC_LIMIT ;break ; +case OD_ACOUSTIC_TARGET : + clk_type =SMU_OD_ACOUSTIC_TARGET ;break ;default : clk_type =SMU_CLK_COUNT ;break ; }
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +1 -0
@@ -281,6 +281,7 @@ enum smu_clk_type {SMU_OD_FAN_MODE ,SMU_OD_FAN_CURVE ,SMU_OD_ACOUSTIC_LIMIT , +SMU_OD_ACOUSTIC_TARGET , SMU_CLK_COUNT, };
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +50 -1
87 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +50 -1
87 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 7/8 drm/amd/pm: add fan target temperature OD setting support for SMU13
In reply to Evan QuanAdd SMU13 fan target temperature OD setting support.
--- .../gpu/drm/amd/include/kgd_pp_interface.h | 2 + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 45 ++++++++++++++++ drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 2 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 1 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 51 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 51 ++++++++++++++++++- 7 files changed, 152 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
@@ -117,6 +117,7 @@ enum pp_clock_type {OD_FAN_CURVE ,OD_ACOUSTIC_LIMIT ,OD_ACOUSTIC_TARGET , + OD_FAN_TARGET_TEMPERATURE, }; enum amd_pp_sensors {
@@ -194,6 +195,7 @@ enum PP_OD_DPM_TABLE_COMMAND {PP_OD_EDIT_FAN_CURVE ,PP_OD_EDIT_ACOUSTIC_LIMIT ,PP_OD_EDIT_ACOUSTIC_TARGET , + PP_OD_EDIT_FAN_TARGET_TEMPERATURE, }; struct pp_states_info {
drivers/gpu/drm/amd/pm/amdgpu_pm.c +45 -0
57 lines not on this page · raw message
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +2 -0
@@ -322,6 +322,8 @@ struct config_table_setting#define OD_OPS_SUPPORT_ACOUSTIC_LIMIT_THRESHOLD_SET BIT(5)#define OD_OPS_SUPPORT_ACOUSTIC_TARGET_THRESHOLD_RETRIEVE BIT(6)#define OD_OPS_SUPPORT_ACOUSTIC_TARGET_THRESHOLD_SET BIT(7) +#define OD_OPS_SUPPORT_FAN_TARGET_TEMPERATURE_RETRIEVE BIT(8) +#define OD_OPS_SUPPORT_FAN_TARGET_TEMPERATURE_SET BIT(9)struct amdgpu_pm {struct mutex mutex;
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -0
@@ -2489,6 +2489,8 @@ static enum smu_clk_type smu_convert_to_smuclk(enum pp_clock_type type) clk_type =SMU_OD_ACOUSTIC_LIMIT ;break ;case OD_ACOUSTIC_TARGET : clk_type =SMU_OD_ACOUSTIC_TARGET ;break ; +case OD_FAN_TARGET_TEMPERATURE : + clk_type =SMU_OD_FAN_TARGET_TEMPERATURE ;break ;default : clk_type =SMU_CLK_COUNT ;break ; }
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +1 -0
@@ -282,6 +282,7 @@ enum smu_clk_type {SMU_OD_FAN_CURVE ,SMU_OD_ACOUSTIC_LIMIT ,SMU_OD_ACOUSTIC_TARGET , +SMU_OD_FAN_TARGET_TEMPERATURE , SMU_CLK_COUNT, };
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +50 -1
87 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +50 -1
87 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 8/8 drm/amd/pm: add fan minimum pwm OD setting support for SMU13
In reply to Evan QuanAdd SMU13 fan minimum pwm OD setting support.
--- .../gpu/drm/amd/include/kgd_pp_interface.h | 2 + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 45 ++++++++++++++++ drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 2 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 1 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 51 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 51 ++++++++++++++++++- 7 files changed, 152 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
@@ -118,6 +118,7 @@ enum pp_clock_type {OD_ACOUSTIC_LIMIT ,OD_ACOUSTIC_TARGET ,OD_FAN_TARGET_TEMPERATURE , + OD_FAN_MINIMUM_PWM, }; enum amd_pp_sensors {
@@ -196,6 +197,7 @@ enum PP_OD_DPM_TABLE_COMMAND {PP_OD_EDIT_ACOUSTIC_LIMIT ,PP_OD_EDIT_ACOUSTIC_TARGET ,PP_OD_EDIT_FAN_TARGET_TEMPERATURE , + PP_OD_EDIT_FAN_MINIMUM_PWM, }; struct pp_states_info {
drivers/gpu/drm/amd/pm/amdgpu_pm.c +45 -0
57 lines not on this page · raw message
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +2 -0
@@ -324,6 +324,8 @@ struct config_table_setting#define OD_OPS_SUPPORT_ACOUSTIC_TARGET_THRESHOLD_SET BIT(7)#define OD_OPS_SUPPORT_FAN_TARGET_TEMPERATURE_RETRIEVE BIT(8)#define OD_OPS_SUPPORT_FAN_TARGET_TEMPERATURE_SET BIT(9) +#define OD_OPS_SUPPORT_FAN_MINIMUM_PWM_RETRIEVE BIT(10) +#define OD_OPS_SUPPORT_FAN_MINIMUM_PWM_SET BIT(11)struct amdgpu_pm {struct mutex mutex;
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -0
@@ -2491,6 +2491,8 @@ static enum smu_clk_type smu_convert_to_smuclk(enum pp_clock_type type) clk_type =SMU_OD_ACOUSTIC_TARGET ;break ;case OD_FAN_TARGET_TEMPERATURE : clk_type =SMU_OD_FAN_TARGET_TEMPERATURE ;break ; +case OD_FAN_MINIMUM_PWM : + clk_type =SMU_OD_FAN_MINIMUM_PWM ;break ;default : clk_type =SMU_CLK_COUNT ;break ; }
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +1 -0
@@ -283,6 +283,7 @@ enum smu_clk_type {SMU_OD_ACOUSTIC_LIMIT ,SMU_OD_ACOUSTIC_TARGET ,SMU_OD_FAN_TARGET_TEMPERATURE , +SMU_OD_FAN_MINIMUM_PWM , SMU_CLK_COUNT, };
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +50 -1
87 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +50 -1
87 lines not on this page · raw message
Signature · 1 line
2.34.1
[AMD Official Use Only - General]
Ping..
Quoted 54 lines
-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Tuesday, August 15, 2023 4:42 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH 0/8] A new set of Linux OD interfacesThe existing OD interface
pp_od_clk_voltageis unable to meet the growing demands for more OD functionalities. Since the buf used within it comes with size limit as one page. With more OD functionalities added, we will hit that limit soon.To better meet the growing demainds, a new set of OD interfaces are designed. With this new design, there will be multiple interfaces exposed with each representing a single OD functionality. And all those interfaces will be arranged in a tree liked hierarchy as below. Meanwhile all functionalities for the same component will be arranged under the same directory.
gpu_od/
├── fan_ctrl ├── acoustic_limit_rpm_threshold ├── acoustic_target_rpm_threshold ├── fan_curve ├── fan_minimum_pwm ├── fan_mode ├── fan_target_temperature...
...(more to be added)Evan Quan (8):
drm/amd/pm: introduce a new set of OD interfaces drm/amdgpu: revise the device initialization sequences drm/amd/pm: add fan mode OD setting support for SMU13 drm/amd/pm: add fan temperature/pwm curve OD setting support for
SMU13
drm/amd/pm: add fan acoustic limit OD setting support for SMU13 drm/amd/pm: add fan acoustic target OD setting support for SMU13 drm/amd/pm: add fan target temperature OD setting support for SMU13 drm/amd/pm: add fan minimum pwm OD setting support for SMU13drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 39 +- .../gpu/drm/amd/include/kgd_pp_interface.h | 14 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 676 +++++++++++++++++- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 16 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 6 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 316 +++++++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 316 +++++++- 8 files changed, 1370 insertions(+), 25 deletions(-)--
2.34.1
Quoted 11 lines · Evan Quan
The existing OD interface
pp_od_clk_voltageis unable to meet the growing demands for more OD functionalities. Since the buf used within it comes with size limit as one page. With more OD functionalities added, we will hit that limit soon.To better meet the growing demainds, a new set of OD interfaces are designed. With this new design, there will be multiple interfaces exposed with each representing a single OD functionality. And all those interfaces will be arranged in a tree liked hierarchy as below. Meanwhile all functionalities for the same component will be arranged under the same directory.
Patches look good to me, but please add kerneldoc for this to amdgpu_pm.c and make sure it gets picked up in Documentation/gpu/amdgpu/thermal.rst.
Alex
Quoted 36 lines
gpu_od/
├── fan_ctrl ├── acoustic_limit_rpm_threshold ├── acoustic_target_rpm_threshold ├── fan_curve ├── fan_minimum_pwm ├── fan_mode ├── fan_target_temperature...
...(more to be added)Evan Quan (8):
drm/amd/pm: introduce a new set of OD interfaces drm/amdgpu: revise the device initialization sequences drm/amd/pm: add fan mode OD setting support for SMU13 drm/amd/pm: add fan temperature/pwm curve OD setting support for SMU13 drm/amd/pm: add fan acoustic limit OD setting support for SMU13 drm/amd/pm: add fan acoustic target OD setting support for SMU13 drm/amd/pm: add fan target temperature OD setting support for SMU13 drm/amd/pm: add fan minimum pwm OD setting support for SMU13drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 39 +- .../gpu/drm/amd/include/kgd_pp_interface.h | 14 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 676 +++++++++++++++++- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 16 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 6 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 316 +++++++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 316 +++++++- 8 files changed, 1370 insertions(+), 25 deletions(-)--
2.34.1