<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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Kevin Wang <kevin1.wang@amd.com></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 Quan, Evan <Evan.Quan@amd.com><br>
<b>Sent:</b> Monday, September 9, 2019 7:33 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Li, Candice <Candice.Li@amd.com>; Gui, Jack <Jack.Gui@amd.com>; Quan, Evan <Evan.Quan@amd.com><br>
<b>Subject:</b> [PATCH 1/2] drm/amd/powerplay: issue DC-BTC for arcturus on SMU init</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Need to perform DC-BTC for arcturus on bootup.<br>
<br>
Change-Id: I7f048ba17cafe8909c5ee1e00830e4f8527d1a05<br>
Signed-off-by: Evan Quan <evan.quan@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 4 ++--<br>
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 17 ++++++++++++-----<br>
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 6 +++---<br>
.../gpu/drm/amd/powerplay/inc/arcturus_ppsmc.h | 3 +--<br>
drivers/gpu/drm/amd/powerplay/inc/smu_types.h | 1 +<br>
drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2 +-<br>
6 files changed, 20 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
index 2602d9fa2d77..f13e134be42e 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
@@ -1079,8 +1079,8 @@ static int smu_smc_table_hw_init(struct smu_context *smu,<br>
if (ret)<br>
return ret;<br>
<br>
- /* issue RunAfllBtc msg */<br>
- ret = smu_run_afll_btc(smu);<br>
+ /* issue Run*Btc msg */<br>
+ ret = smu_run_btc(smu);<br>
if (ret)<br>
return ret;<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
index 61cce5fed29f..7f6fc6d9a181 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
@@ -112,8 +112,7 @@ static struct smu_11_0_cmn2aisc_mapping arcturus_message_map[SMU_MSG_MAX_COUNT]<br>
MSG_MAP(PrepareMp1ForShutdown, PPSMC_MSG_PrepareMp1ForShutdown),<br>
MSG_MAP(SoftReset, PPSMC_MSG_SoftReset),<br>
MSG_MAP(RunAfllBtc, PPSMC_MSG_RunAfllBtc),<br>
- MSG_MAP(RunGfxDcBtc, PPSMC_MSG_RunGfxDcBtc),<br>
- MSG_MAP(RunSocDcBtc, PPSMC_MSG_RunSocDcBtc),<br>
+ MSG_MAP(RunDcBtc, PPSMC_MSG_RunDcBtc),<br>
MSG_MAP(DramLogSetDramAddrHigh, PPSMC_MSG_DramLogSetDramAddrHigh),<br>
MSG_MAP(DramLogSetDramAddrLow, PPSMC_MSG_DramLogSetDramAddrLow),<br>
MSG_MAP(DramLogSetDramSize, PPSMC_MSG_DramLogSetDramSize),<br>
@@ -547,9 +546,17 @@ static int arcturus_append_powerplay_table(struct smu_context *smu)<br>
return 0;<br>
}<br>
<br>
-static int arcturus_run_btc_afll(struct smu_context *smu)<br>
+static int arcturus_run_btc(struct smu_context *smu)<br>
{<br>
- return smu_send_smc_msg(smu, SMU_MSG_RunAfllBtc);<br>
+ int ret = 0;<br>
+<br>
+ ret = smu_send_smc_msg(smu, SMU_MSG_RunAfllBtc);<br>
+ if (ret) {<br>
+ pr_err("RunAfllBtc failed!\n");<br>
+ return ret;<br>
+ }<br>
+<br>
+ return smu_send_smc_msg(smu, SMU_MSG_RunDcBtc);<br>
}<br>
<br>
static int arcturus_populate_umd_state_clk(struct smu_context *smu)<br>
@@ -2307,7 +2314,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = {<br>
/* init dpm */<br>
.get_allowed_feature_mask = arcturus_get_allowed_feature_mask,<br>
/* btc */<br>
- .run_afll_btc = arcturus_run_btc_afll,<br>
+ .run_btc = arcturus_run_btc,<br>
/* dpm/clk tables */<br>
.set_default_dpm_table = arcturus_set_default_dpm_table,<br>
.populate_umd_state_clk = arcturus_populate_umd_state_clk,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h<br>
index 3c69065b029e..3de88d084615 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h<br>
@@ -427,7 +427,7 @@ struct pptable_funcs {<br>
int (*get_smu_table_index)(struct smu_context *smu, uint32_t index);<br>
int (*get_smu_power_index)(struct smu_context *smu, uint32_t index);<br>
int (*get_workload_type)(struct smu_context *smu, enum PP_SMC_POWER_PROFILE profile);<br>
- int (*run_afll_btc)(struct smu_context *smu);<br>
+ int (*run_btc)(struct smu_context *smu);<br>
int (*get_allowed_feature_mask)(struct smu_context *smu, uint32_t *feature_mask, uint32_t num);<br>
enum amd_pm_state_type (*get_current_power_state)(struct smu_context *smu);<br>
int (*set_default_dpm_table)(struct smu_context *smu);<br>
@@ -745,8 +745,8 @@ struct smu_funcs<br>
((smu)->ppt_funcs? ((smu)->ppt_funcs->get_smu_power_index? (smu)->ppt_funcs->get_smu_power_index((smu), (src)) : -EINVAL) : -EINVAL)<br>
#define smu_workload_get_type(smu, profile) \<br>
((smu)->ppt_funcs? ((smu)->ppt_funcs->get_workload_type? (smu)->ppt_funcs->get_workload_type((smu), (profile)) : -EINVAL) : -EINVAL)<br>
-#define smu_run_afll_btc(smu) \<br>
- ((smu)->ppt_funcs? ((smu)->ppt_funcs->run_afll_btc? (smu)->ppt_funcs->run_afll_btc((smu)) : 0) : 0)<br>
+#define smu_run_btc(smu) \<br>
+ ((smu)->ppt_funcs? ((smu)->ppt_funcs->run_btc? (smu)->ppt_funcs->run_btc((smu)) : 0) : 0)<br>
#define smu_get_allowed_feature_mask(smu, feature_mask, num) \<br>
((smu)->ppt_funcs? ((smu)->ppt_funcs->get_allowed_feature_mask? (smu)->ppt_funcs->get_allowed_feature_mask((smu), (feature_mask), (num)) : 0) : 0)<br>
#define smu_set_deep_sleep_dcefclk(smu, clk) \<br>
diff --git a/drivers/gpu/drm/amd/powerplay/inc/arcturus_ppsmc.h b/drivers/gpu/drm/amd/powerplay/inc/arcturus_ppsmc.h<br>
index 78e5927b7711..e3291259b249 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/inc/arcturus_ppsmc.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/inc/arcturus_ppsmc.h<br>
@@ -95,8 +95,7 @@<br>
<br>
//BTC<br>
#define PPSMC_MSG_RunAfllBtc 0x30<br>
-#define PPSMC_MSG_RunGfxDcBtc 0x31<br>
-#define PPSMC_MSG_RunSocDcBtc 0x32<br>
+#define PPSMC_MSG_RunDcBtc 0x31<br>
<br>
//Debug<br>
#define PPSMC_MSG_DramLogSetDramAddrHigh 0x33<br>
diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu_types.h b/drivers/gpu/drm/amd/powerplay/inc/smu_types.h<br>
index b0dd05d431dd..ab8c92a60fc4 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/inc/smu_types.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/inc/smu_types.h<br>
@@ -114,6 +114,7 @@<br>
__SMU_DUMMY_MAP(PowerDownJpeg), \<br>
__SMU_DUMMY_MAP(BacoAudioD3PME), \<br>
__SMU_DUMMY_MAP(ArmD3), \<br>
+ __SMU_DUMMY_MAP(RunDcBtc), \<br>
__SMU_DUMMY_MAP(RunGfxDcBtc), \<br>
__SMU_DUMMY_MAP(RunSocDcBtc), \<br>
__SMU_DUMMY_MAP(SetMemoryChannelEnable), \<br>
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c<br>
index 929f61891dfa..e9ecc3f7aab1 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c<br>
@@ -3145,7 +3145,7 @@ static const struct pptable_funcs vega20_ppt_funcs = {<br>
.get_smu_table_index = vega20_get_smu_table_index,<br>
.get_smu_power_index = vega20_get_pwr_src_index,<br>
.get_workload_type = vega20_get_workload_type,<br>
- .run_afll_btc = vega20_run_btc_afll,<br>
+ .run_btc = vega20_run_btc_afll,<br>
.get_allowed_feature_mask = vega20_get_allowed_feature_mask,<br>
.get_current_power_state = vega20_get_current_power_state,<br>
.set_default_dpm_table = vega20_set_default_dpm_table,<br>
-- <br>
2.23.0<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></div>
</span></font></div>
</body>
</html>