<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0078D7;margin:15pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Yuxian Dai <Yuxian.Dai@amd.com><br>
<b>Sent:</b> Wednesday, April 1, 2020 2:02 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Dai, Yuxian (David) <Yuxian.Dai@amd.com>; Dai, Yuxian (David) <Yuxian.Dai@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu/powerplay: using the FCLK DPM table to set the MCLK</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">From: "yuxiadai@amd.com" <yuxiadai@amd.com><br>
<br>
1,Using the FCLK DPM table to set the MCLK for DPM states consist of<br>
three entities:<br>
FCLK<br>
UCLK<br>
MEMCLK<br>
All these three clk change together, MEMCLK from FCLK, so use the fclk<br>
frequency.<br>
2,we should show the current working clock freqency from clock table metric<br>
<br>
Change-Id: Ia45f3069fc7ae56db495cb5a3865e2c50c550774<br>
Signed-off-by: Yuxian Dai <Yuxian.Dai@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 8 ++++++++<br>
drivers/gpu/drm/amd/powerplay/renoir_ppt.h | 2 +-<br>
2 files changed, 9 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c<br>
index 7bf52ecba01d..5c5d3f974532 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c<br>
@@ -239,6 +239,7 @@ static int renoir_print_clk_levels(struct smu_context *smu,<br>
uint32_t cur_value = 0, value = 0, count = 0, min = 0, max = 0;<br>
DpmClocks_t *clk_table = smu->smu_table.clocks_table;<br>
SmuMetrics_t metrics;<br>
+ bool cur_value_match_level = false;<br>
<br>
if (!clk_table || clk_type >= SMU_CLK_COUNT)<br>
return -EINVAL;<br>
@@ -297,6 +298,13 @@ static int renoir_print_clk_levels(struct smu_context *smu,<br>
GET_DPM_CUR_FREQ(clk_table, clk_type, i, value);<br>
size += sprintf(buf + size, "%d: %uMhz %s\n", i, value,<br>
cur_value == value ? "*" : "");<br>
+ if(cur_value == value) {<br>
+ cur_value_match_level = true;<br>
+ }<br>
+ }<br>
+ <br>
+ if(!cur_value_match_level) {<br>
+ size += sprintf(buf + size, " %uMhz *\n",cur_value);<br>
}</div>
<div class="PlainText">[kevin]:</div>
<div class="PlainText"><span>I have a little suggestion about coding style.</span></div>
<div class="PlainText"><span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">"Do not unnecessarily
use braces where a single statement will do."</span></div>
<div class="PlainText"><span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">we'd better fix
it.</span></div>
<div class="PlainText"><span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">thanks.</span></div>
<div class="PlainText"><span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></div>
<div class="PlainText"><a href="https://www.kernel.org/doc/html/latest/process/coding-style.html" id="LPlnk438159">https://www.kernel.org/doc/html/latest/process/coding-style.html</a></div>
<div id="LPBorder_GTaHR0cHM6Ly93d3cua2VybmVsLm9yZy9kb2MvaHRtbC9sYXRlc3QvcHJvY2Vzcy9jb2Rpbmctc3R5bGUuaHRtbA.." class="LPBorder234871" contenteditable="false" style="width: 100%; margin-top: 16px; margin-bottom: 16px; position: relative; max-width: 800px; min-width: 424px;">
<table id="LPContainer234871" role="presentation" style="padding: 12px 36px 12px 12px; width: 100%; border-width: 1px; border-style: solid; border-color: rgb(200, 200, 200); border-radius: 2px;">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td style="width: 100%;">
<div id="LPTitle234871" style="font-size: 21px; font-weight: 300; margin-right: 8px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px;">
<a target="_blank" id="LPUrlAnchor234871" href="https://www.kernel.org/doc/html/latest/process/coding-style.html" style="text-decoration: none; color: var(--themePrimary);">Linux kernel coding style — The Linux Kernel documentation</a></div>
<div id="LPDescription234871" style="font-size: 14px; max-height: 100px; color: rgb(102, 102, 102); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px; margin-right: 8px; overflow: hidden;">
Linux kernel coding style¶. This is a short document describing the preferred coding style for the linux kernel. Coding style is very personal, and I won’t force my views on anybody, but this is what goes for anything that I have to be able to maintain, and
I’d prefer it for most other things too. Please at least consider the points made here.</div>
<div id="LPMetadata234871" style="font-size: 14px; font-weight: 400; color: rgb(166, 166, 166); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;">
www.kernel.org</div>
</td>
</tr>
</tbody>
</table>
</div>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: rgb(0, 0, 0); font-family: serif; background-color: rgb(252, 252, 252)">
</p>
<div class="PlainText"> <br>
return size;<br>
diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.h b/drivers/gpu/drm/amd/powerplay/renoir_ppt.h<br>
index 2a390ddd37dd..89cd6da118a3 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.h<br>
@@ -37,7 +37,7 @@ extern void renoir_set_ppt_funcs(struct smu_context *smu);<br>
freq = table->SocClocks[dpm_level].Freq; \<br>
break; \<br>
case SMU_MCLK: \<br>
- freq = table->MemClocks[dpm_level].Freq; \<br>
+ freq = table->FClocks[dpm_level].Freq; \<br>
break; \<br>
case SMU_DCEFCLK: \<br>
freq = table->DcfClocks[dpm_level].Freq; \<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CKevin1.Wang%40amd.com%7Cac64217a79c44e06267008d7d602484e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637213177638342283&sdata=iEt1JzC0wcb7rQ%2F2TWBu7RfJGrChPpt%2Fc2jXPfqjruU%3D&reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CKevin1.Wang%40amd.com%7Cac64217a79c44e06267008d7d602484e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637213177638342283&sdata=iEt1JzC0wcb7rQ%2F2TWBu7RfJGrChPpt%2Fc2jXPfqjruU%3D&reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>