Depending on the temperature, cstates might become unreachable or the maped
voltage of a cstate changes. We want to adjust to that.

Signed-off-by: Karol Herbst <karolher...@gmail.com>
Reviewed-by: Martin Peres <martin.pe...@free.fr>
---
 drm/nouveau/nvkm/subdev/therm/base.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drm/nouveau/nvkm/subdev/therm/base.c 
b/drm/nouveau/nvkm/subdev/therm/base.c
index 1a49759c..2a83e92a 100644
--- a/drm/nouveau/nvkm/subdev/therm/base.c
+++ b/drm/nouveau/nvkm/subdev/therm/base.c
@@ -23,6 +23,8 @@
  */
 #include "priv.h"
 
+#include <subdev/clk.h>
+
 int
 nvkm_therm_temp_get(struct nvkm_therm *therm)
 {
@@ -167,8 +169,13 @@ nvkm_therm_alarm(struct nvkm_alarm *alarm)
 {
        struct nvkm_therm *therm =
               container_of(alarm, struct nvkm_therm, alarm);
+       struct nvkm_clk *clk = therm->subdev.device->clk;
+
        therm->last_temp = nvkm_therm_temp_get(therm);
        nvkm_therm_update(therm, therm->last_temp, -1);
+
+       if (clk)
+               nvkm_clk_tstate(clk, therm->last_temp);
 }
 
 int
-- 
2.13.2

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to