<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div dir="ltr">
<div></div>
<div>
<div dir="ltr">Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com></div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Regards,</div>
<div dir="ltr">Hawking</div>
<div id="ms-outlook-mobile-signature">
<div><br>
</div>
Get <a href="https://aka.ms/o0ukef">Outlook for iOS</a></div>
</div>
</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, June 22, 2023 1:44:42 PM<br>
<b>To:</b> Lazar, Lijo <Lijo.Lazar@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Kasiviswanathan, Harish <Harish.Kasiviswanathan@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>Subject:</b> RE: [PATCH] drm/amd/pm: Provide energy data in 15.625mJ units</font>
<div> </div>
</div>
<div class="BodyFragment"><font face="Times New Roman" size="3"><span style="font-size:12pt;"><a name="BM_BEGIN"></a>
<div><font size="2"><span style="font-size:11pt;">[AMD Official Use Only - General]<br>
<br>
<ping><br>
<br>
Thanks,<br>
Lijo<br>
<br>
-----Original Message-----<br>
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Lijo Lazar<br>
Sent: Monday, June 19, 2023 6:12 PM<br>
To: amd-gfx@lists.freedesktop.org<br>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Kasiviswanathan, Harish <Harish.Kasiviswanathan@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
Subject: [PATCH] drm/amd/pm: Provide energy data in 15.625mJ units<br>
<br>
Publish energy data in 15.625mJ unit for SMU v13.0.6. The same unit is used in Aldebaran also.<br>
<br>
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com><br>
---<br>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c<br>
index a92ea4601ea4..6ef12252beb5 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c<br>
@@ -200,7 +200,6 @@ struct PPTable_t {<br>
};<br>
<br>
#define SMUQ10_TO_UINT(x) ((x) >> 10)<br>
-#define SMUQ16_TO_UINT(x) ((x) >> 16)<br>
<br>
struct smu_v13_0_6_dpm_map {<br>
enum smu_clk_type clk_type;<br>
@@ -1994,8 +1993,9 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table<br>
<br>
gpu_metrics->average_socket_power =<br>
SMUQ10_TO_UINT(metrics->SocketPower);<br>
+ /* Energy is reported in 15.625mJ units */<br>
gpu_metrics->energy_accumulator =<br>
- SMUQ16_TO_UINT(metrics->SocketEnergyAcc);<br>
+ SMUQ10_TO_UINT(metrics->SocketEnergyAcc);<br>
<br>
gpu_metrics->current_gfxclk =<br>
SMUQ10_TO_UINT(metrics->GfxclkFrequency[xcc0]);<br>
--<br>
2.25.1<br>
<br>
</span></font></div>
</span></font></div>
</div>
</body>
</html>