drm/amd/pp: Expose set/get_power_limit for DGPU
Subsystems (2)
PATCH 1/2 drm/amd/pp: Expose set/get_power_limit for DGPU
User can change power limit between
[0, 1] * max power limit.
Set power limit to 0, restore to max power limit.
--- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 2 + drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 61 ++++++++++++++++++++++ drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 1 + .../gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c | 4 +- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 1 + .../gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 7 +-- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 3 ++ 7 files changed, 74 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
@@ -283,6 +283,8 @@ struct amd_pm_funcs {uint32_t mc_addr_low, uint32_t mc_addr_hi, uint32_t size); +int (*set_power_limit)(void *handle,uint32_t n); +int (*get_power_limit)(void *handle,uint32_t *limit,bool default_limit);/* export to DC */ u32 (*get_sclk)(void *handle,bool low);u32 (*get_mclk)(void *handle,bool low);
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +61 -0
73 lines not on this page · raw message
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +1 -0
@@ -5140,6 +5140,7 @@ static int smu7_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, uint .odn_edit_dpm_table = smu7_odn_edit_dpm_table, .get_power_profile_mode = smu7_get_power_profile_mode, .set_power_profile_mode = smu7_set_power_profile_mode, + .set_power_limit = smu7_set_power_limit, }; uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock,
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c +2 -2
@@ -903,12 +903,12 @@ int smu7_enable_power_containment(struct pp_hwmgr *hwmgr)PP_ASSERT_WITH_CODE ((0 == smc_result), "Failed to enable PkgPwrTracking in SMC.", result = -1;);if (0 == smc_result) { -uint32_t default_limit = + hwmgr->default_power_limit = hwmgr->power_limit = (uint32_t )(cac_table->usMaximumPowerDeliveryLimit *256 ); data->power_containment_features |= POWERCONTAINMENT_FEATURE_PkgPwrLimit; -if (smu7_set_power_limit (hwmgr, default_limit)) +if (smu7_set_power_limit (hwmgr, hwmgr->power_limit))pr_err ("Failed to set Default Power Limit in SMC!" ); } }
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -0
@@ -5152,6 +5152,7 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui .start_thermal_controller = vega10_start_thermal_controller, .get_power_profile_mode = vega10_get_power_profile_mode, .set_power_profile_mode = vega10_set_power_profile_mode, + .set_power_limit = vega10_set_power_limit, };int vega10_hwmgr_init (struct pp_hwmgr *hwmgr)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c +4 -3
@@ -1357,10 +1357,11 @@ int vega10_enable_power_containment(struct pp_hwmgr *hwmgr)struct phm_ppt_v2_information *table_info = (struct phm_ppt_v2_information *)(hwmgr->pptable);struct phm_tdp_table *tdp_table = table_info->tdp_table; -uint32_t default_pwr_limit = - (uint32_t )(tdp_table->usMaximumPowerDeliveryLimit);int result =0 ; + hwmgr->default_power_limit = hwmgr->power_limit = + (uint32_t )(tdp_table->usMaximumPowerDeliveryLimit); + if (PP_CAP(PHM_PlatformCaps_PowerContainment)) { if (data->smu_features[GNLD_PPT].supported) PP_ASSERT_WITH_CODE(!vega10_enable_smc_features(hwmgr,
@@ -1374,7 +1375,7 @@ int vega10_enable_power_containment(struct pp_hwmgr *hwmgr)"Attempt to enable PPT feature Failed!" , data->smu_features[GNLD_TDC].supported = false); - result =vega10_set_power_limit (hwmgr, default_pwr_limit); + result =vega10_set_power_limit (hwmgr, hwmgr->power_limit);PP_ASSERT_WITH_CODE (!result,"Failed to set Default Power Limit in SMC!" , return result);
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +3 -0
@@ -348,6 +348,7 @@ struct pp_hwmgr_func {int (*odn_edit_dpm_table)(struct pp_hwmgr *hwmgr,enum PP_OD_DPM_TABLE_COMMAND type,long *input,uint32_t size); +int (*set_power_limit)(struct pp_hwmgr *hwmgr,uint32_t n); };struct pp_table_func {
@@ -760,6 +761,8 @@ struct pp_hwmgr {uint32_t pstate_sclk;uint32_t pstate_mclk;bool od_enabled; +uint32_t power_limit; +uint32_t default_power_limit; };struct cgs_irq_src_funcs {
Signature · 6 lines
1.9.1 _______________________________________________ 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): 1517220887-28406-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu/pm: get/set dgpu power cap via hwmon API
Adust power limit through power1_cap
Get min/max power limit through power1_cap_min/power1_cap_max
Change-Id: Idca81ae12dc9fa4e4dd6c89fe47e0318df2859d3
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +75 -0
@@ -1207,6 +1207,69 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev,return snprintf (buf,PAGE_SIZE ,"%u\n" , uw); } +static ssize_t amdgpu_hwmon_show_power_cap_min (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +return sprintf (buf,"%i\n" ,0 ); +} + +static ssize_t amdgpu_hwmon_show_power_cap_max (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct amdgpu_device *adev =dev_get_drvdata (dev); +uint32_t limit =0 ; + +if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->get_power_limit) { + adev->powerplay.pp_funcs->get_power_limit (adev->powerplay.pp_handle, &limit, true); +return snprintf (buf,PAGE_SIZE ,"%d w\n" , limit /256 ); + }else { +return snprintf (buf,PAGE_SIZE ,"\n" ); + } +} + +static ssize_t amdgpu_hwmon_show_power_cap (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct amdgpu_device *adev =dev_get_drvdata (dev); +uint32_t limit =0 ; + +if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->get_power_limit) { + adev->powerplay.pp_funcs->get_power_limit (adev->powerplay.pp_handle, &limit, false); +return snprintf (buf,PAGE_SIZE ,"%d w\n" , limit /256 ); + }else { +return snprintf (buf,PAGE_SIZE ,"\n" ); + } +} + + +static ssize_t amdgpu_hwmon_set_power_cap (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t count) +{ +struct amdgpu_device *adev =dev_get_drvdata (dev); +int err; +u32 value; + + err =kstrtou32 (buf,10 , &value); +if (err) +return err; + + value = value *256 ; +if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->set_power_limit) { + err = adev->powerplay.pp_funcs->set_power_limit (adev->powerplay.pp_handle, value); +if (err) +return err; + }else { +return -EINVAL ; + } + +return count; +} + static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, amdgpu_hwmon_show_temp, NULL, 0); static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, amdgpu_hwmon_show_temp_thresh, NULL, 0); static SENSOR_DEVICE_ATTR(temp1_crit_hyst, S_IRUGO, amdgpu_hwmon_show_temp_thresh, NULL, 1);
@@ -1220,6 +1283,9 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, amdgpu_hwmon_show_vddnb, NULL, 0); static SENSOR_DEVICE_ATTR(in1_label, S_IRUGO, amdgpu_hwmon_show_vddnb_label, NULL, 0); static SENSOR_DEVICE_ATTR(power1_average, S_IRUGO, amdgpu_hwmon_show_power_avg, NULL, 0); +static SENSOR_DEVICE_ATTR(power1_cap_max, S_IRUGO, amdgpu_hwmon_show_power_cap_max, NULL, 0); +static SENSOR_DEVICE_ATTR(power1_cap_min, S_IRUGO, amdgpu_hwmon_show_power_cap_min, NULL, 0); +static SENSOR_DEVICE_ATTR(power1_cap, S_IRUGO | S_IWUSR, amdgpu_hwmon_show_power_cap, amdgpu_hwmon_set_power_cap, 0);static struct attribute *hwmon_attributes[] = { &sensor_dev_attr_temp1_input.dev_attr.attr,
@@ -1235,6 +1301,9 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, &sensor_dev_attr_in1_input.dev_attr.attr, &sensor_dev_attr_in1_label.dev_attr.attr, &sensor_dev_attr_power1_average.dev_attr.attr, + &sensor_dev_attr_power1_cap_max.dev_attr.attr, + &sensor_dev_attr_power1_cap_min.dev_attr.attr, + &sensor_dev_attr_power1_cap.dev_attr.attr, NULL };
@@ -1282,6 +1351,12 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr)) /* can't manage state */ effective_mode &= ~S_IWUSR ; +if ((adev->flags &AMD_IS_APU ) && + (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr || + attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr|| + attr == &sensor_dev_attr_power1_cap.dev_attr.attr)) +return 0 ; +/* hide max/min values if we can't both query and manage the fan */ if ((!adev->powerplay.pp_funcs->set_fan_speed_percent && !adev->powerplay.pp_funcs->get_fan_speed_percent) &&
Signature · 6 lines
1.9.1 _______________________________________________ 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): 1517220887-28406-2-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu/pm: get/set dgpu power cap via hwmon API
Quoted 25 lines · Rex Zhu
Adust power limit through
power1_cap
Get min/max power limit through power1_cap_min/power1_cap_maxSigned-off-by Rex Zhu <[email protected]>Change-Id: Idca81ae12dc9fa4e4dd6c89fe47e0318df2859d3
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +7
-0@@ -1207,6 +1207,69 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev,return snprintf (buf,PAGE_SIZE ,"%u\n" , uw); } +static ssize_t amdgpu_hwmon_show_power_cap_min (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +return sprintf (buf,"%i\n" ,0 ); +} +
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, · line 1226
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +10
-0+static ssize_t amdgpu_hwmon_show_power_cap_max (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct amdgpu_device *adev =dev_get_drvdata (dev); +uint32_t limit =0 ; + +if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->get_power_limit) { + adev->powerplay.pp_funcs->get_power_limit (adev->powerplay.pp_handle, &limit, true); +return snprintf (buf,PAGE_SIZE ,"%d w\n" , limit /256 );
Isn't the power limit only multiplied by 256 on smu7? Please normalize the internal interface. Also the hwmon API takes the uses microWatt units, please expose those and convert to normalized internal units as necessary.
https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
Quoted 25 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +25
-0+ }else { +return snprintf (buf,PAGE_SIZE ,"\n" ); + } +} + +static ssize_t amdgpu_hwmon_show_power_cap (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct amdgpu_device *adev =dev_get_drvdata (dev); +uint32_t limit =0 ; + +if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->get_power_limit) { + adev->powerplay.pp_funcs->get_power_limit (adev->powerplay.pp_handle, &limit, false); +return snprintf (buf,PAGE_SIZE ,"%d w\n" , limit /256 ); + }else { +return snprintf (buf,PAGE_SIZE ,"\n" ); + } +} + + +static ssize_t amdgpu_hwmon_set_power_cap (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t count)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, · line 1261
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +10
-0+{ +struct amdgpu_device *adev =dev_get_drvdata (dev); +int err; +u32 value; + + err =kstrtou32 (buf,10 , &value); +if (err) +return err; + + value = value *256 ;
Same comment here.
Alex
Quoted 50 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +23
-1+if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->set_power_limit) { + err = adev->powerplay.pp_funcs->set_power_limit (adev->powerplay.pp_handle, value); +if (err) +return err; + }else { +return -EINVAL ; + } + +return count; +} + static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, amdgpu_hwmon_show_temp, NULL, 0); static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, amdgpu_hwmon_show_temp_thresh, NULL, 0); static SENSOR_DEVICE_ATTR(temp1_crit_hyst, S_IRUGO, amdgpu_hwmon_show_temp_thresh, NULL, 1);@@ -1220,6 +1283,9 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, amdgpu_hwmon_show_vddnb, NULL, 0); static SENSOR_DEVICE_ATTR(in1_label, S_IRUGO, amdgpu_hwmon_show_vddnb_label, NULL, 0); static SENSOR_DEVICE_ATTR(power1_average, S_IRUGO, amdgpu_hwmon_show_power_avg, NULL, 0); +static SENSOR_DEVICE_ATTR(power1_cap_max, S_IRUGO, amdgpu_hwmon_show_power_cap_max, NULL, 0); +static SENSOR_DEVICE_ATTR(power1_cap_min, S_IRUGO, amdgpu_hwmon_show_power_cap_min, NULL, 0); +static SENSOR_DEVICE_ATTR(power1_cap, S_IRUGO | S_IWUSR, amdgpu_hwmon_show_power_cap, amdgpu_hwmon_set_power_cap, 0);static struct attribute *hwmon_attributes[] = { &sensor_dev_attr_temp1_input.dev_attr.attr,@@ -1235,6 +1301,9 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, &sensor_dev_attr_in1_input.dev_attr.attr, &sensor_dev_attr_in1_label.dev_attr.attr, &sensor_dev_attr_power1_average.dev_attr.attr, + &sensor_dev_attr_power1_cap_max.dev_attr.attr, + &sensor_dev_attr_power1_cap_min.dev_attr.attr, + &sensor_dev_attr_power1_cap.dev_attr.attr, NULL };@@ -1282,6 +1351,12 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr)) /* can't manage state */ effective_mode &= ~S_IWUSR ; +if ((adev->flags &AMD_IS_APU ) && + (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr || + attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr|| + attr == &sensor_dev_attr_power1_cap.dev_attr.attr)) +return 0 ; +/* hide max/min values if we can't both query and manage the fan */ if ((!adev->powerplay.pp_funcs->set_fan_speed_percent && !adev->powerplay.pp_funcs->get_fan_speed_percent) && --1.9.1
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
A message that is not in the archive (sent off-list or not yet received): CADnq5_OD4S_HFzeQ0MHvoz_hms23YA_mT+H_0y8qjY53z5BWCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu/pm: get/set dgpu power cap via hwmon API
Quoted 1 line
Isn't the power limit only multiplied by 256 on smu7?
Yes,I will fix it and convert the output to mw.
Best Regards
Rex
________________________________
From: Alex Deucher <[email protected]>
Sent: Tuesday, January 30, 2018 4:00 AM
To: Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 2/2] drm/amdgpu/pm: get/set dgpu power cap via hwmon API
Quoted 25 lines · Rex Zhu
Adust power limit through
power1_cap
Get min/max power limit through power1_cap_min/power1_cap_maxSigned-off-by Rex Zhu <[email protected]>Change-Id: Idca81ae12dc9fa4e4dd6c89fe47e0318df2859d3
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +7
-0@@ -1207,6 +1207,69 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev,return snprintf (buf,PAGE_SIZE ,"%u\n" , uw); } +static ssize_t amdgpu_hwmon_show_power_cap_min (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +return sprintf (buf,"%i\n" ,0 ); +} +
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, · line 1226
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +10
-0+static ssize_t amdgpu_hwmon_show_power_cap_max (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct amdgpu_device *adev =dev_get_drvdata (dev); +uint32_t limit =0 ; + +if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->get_power_limit) { + adev->powerplay.pp_funcs->get_power_limit (adev->powerplay.pp_handle, &limit, true); +return snprintf (buf,PAGE_SIZE ,"%d w\n" , limit /256 );
Isn't the power limit only multiplied by 256 on smu7? Please normalize the internal interface. Also the hwmon API takes the uses microWatt units, please expose those and convert to normalized internal units as necessary.
https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
Quoted 25 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +25
-0+ }else { +return snprintf (buf,PAGE_SIZE ,"\n" ); + } +} + +static ssize_t amdgpu_hwmon_show_power_cap (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct amdgpu_device *adev =dev_get_drvdata (dev); +uint32_t limit =0 ; + +if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->get_power_limit) { + adev->powerplay.pp_funcs->get_power_limit (adev->powerplay.pp_handle, &limit, false); +return snprintf (buf,PAGE_SIZE ,"%d w\n" , limit /256 ); + }else { +return snprintf (buf,PAGE_SIZE ,"\n" ); + } +} + + +static ssize_t amdgpu_hwmon_set_power_cap (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t count)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, · line 1261
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +10
-0+{ +struct amdgpu_device *adev =dev_get_drvdata (dev); +int err; +u32 value; + + err =kstrtou32 (buf,10 , &value); +if (err) +return err; + + value = value *256 ;
Same comment here.
Alex
Quoted 50 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +23
-1+if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->set_power_limit) { + err = adev->powerplay.pp_funcs->set_power_limit (adev->powerplay.pp_handle, value); +if (err) +return err; + }else { +return -EINVAL ; + } + +return count; +} + static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, amdgpu_hwmon_show_temp, NULL, 0); static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, amdgpu_hwmon_show_temp_thresh, NULL, 0); static SENSOR_DEVICE_ATTR(temp1_crit_hyst, S_IRUGO, amdgpu_hwmon_show_temp_thresh, NULL, 1);@@ -1220,6 +1283,9 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, amdgpu_hwmon_show_vddnb, NULL, 0); static SENSOR_DEVICE_ATTR(in1_label, S_IRUGO, amdgpu_hwmon_show_vddnb_label, NULL, 0); static SENSOR_DEVICE_ATTR(power1_average, S_IRUGO, amdgpu_hwmon_show_power_avg, NULL, 0); +static SENSOR_DEVICE_ATTR(power1_cap_max, S_IRUGO, amdgpu_hwmon_show_power_cap_max, NULL, 0); +static SENSOR_DEVICE_ATTR(power1_cap_min, S_IRUGO, amdgpu_hwmon_show_power_cap_min, NULL, 0); +static SENSOR_DEVICE_ATTR(power1_cap, S_IRUGO | S_IWUSR, amdgpu_hwmon_show_power_cap, amdgpu_hwmon_set_power_cap, 0);static struct attribute *hwmon_attributes[] = { &sensor_dev_attr_temp1_input.dev_attr.attr,@@ -1235,6 +1301,9 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device *dev, &sensor_dev_attr_in1_input.dev_attr.attr, &sensor_dev_attr_in1_label.dev_attr.attr, &sensor_dev_attr_power1_average.dev_attr.attr, + &sensor_dev_attr_power1_cap_max.dev_attr.attr, + &sensor_dev_attr_power1_cap_min.dev_attr.attr, + &sensor_dev_attr_power1_cap.dev_attr.attr, NULL };@@ -1282,6 +1351,12 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr)) /* can't manage state */ effective_mode &= ~S_IWUSR ; +if ((adev->flags &AMD_IS_APU ) && + (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr || + attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr|| + attr == &sensor_dev_attr_power1_cap.dev_attr.attr)) +return 0 ; +/* hide max/min values if we can't both query and manage the fan */ if ((!adev->powerplay.pp_funcs->set_fan_speed_percent && !adev->powerplay.pp_funcs->get_fan_speed_percent) && --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of ...
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx