<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> Wednesday, May 30, 2018 5:00:08 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH] drm/amd/pp: Allow underclocking when od table is empty in vbios</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">if the max od engine clock limit and memory clock limit are not set<br>
in vbios. driver will allow underclocking instand of disable od feature<br>
completely.<br>
<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c | 6 ------<br>
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c | 6 ------<br>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 5 ++++-<br>
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 6 ++++++<br>
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c | 6 ------<br>
5 files changed, 10 insertions(+), 19 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c<br>
index f0d48b1..35bd987 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c<br>
@@ -870,12 +870,6 @@ static int init_over_drive_limits(<br>
hwmgr->platform_descriptor.maxOverdriveVDDC = 0;<br>
hwmgr->platform_descriptor.overdriveVDDCStep = 0;<br>
<br>
- if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 \<br>
- || hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {<br>
- hwmgr->od_enabled = false;<br>
- pr_debug("OverDrive feature not support by VBIOS\n");<br>
- }<br>
-<br>
return 0;<br>
}<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c<br>
index ce64dfa..925e171 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c<br>
@@ -1074,12 +1074,6 @@ static int init_overdrive_limits(struct pp_hwmgr *hwmgr,<br>
powerplay_table,<br>
(const ATOM_FIRMWARE_INFO_V2_1 *)fw_info);<br>
<br>
- if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0<br>
- && hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {<br>
- hwmgr->od_enabled = false;<br>
- pr_debug("OverDrive feature not support by VBIOS\n");<br>
- }<br>
-<br>
return result;<br>
}<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 d142008..2b4b911 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
@@ -791,7 +791,8 @@ static int smu7_setup_dpm_tables_v1(struct pp_hwmgr *hwmgr)<br>
data->dpm_table.sclk_table.count++;<br>
}<br>
}<br>
-<br>
+ if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0)<br>
+ hwmgr->platform_descriptor.overdriveLimit.engineClock = dep_sclk_table->entries[i-1].clk;<br>
/* Initialize Mclk DPM table based on allow Mclk values */<br>
data->dpm_table.mclk_table.count = 0;<br>
for (i = 0; i < dep_mclk_table->count; i++) {<br>
@@ -806,6 +807,8 @@ static int smu7_setup_dpm_tables_v1(struct pp_hwmgr *hwmgr)<br>
}<br>
}<br>
<br>
+ if (hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0)<br>
+ hwmgr->platform_descriptor.overdriveLimit.memoryClock = dep_mclk_table->entries[i-1].clk;<br>
return 0;<br>
}<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
index 97864c7..dd52d7e 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
@@ -1311,6 +1311,9 @@ static int vega10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)<br>
vega10_setup_default_single_dpm_table(hwmgr,<br>
dpm_table,<br>
dep_gfx_table);<br>
+ if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0)<br>
+ hwmgr->platform_descriptor.overdriveLimit.engineClock =<br>
+ dpm_table->dpm_levels[dpm_table->count-1].value;<br>
vega10_init_dpm_state(&(dpm_table->dpm_state));<br>
<br>
/* Initialize Mclk DPM table based on allow Mclk values */<br>
@@ -1319,6 +1322,9 @@ static int vega10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)<br>
vega10_setup_default_single_dpm_table(hwmgr,<br>
dpm_table,<br>
dep_mclk_table);<br>
+ if (hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0)<br>
+ hwmgr->platform_descriptor.overdriveLimit.memoryClock =<br>
+ dpm_table->dpm_levels[dpm_table->count-1].value;<br>
vega10_init_dpm_state(&(dpm_table->dpm_state));<br>
<br>
data->dpm_table.eclk_table.count = 0;<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c<br>
index 0768d25..16b1a9c 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c<br>
@@ -267,12 +267,6 @@ static int init_over_drive_limits(<br>
hwmgr->platform_descriptor.maxOverdriveVDDC = 0;<br>
hwmgr->platform_descriptor.overdriveVDDCStep = 0;<br>
<br>
- if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 ||<br>
- hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {<br>
- hwmgr->od_enabled = false;<br>
- pr_debug("OverDrive feature not support by VBIOS\n");<br>
- }<br>
-<br>
return 0;<br>
}<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>