<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Rex Zhu <Rex.Zhu@amd.com><br>
<b>Sent:</b> Monday, January 8, 2018 4:57:30 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH 1/2] drm/amd/pp: Add memory clock info display on Cz/St</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">show mclk info as in MHz on Cz/St as<br>
0: 333Mhz *<br>
1: 800Mhz<br>
<br>
Change-Id: Ie5932ac81b15565edb154ec6c00b35a99ab52b73<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 13 +++++++++++++<br>
 1 file changed, 13 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c<br>
index b83fe97..f68dd08 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c<br>
@@ -1584,6 +1584,7 @@ static int cz_force_clock_level(struct pp_hwmgr *hwmgr,<br>
 static int cz_print_clock_levels(struct pp_hwmgr *hwmgr,<br>
                 enum pp_clock_type type, char *buf)<br>
 {<br>
+       struct cz_hwmgr *data = (struct cz_hwmgr *)(hwmgr->backend);<br>
         struct phm_clock_voltage_dependency_table *sclk_table =<br>
                         hwmgr->dyn_state.vddc_dependency_on_sclk;<br>
         int i, now, size = 0;<br>
@@ -1601,6 +1602,18 @@ static int cz_print_clock_levels(struct pp_hwmgr *hwmgr,<br>
                                         i, sclk_table->entries[i].clk / 100,<br>
                                         (i == now) ? "*" : "");<br>
                 break;<br>
+       case PP_MCLK:<br>
+               now = PHM_GET_FIELD(cgs_read_ind_register(hwmgr->device,<br>
+                               CGS_IND_REG__SMC,<br>
+                               ixTARGET_AND_CURRENT_PROFILE_INDEX),<br>
+                               TARGET_AND_CURRENT_PROFILE_INDEX,<br>
+                               CURR_MCLK_INDEX);<br>
+<br>
+               for (i = CZ_NUM_NBPMEMORYCLOCK; i > 0; i--)<br>
+                       size += sprintf(buf + size, "%d: %uMhz %s\n",<br>
+                                       CZ_NUM_NBPMEMORYCLOCK-i, data->sys_info.nbp_memory_clock[i-1] / 100,<br>
+                                       (CZ_NUM_NBPMEMORYCLOCK-i == now) ? "*" : "");<br>
+               break;<br>
         default:<br>
                 break;<br>
         }<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">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>