summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2019-07-11 01:46:36 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2019-07-11 01:46:36 +0000
commit320167d60ded46578f4aa42f3a6bb22fa3fdbd3e (patch)
treeb34c578182a944f16d9459e383d0e20300ef3fb8 /sys/dev/pci
parentd207c176d3404e2c76c631521b7f39e21c939c11 (diff)
drm/amd/powerplay: use hardware fan control if no powerplay fan table
From Evan Quan ec6d8c9e6687868dfd58994b2ea1758fe60f2733 in linux 4.19.y/4.19.58 f78c581e22d4b33359ac3462e8d0504735df01f4 in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c4
-rw-r--r--sys/dev/pci/drm/amd/powerplay/inc/hwmgr.h1
-rw-r--r--sys/dev/pci/drm/amd/powerplay/smumgr/polaris10_smumgr.c4
3 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c b/sys/dev/pci/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
index 4e1fd539384..fbbd5a4877e 100644
--- a/sys/dev/pci/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
+++ b/sys/dev/pci/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
@@ -916,8 +916,10 @@ static int init_thermal_controller(
PHM_PlatformCaps_ThermalController
);
- if (0 == powerplay_table->usFanTableOffset)
+ if (0 == powerplay_table->usFanTableOffset) {
+ hwmgr->thermal_controller.use_hw_fan_control = 1;
return 0;
+ }
fan_table = (const PPTable_Generic_SubTable_Header *)
(((unsigned long)powerplay_table) +
diff --git a/sys/dev/pci/drm/amd/powerplay/inc/hwmgr.h b/sys/dev/pci/drm/amd/powerplay/inc/hwmgr.h
index ef14644efe9..9aa75f62aad 100644
--- a/sys/dev/pci/drm/amd/powerplay/inc/hwmgr.h
+++ b/sys/dev/pci/drm/amd/powerplay/inc/hwmgr.h
@@ -677,6 +677,7 @@ struct pp_thermal_controller_info {
uint8_t ucType;
uint8_t ucI2cLine;
uint8_t ucI2cAddress;
+ uint8_t use_hw_fan_control;
struct pp_fan_info fanInfo;
struct pp_advance_fan_control_parameters advanceFanControlParameters;
};
diff --git a/sys/dev/pci/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/sys/dev/pci/drm/amd/powerplay/smumgr/polaris10_smumgr.c
index 45629f26dbc..0dbca386585 100644
--- a/sys/dev/pci/drm/amd/powerplay/smumgr/polaris10_smumgr.c
+++ b/sys/dev/pci/drm/amd/powerplay/smumgr/polaris10_smumgr.c
@@ -2038,6 +2038,10 @@ static int polaris10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
return 0;
}
+ /* use hardware fan control */
+ if (hwmgr->thermal_controller.use_hw_fan_control)
+ return 0;
+
tmp64 = hwmgr->thermal_controller.advanceFanControlParameters.
usPWMMin * duty100;
do_div(tmp64, 10000);