summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2020-05-11 05:08:10 +0000
committerjsg <jsg@openbsd.org>2020-05-11 05:08:10 +0000
commit2ee75d9e3befae7c65c585be0bc71a5b25e4b570 (patch)
tree1f127e50d2bcde754636087ab5bc6e922f79f3c3
parentdrm/edid: Fix off-by-one in DispID DTD pixel clock (diff)
downloadwireguard-openbsd-2ee75d9e3befae7c65c585be0bc71a5b25e4b570.tar.xz
wireguard-openbsd-2ee75d9e3befae7c65c585be0bc71a5b25e4b570.zip
drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay table v0 (e.g Hawaii)
From Sandeep Raghuraman 65d5ea5f20f76ecedcc470df45fe0d92146f8e8e in linux 4.19.y/4.19.122 bbc25dadc7ed19f9d6b2e30980f0eb4c741bb8bf in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/powerplay/hwmgr/processpptables.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/powerplay/hwmgr/processpptables.c b/sys/dev/pci/drm/amd/powerplay/hwmgr/processpptables.c
index 925e17104f9..b9e08b06ed5 100644
--- a/sys/dev/pci/drm/amd/powerplay/hwmgr/processpptables.c
+++ b/sys/dev/pci/drm/amd/powerplay/hwmgr/processpptables.c
@@ -983,6 +983,32 @@ static int init_thermal_controller(
struct pp_hwmgr *hwmgr,
const ATOM_PPLIB_POWERPLAYTABLE *powerplay_table)
{
+ hwmgr->thermal_controller.ucType =
+ powerplay_table->sThermalController.ucType;
+ hwmgr->thermal_controller.ucI2cLine =
+ powerplay_table->sThermalController.ucI2cLine;
+ hwmgr->thermal_controller.ucI2cAddress =
+ powerplay_table->sThermalController.ucI2cAddress;
+
+ hwmgr->thermal_controller.fanInfo.bNoFan =
+ (0 != (powerplay_table->sThermalController.ucFanParameters &
+ ATOM_PP_FANPARAMETERS_NOFAN));
+
+ hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution =
+ powerplay_table->sThermalController.ucFanParameters &
+ ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK;
+
+ hwmgr->thermal_controller.fanInfo.ulMinRPM
+ = powerplay_table->sThermalController.ucFanMinRPM * 100UL;
+ hwmgr->thermal_controller.fanInfo.ulMaxRPM
+ = powerplay_table->sThermalController.ucFanMaxRPM * 100UL;
+
+ set_hw_cap(hwmgr,
+ ATOM_PP_THERMALCONTROLLER_NONE != hwmgr->thermal_controller.ucType,
+ PHM_PlatformCaps_ThermalController);
+
+ hwmgr->thermal_controller.use_hw_fan_control = 1;
+
return 0;
}