<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Calibri;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - AMD Internal Distribution Only]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I didn't have time to go through every patch in detail, but overall it looks good to me. The series is:</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Lazar, Lijo <Lijo.Lazar@amd.com><br>
<b>Sent:</b> Thursday, May 16, 2024 8:43 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Zhang, Hawking <Hawking.Zhang@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Kamal, Asad <Asad.Kamal@amd.com>; Ma, Le <Le.Ma@amd.com><br>
<b>Subject:</b> [PATCH v5 10/10] Documentation/amdgpu: Add PM policy documentation</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Add documentation about the newly added pm_policy node in sysfs.<br>
<br>
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com><br>
---<br>
<br>
v5: Update documentation to reflect pm_policy nodes and sub nodes for each<br>
policy type<br>
<br>
Documentation/gpu/amdgpu/thermal.rst | 6 ++++<br>
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 53 ++++++++++++++++++++++++++++<br>
2 files changed, 59 insertions(+)<br>
<br>
diff --git a/Documentation/gpu/amdgpu/thermal.rst b/Documentation/gpu/amdgpu/thermal.rst<br>
index 2f6166f81e6a..6d942b5c58f0 100644<br>
--- a/Documentation/gpu/amdgpu/thermal.rst<br>
+++ b/Documentation/gpu/amdgpu/thermal.rst<br>
@@ -49,6 +49,12 @@ pp_power_profile_mode<br>
.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c<br>
:doc: pp_power_profile_mode<br>
<br>
+pm_policy<br>
+---------------------<br>
+<br>
+.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c<br>
+ :doc: pm_policy<br>
+<br>
\*_busy_percent<br>
---------------<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c<br>
index 5ff7783dfc43..3e5ffb83f398 100644<br>
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c<br>
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c<br>
@@ -2220,6 +2220,59 @@ struct amdgpu_pm_policy_attr {<br>
enum pp_pm_policy id;<br>
};<br>
<br>
+/**<br>
+ * DOC: pm_policy<br>
+ *<br>
+ * Certain SOCs can support different power policies to optimize application<br>
+ * performance. However, this policy is provided only at SOC level and not at a<br>
+ * per-process level. This is useful especially when entire SOC is utilized for<br>
+ * dedicated workload.<br>
+ *<br>
+ * The amdgpu driver provides a sysfs API for selecting the policy. Presently,<br>
+ * only two types of policies are supported through this interface.<br>
+ *<br>
+ * Pstate Policy Selection - This is to select different Pstate profiles which<br>
+ * decides clock/throttling preferences.<br>
+ *<br>
+ * XGMI PLPD Policy Selection - When multiple devices are connected over XGMI,<br>
+ * this helps to select policy to be applied for per link power down.<br>
+ *<br>
+ * The list of available policies and policy levels vary between SOCs. They can<br>
+ * be viewed under pm_policy node directory. If SOC doesn't support any policy,<br>
+ * this node won't be available. The different policies supported will be<br>
+ * available as separate nodes under pm_policy.<br>
+ *<br>
+ * cat /sys/bus/pci/devices/.../pm_policy/<policy_type><br>
+ *<br>
+ * Reading the policy file shows the different levels supported. The level which<br>
+ * is applied presently is denoted by * (asterisk). E.g.,<br>
+ *<br>
+ * .. code-block:: console<br>
+ *<br>
+ * cat /sys/bus/pci/devices/.../pm_policy/soc_pstate<br>
+ * 0 : soc_pstate_default<br>
+ * 1 : soc_pstate_0<br>
+ * 2 : soc_pstate_1*<br>
+ * 3 : soc_pstate_2<br>
+ *<br>
+ * cat /sys/bus/pci/devices/.../pm_policy/xgmi_plpd<br>
+ * 0 : plpd_disallow<br>
+ * 1 : plpd_default<br>
+ * 2 : plpd_optimized*<br>
+ *<br>
+ * To apply a specific policy<br>
+ *<br>
+ * "echo <level> > /sys/bus/pci/devices/.../pm_policy/<policy_type>"<br>
+ *<br>
+ * For the levels listed in the example above, to select "plpd_optimized" for<br>
+ * XGMI and "soc_pstate_2" for soc pstate policy -<br>
+ *<br>
+ * .. code-block:: console<br>
+ *<br>
+ * echo "2" > /sys/bus/pci/devices/.../pm_policy/xgmi_plpd<br>
+ * echo "3" > /sys/bus/pci/devices/.../pm_policy/soc_pstate<br>
+ *<br>
+ */<br>
static ssize_t amdgpu_get_pm_policy_attr(struct device *dev,<br>
struct device_attribute *attr,<br>
char *buf)<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>