<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
        {font-family:"Segoe UI Light";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msipheadera92e061b, li.msipheadera92e061b, div.msipheadera92e061b
        {mso-style-name:msipheadera92e061b;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal-compose;
        font-family:"Arial",sans-serif;
        color:#0078D7;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:211038915;
        mso-list-template-ids:659446460;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1
        {mso-list-id:1788968203;
        mso-list-type:hybrid;
        mso-list-template-ids:-1850304904 -462801084 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l1:level1
        {mso-level-start-at:5;
        mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.25in;
        font-family:Wingdings;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:Calibri;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.25in;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.75in;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.25in;
        text-indent:-.25in;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.75in;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.25in;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.75in;
        text-indent:-.25in;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:4.25in;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:4.75in;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="msipheadera92e061b" style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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 <<a href="mailto:Yuxian.Dai@amd.com">Yuxian.Dai@amd.com</a>><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>
         }<o:p></o:p></p>
<div>
<p class="MsoNormal">[kevin]:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I have a little suggestion about coding style.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif;color:black;background:white">"Do not unnecessarily use braces where a single statement will do."</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif;color:black;background:white">we'd better fix it.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif;color:black;background:white">thanks.</span><o:p></o:p></p>
</div>
<div>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.25in;mso-list:l1 level1 lfo3">Ok, I will remove it.<o:p></o:p></li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://www.kernel.org/doc/html/latest/process/coding-style.html">https://www.kernel.org/doc/html/latest/process/coding-style.html</a><o:p></o:p></p>
</div>
<div style="margin-top:12.0pt;margin-bottom:12.0pt;min-width: 424px" id="LPBorder_GTaHR0cHM6Ly93d3cua2VybmVsLm9yZy9kb2MvaHRtbC9sYXRlc3QvcHJvY2Vzcy9jb2Rpbmctc3R5bGUuaHRtbA..">
<table class="MsoNormalTable" border="1" cellspacing="3" cellpadding="0" width="100%" style="width:100.0%;border:solid #C8C8C8 1.0pt">
<tbody>
<tr>
<td width="100%" valign="top" style="width:100.0%;border:none;padding:9.0pt 27.0pt 9.0pt 9.0pt">
<div style="margin-right:6.0pt;margin-bottom:9.0pt" id="LPTitle234871">
<p class="MsoNormal"><span style="font-size:16.0pt;font-family:"Segoe UI Light",sans-serif"><a href="https://www.kernel.org/doc/html/latest/process/coding-style.html" target="_blank"><span style="text-decoration:none">Linux kernel coding style — The Linux Kernel
 documentation</span></a><o:p></o:p></span></p>
</div>
<div style="margin-right:6.0pt;margin-bottom:9.0pt;max-height: 100px;overflow:hidden" id="LPDescription234871">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#666666">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.<o:p></o:p></span></p>
</div>
<div id="LPMetadata234871">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#A6A6A6"><a href="http://www.kernel.org">www.kernel.org</a><o:p></o:p></span></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<p class="MsoNormal" style="box-sizing: border-box"><span style="color:black"> </span><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>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CKevin1.Wang%40amd.com%7Cac64217a79c44e06267008d7d602484e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637213177638342283&amp;sdata=iEt1JzC0wcb7rQ%2F2TWBu7RfJGrChPpt%2Fc2jXPfqjruU%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CKevin1.Wang%40amd.com%7Cac64217a79c44e06267008d7d602484e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637213177638342283&amp;sdata=iEt1JzC0wcb7rQ%2F2TWBu7RfJGrChPpt%2Fc2jXPfqjruU%3D&amp;reserved=0</a><o:p></o:p></p>
</div>
</div>
</body>
</html>