Add documentation power related sysfs interfaces
Subsystems (2)
cover Add documentation power related sysfs interfaces
Provide some initial documenation on how to use the power sysfs APIs.
Alex Deucher (6):
drm/amdgpu/pm: document power_dpm_force_performance_level drm/amdgpu/pm: document power_dpm_state drm/amdgpu/pm: document pp_table
drm/amdgpu/pm: document pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie drm/amdgpu/pm: document pp_power_profile_mode drm/amdgpu/pm: document pp_od_clk_voltage
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 156 +++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+)
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/6 drm/amdgpu/pm: document power_dpm_force_performance_level
In reply to a message not in the archiveProvide documentation for power_dpm_force_performance_level which is used to adjust things related to GPU power states.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +53 -0
@@ -131,6 +131,59 @@ static ssize_t amdgpu_set_dpm_state(struct device *dev,return count; } + +/** +* DOC: power_dpm_force_performance_level +* +* The amdgpu driver provides a sysfs API for adjusting certain power +* related parameters. The file power_dpm_force_performance_level is +* used for this. It accepts the following arguments: +* - auto +* - low +* - high +* - manual +* - GPU fan +* - profile_standard +* - profile_min_sclk +* - profile_min_mclk +* - profile_peak +* +* auto +* +* When auto is selected, the driver will attempt to dynamically select +* the optimal power profile for current conditions in the driver. +* +* low +* +* When low is selected, the clocks are forced to the lowest power state. +* +* high +* +* When high is selected, the clocks are forced to the highest power state. +* +* manual +* +* When manual is selected, the user can manually adjust which power states +* are enabled for each clock domain via the sysfs pp_dpm_mclk, pp_dpm_sclk, +* and pp_dpm_pcie files and adjust the power state transition heuristics +* via the pp_power_profile_mode sysfs file. +* +* profile_standard +* profile_min_sclk +* profile_min_mclk +* profile_peak +* +* When the profiling modes are selected, clock and power gating are +* disabled and the clocks are set for different profiling cases. This +* mode is recommended for profiling specific work loads where you do +* not want clock or power gating for clock fluctuation to interfere +* with your results. profile_standard sets the clocks to a fixed clock +* level which varies from asic to asic. profile_min_sclk forces the sclk +* to the lowest level. profile_min_mclk forces the mclk to the lowest level. +* profile_peak sets all clocks (mclk, sclk, pcie) to the highest levels. +* +*/ +static ssize_t amdgpu_get_dpm_forced_performance_level (struct device *dev,struct device_attribute *attr,char *buf)
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/6 drm/amdgpu/pm: document power_dpm_state
In reply to a message not in the archiveThis is a legacy file and is only provided for
backwards compatibility.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +31 -0
@@ -77,6 +77,37 @@ void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev) } } +/** +* DOC: power_dpm_state +* +* This is a legacy interface and is only provided for backwards compatibility. +* The amdgpu driver provides a sysfs API for adjusting certain power +* related parameters. The file power_dpm_state is used for this. +* It accepts the following arguments: +* - battery +* - balanced +* - performance +* +* battery +* +* On older GPUs, the vbios provided a special power state for battery +* operation. Selecting battery switched to this state. This is no +* longer provided on newer GPUs so the option does nothing in that case. +* +* balanced +* +* On older GPUs, the vbios provided a special power state for balanced +* operation. Selecting balanced switched to this state. This is no +* longer provided on newer GPUs so the option does nothing in that case. +* +* performance +* +* On older GPUs, the vbios provided a special power state for performance +* operation. Selecting performance switched to this state. This is no +* longer provided on newer GPUs so the option does nothing in that case. +* +*/ +static ssize_t amdgpu_get_dpm_state (struct device *dev,struct device_attribute *attr,char *buf)
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/6 drm/amdgpu/pm: document pp_table
In reply to a message not in the archiveThis file is for uploading new powerplay tables.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +11 -0
@@ -408,6 +408,17 @@ static ssize_t amdgpu_set_pp_force_state(struct device *dev,return count; } +/** +* DOC: pp_table +* +* The amdgpu driver provides a sysfs API for uploading new powerplay +* tables. The file pp_table is used for this. Reading the file +* will dump the current power play table. Writing to the file +* will attempt to upload a new powerplay table and re-initialize +* powerplay using that new table. +* +*/ +static ssize_t amdgpu_get_pp_table (struct device *dev,struct device_attribute *attr,char *buf)
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/6 drm/amdgpu/pm: document pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie
In reply to a message not in the archiveUsed for manually masking dpm states.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +18 -0
@@ -539,6 +539,24 @@ static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev, } +/** +* DOC: pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie +* +* The amdgpu driver provides a sysfs API for adjusting what power levels +* are enabled for a given power state. The files pp_dpm_sclk, pp_dpm_mclk, +* and pp_dpm_pcie are used for this. +* +* Reading back the files will show you the available power levels within +* the power state and the clock information for those levels. There +* will be a '*' next to the level that is currently active. +* +* To manually adjust these states, first select manual using +* power_dpm_force_performance_level. Writing a string of the level +* numbers to the file will select which levels you want to enable. +* E.g., writing 456 to the file will enable levels 4, 5, and 6. +* +*/ +static ssize_t amdgpu_get_pp_dpm_sclk (struct device *dev,struct device_attribute *attr,char *buf)
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/6 drm/amdgpu/pm: document pp_power_profile_mode
In reply to a message not in the archivesysfs file for adjusting power level heuristics.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +20 -0
@@ -781,6 +781,26 @@ static ssize_t amdgpu_set_pp_mclk_od(struct device *dev,return count; } +/** +* DOC: pp_power_profile_mode +* +* The amdgpu driver provides a sysfs API for adjusting the heuristics +* related to switching between power levels in a power state. The file +* pp_power_profile_mode is used for this. +* +* Reading this file outputs a list of all of the predefined power profiles +* and the relevant heuristics settings for that profile. +* +* To select a profile or create a custom profile, first select manual using +* power_dpm_force_performance_level. Writing the number of a predefined +* profile to pp_power_profile_mode will enable those heuristics. To +* create a custom set of heuristics, write a string of numbers to the file +* starting with the number of the custom profile along with a setting +* for each heuristic parameter. Due to differences across asic families +* the heuristic parameters vary from family to family. +* +*/ +static ssize_t amdgpu_get_pp_power_profile_mode (struct device *dev,struct device_attribute *attr,char *buf)
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/6 drm/amdgpu/pm: document pp_od_clk_voltage
In reply to a message not in the archivesysfs interface for fine grained clock and voltage control.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +23 -0
@@ -455,6 +455,29 @@ static ssize_t amdgpu_set_pp_table(struct device *dev,return count; } +/** +* DOC: pp_od_clk_voltage +* +* The amdgpu driver provides a sysfs API for adjusting the clocks and voltages +* in each power level within a power state. The pp_od_clk_voltage is used for +* this. +* +* Reading the file will display: +* - a list of engine clock levels and voltages labeled OD_SCLK +* - a list of memory clock levels and voltages labeled OD_MCLK +* - a list of valid ranges for sclk, mclk, and voltage labeled OD_RANGE +* +* To manually adjust these settings, first select manual using +* power_dpm_force_performance_level. Enter a new value for each +* level by writing a string that contains "s/m level clock voltage" to +* the file. E.g., "s 1 500 820" will update sclk level 1 to be 500 MHz +* at 820 mV; "m 0 350 810" will update mclk level 0 to be 350 MHz at +* 810 mV. When you have edited all of the states as needed, write +* "c" (commit) to the file to commit your changes. If you want to reset to the +* default power levels, write "r" (reset) to the file to reset them. +* +*/ + static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev, struct device_attribute *attr, const char *buf,
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Thanks. It's great to see this documented. I haven't confirmed that the information is 100% accurate. Acked-by: Felix Kuehling <[email protected]>
Quoted 11 lines · Alex Deucher
Provide some initial documenation on how to use the power sysfs APIs.
Alex Deucher (6):
drm/amdgpu/pm: documentpower_dpm_force_performance_leveldrm/amdgpu/pm: documentpower_dpm_statedrm/amdgpu/pm: documentpp_table
drm/amdgpu/pm: documentpp_dpm_sclkpp_dpm_mclkpp_dpm_pciedrm/amdgpu/pm: documentpp_power_profile_modedrm/amdgpu/pm: documentpp_od_clk_voltage
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 156 +++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 3 lines · Alex Deucher
Provide some initial documenation on how to use the power sysfs APIs.
Series are Reviewed-by: Huang Rui <[email protected]>
Quoted 8 lines
Alex Deucher (6):
drm/amdgpu/pm: documentpower_dpm_force_performance_leveldrm/amdgpu/pm: documentpower_dpm_statedrm/amdgpu/pm: documentpp_table
drm/amdgpu/pm: documentpp_dpm_sclkpp_dpm_mclkpp_dpm_pciedrm/amdgpu/pm: documentpp_power_profile_modedrm/amdgpu/pm: documentpp_od_clk_voltage
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 156 +++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+)Signature · 6 lines
2.13.6 _______________________________________________ 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
RE: [PATCH 4/6] drm/amdgpu/pm: document pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie
In reply to a message not in the archiveHi Alex,
Quoted 1 line
There will be a '*' next to the level that is currently active.
We need to add a level for deep sleep state.
Otherwise, On Vega/Rv, when gpu in deepsleep, we can't set "*" for the current level.
Best Regards
Rex
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Alex Deucher
Sent: Friday, April 20, 2018 4:05 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 4/6] drm/amdgpu/pm: document pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie
Used for manually masking dpm states.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +18 -0
@@ -539,6 +539,24 @@ static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev, } +/** +* DOC: pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie +* +* The amdgpu driver provides a sysfs API for adjusting what power levels +* are enabled for a given power state. The files pp_dpm_sclk, pp_dpm_mclk, +* and pp_dpm_pcie are used for this. +* +* Reading back the files will show you the available power levels within +* the power state and the clock information for those levels. There +* will be a '*' next to the level that is currently active. +* +* To manually adjust these states, first select manual using +* power_dpm_force_performance_level. Writing a string of the level +* numbers to the file will select which levels you want to enable. +* E.g., writing 456 to the file will enable levels 4, 5, and 6. +* +*/ +static ssize_t amdgpu_get_pp_dpm_sclk (struct device *dev,struct device_attribute *attr,char *buf)
Signature · 10 lines
2.13.6 _______________________________________________ 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
Re: [PATCH 4/6] drm/amdgpu/pm: document pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie
In reply to a message not in the archiveQuoted 6 lines · Rex
Hi Alex,
Quoted 1 line
There will be a '*' next to the level that is currently active.
We need to add a level for deep sleep state.
Otherwise, On Vega/Rv, when gpu in deepsleep, we can't set "*" for the current level.
I dropped that sentence for now. We can revisit it later. Thanks!
Alex
Quoted 51 lines
Best Regards
Rex-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Alex Deucher
Sent: Friday, April 20, 2018 4:05 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 4/6] drm/amdgpu/pm: documentpp_dpm_sclkpp_dpm_mclkpp_dpm_pcieUsed for manually masking dpm states.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +18
-1@@ -539,6 +539,24 @@ static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev, } +/** +* DOC: pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie +* +* The amdgpu driver provides a sysfs API for adjusting what power levels +* are enabled for a given power state. The files pp_dpm_sclk, pp_dpm_mclk, +* and pp_dpm_pcie are used for this. +* +* Reading back the files will show you the available power levels within +* the power state and the clock information for those levels. There +* will be a '*' next to the level that is currently active. +* +* To manually adjust these states, first select manual using +* power_dpm_force_performance_level. Writing a string of the level +* numbers to the file will select which levels you want to enable. +* E.g., writing 456 to the file will enable levels 4, 5, and 6. +* +*/ +static ssize_t amdgpu_get_pp_dpm_sclk (struct device *dev,struct device_attribute *attr,char *buf) --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