Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65d5ea5f authored by Sandeep Raghuraman's avatar Sandeep Raghuraman Committed by Greg Kroah-Hartman
Browse files

drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay table v0 (e.g Hawaii)



[ Upstream commit bbc25dadc7ed19f9d6b2e30980f0eb4c741bb8bf ]

Initialize thermal controller fields in the PowerPlay table for Hawaii
GPUs, so that fan speeds are reported.

Signed-off-by: default avatarSandeep Raghuraman <sandy.8925@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 14dfe0e4
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -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;
}