<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Harry Wentland <harry.wentland@amd.com><br>
<b>Sent:</b> Monday, July 9, 2018 1:57 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Wentland, Harry<br>
<b>Subject:</b> [PATCH] drm/amd/pp: Send khz clock values to DC for smu7/8</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">The previous change wasn't covering smu 7 and 8 and therefore DC was<br>
seeing wrong clock values.<br>
<br>
This fixes an issue where the pipes seem to hang with a 4k DP and 1080p<br>
HDMI display.<br>
<br>
Fixes: c3df50abc84b ("drm/amd/pp: Convert clock unit to KHz as defined")<br>
Signed-off-by: Harry Wentland <harry.wentland@amd.com><br>
Cc:rex.zhu@amd.com<br>
---<br>
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 8 ++++----<br>
 drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c | 6 +++---<br>
 2 files changed, 7 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
index 8eaaa6b7973e..e5e5c1c2f8ff 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
@@ -4610,12 +4610,12 @@ static int smu7_get_sclks(struct pp_hwmgr *hwmgr, struct amd_pp_clocks *clocks)<br>
                         return -EINVAL;<br>
                 dep_sclk_table = table_info->vdd_dep_on_sclk;<br>
                 for (i = 0; i < dep_sclk_table->count; i++)<br>
-                       clocks->clock[i] = dep_sclk_table->entries[i].clk;<br>
+                       clocks->clock[i] = dep_sclk_table->entries[i].clk * 10;<br>
                 clocks->count = dep_sclk_table->count;<br>
         } else if (hwmgr->pp_table_version == PP_TABLE_V0) {<br>
                 sclk_table = hwmgr->dyn_state.vddc_dependency_on_sclk;<br>
                 for (i = 0; i < sclk_table->count; i++)<br>
-                       clocks->clock[i] = sclk_table->entries[i].clk;<br>
+                       clocks->clock[i] = sclk_table->entries[i].clk * 10;<br>
                 clocks->count = sclk_table->count;<br>
         }<br>
 <br>
@@ -4647,7 +4647,7 @@ static int smu7_get_mclks(struct pp_hwmgr *hwmgr, struct amd_pp_clocks *clocks)<br>
                         return -EINVAL;<br>
                 dep_mclk_table = table_info->vdd_dep_on_mclk;<br>
                 for (i = 0; i < dep_mclk_table->count; i++) {<br>
-                       clocks->clock[i] = dep_mclk_table->entries[i].clk;<br>
+                       clocks->clock[i] = dep_mclk_table->entries[i].clk * 10;<br>
                         clocks->latency[i] = smu7_get_mem_latency(hwmgr,<br>
                                                 dep_mclk_table->entries[i].clk);<br>
                 }<br>
@@ -4655,7 +4655,7 @@ static int smu7_get_mclks(struct pp_hwmgr *hwmgr, struct amd_pp_clocks *clocks)<br>
         } else if (hwmgr->pp_table_version == PP_TABLE_V0) {<br>
                 mclk_table = hwmgr->dyn_state.vddc_dependency_on_mclk;<br>
                 for (i = 0; i < mclk_table->count; i++)<br>
-                       clocks->clock[i] = mclk_table->entries[i].clk;<br>
+                       clocks->clock[i] = mclk_table->entries[i].clk * 10;<br>
                 clocks->count = mclk_table->count;<br>
         }<br>
         return 0;<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c<br>
index 50690c72b2ea..288802f209dd 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c<br>
@@ -1604,17 +1604,17 @@ static int smu8_get_clock_by_type(struct pp_hwmgr *hwmgr, enum amd_pp_clock_type<br>
         switch (type) {<br>
         case amd_pp_disp_clock:<br>
                 for (i = 0; i < clocks->count; i++)<br>
-                       clocks->clock[i] = data->sys_info.display_clock[i];<br>
+                       clocks->clock[i] = data->sys_info.display_clock[i] * 10;<br>
                 break;<br>
         case amd_pp_sys_clock:<br>
                 table = hwmgr->dyn_state.vddc_dependency_on_sclk;<br>
                 for (i = 0; i < clocks->count; i++)<br>
-                       clocks->clock[i] = table->entries[i].clk;<br>
+                       clocks->clock[i] = table->entries[i].clk * 10;<br>
                 break;<br>
         case amd_pp_mem_clock:<br>
                 clocks->count = SMU8_NUM_NBPMEMORYCLOCK;<br>
                 for (i = 0; i < clocks->count; i++)<br>
-                       clocks->clock[i] = data->sys_info.nbp_memory_clock[clocks->count - 1 - i];<br>
+                       clocks->clock[i] = data->sys_info.nbp_memory_clock[clocks->count - 1 - i] * 10;<br>
                 break;<br>
         default:<br>
                 return -1;<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" id="LPlnk884069" class="OWAAutoLink" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>