<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">Tested-by: Slava Abramov <slava.abramov@amd.com></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">Acked-by: Slava Abramov <slava.abramov@amd.com></span><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 Evan Quan <evan.quan@amd.com><br>
<b>Sent:</b> Thursday, June 27, 2019 11:15:29 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Quan, Evan<br>
<b>Subject:</b> [PATCH] drm/amd/powerplay: use hardware fan control if no powerplay fan table</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Use SMC default fan table if no external powerplay fan table.<br>
<br>
Change-Id: Icd7467a7fc5287a92945ba0fcc19699192b1683a<br>
Signed-off-by: Evan Quan <evan.quan@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c | 4 +++-<br>
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 +<br>
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 4 ++++<br>
3 files changed, 8 insertions(+), 1 deletion(-)<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 ae64ff7153d6..1cd5a8b5cdc1 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>
@@ -916,8 +916,10 @@ static int init_thermal_controller(<br>
PHM_PlatformCaps_ThermalController<br>
);<br>
<br>
- if (0 == powerplay_table->usFanTableOffset)<br>
+ if (0 == powerplay_table->usFanTableOffset) {<br>
+ hwmgr->thermal_controller.use_hw_fan_control = 1;<br>
return 0;<br>
+ }<br>
<br>
fan_table = (const PPTable_Generic_SubTable_Header *)<br>
(((unsigned long)powerplay_table) +<br>
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
index 2f186fcbdfc5..ec53bf24396e 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
@@ -697,6 +697,7 @@ struct pp_thermal_controller_info {<br>
uint8_t ucType;<br>
uint8_t ucI2cLine;<br>
uint8_t ucI2cAddress;<br>
+ uint8_t use_hw_fan_control;<br>
struct pp_fan_info fanInfo;<br>
struct pp_advance_fan_control_parameters advanceFanControlParameters;<br>
};<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
index fbac2d3326b5..a1a9f6196009 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
@@ -2092,6 +2092,10 @@ static int polaris10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)<br>
return 0;<br>
}<br>
<br>
+ /* use hardware fan control */<br>
+ if (hwmgr->thermal_controller.use_hw_fan_control)<br>
+ return 0;<br>
+<br>
tmp64 = hwmgr->thermal_controller.advanceFanControlParameters.<br>
usPWMMin * duty100;<br>
do_div(tmp64, 10000);<br>
-- <br>
2.21.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>