diff mbox series

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

Message ID CAGPDPzCHs0ty0rxs=QN7xmHhuDfftdO17P81-s=L=J5e_14vNw@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series AMDGPU: Correctly initialize thermal controller for GPUs with Powerplay table v0 (e.g Hawaii) | expand

Commit Message

Sandeep April 5, 2020, 4:52 p.m. UTC
This is required for the AMDGPU driver to report fan speed for Hawaii
GPUs (otherwise the fan speed is just reported as 0)
---
 .../drm/amd/powerplay/hwmgr/processpptables.c | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)

--

Comments

Sandeep April 10, 2020, 1:26 p.m. UTC | #1
Hello,

Can someone please look at this patch? It would be nice to get it
merged in, so that others using the Hawaii GPU can get proper fan
speeds reported. Thanks in advance.

Yours sincerely,
Sandeep

On Sun, 5 Apr 2020 at 22:22, Sandeep <sandy.8925@gmail.com> wrote:
>
> This is required for the AMDGPU driver to report fan speed for Hawaii
> GPUs (otherwise the fan speed is just reported as 0)
> ---
>  .../drm/amd/powerplay/hwmgr/processpptables.c | 28 +++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> index 77c14671866c..bb58cfab1033 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> @@ -984,6 +984,34 @@ 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;
>  }
>
> --
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
index 77c14671866c..bb58cfab1033 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
@@ -984,6 +984,34 @@  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;
 }