<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"><br>
</p>
<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 Rex Zhu <Rex.Zhu@amd.com><br>
<b>Sent:</b> Tuesday, December 12, 2017 2:24 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH] drm/amd/pp: implement dpm_get_sclk/mclk for RV</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">Change-Id: I3abf5bde8c64ccab8e842a7c22aee011fc34e69f<br>
Reviewed-by: Evan Quan <evan.quan@amd.com><br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">---<br>
 drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 25 +++++++++++++++++++++++--<br>
 1 file changed, 23 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c<br>
index 3e0b267..027fd63 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c<br>
@@ -523,12 +523,33 @@ static int rv_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,<br>
 <br>
 static uint32_t rv_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low)<br>
 {<br>
-       return 0;<br>
+       struct rv_hwmgr *data;<br>
+<br>
+       if (hwmgr == NULL)<br>
+               return -EINVAL;<br>
+<br>
+       data = (struct rv_hwmgr *)(hwmgr->backend);<br>
+<br>
+       if (low)<br>
+               return data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk;<br>
+       else<br>
+               return data->clock_vol_info.vdd_dep_on_fclk->entries[<br>
+                       data->clock_vol_info.vdd_dep_on_fclk->count - 1].clk;<br>
 }<br>
 <br>
 static uint32_t rv_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low)<br>
 {<br>
-       return 0;<br>
+       struct rv_hwmgr *data;<br>
+<br>
+       if (hwmgr == NULL)<br>
+               return -EINVAL;<br>
+<br>
+       data = (struct rv_hwmgr *)(hwmgr->backend);<br>
+<br>
+       if (low)<br>
+               return data->gfx_min_freq_limit;<br>
+       else<br>
+               return data->gfx_max_freq_limit;<br>
 }<br>
 <br>
 static int rv_dpm_patch_boot_state(struct pp_hwmgr *hwmgr,<br>
-- <br>
1.9.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="LPlnk281759" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>