[Nouveau] [PATCH 18/32] therm: Trigger reclock in temperature daemon

Karol Herbst karolherbst at gmail.com
Fri Nov 17 00:04:22 UTC 2017


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 <karolherbst at gmail.com>
Reviewed-by: Martin Peres <martin.peres at free.fr>
Reviewed-by: Pierre Moreau <pierre.morrow at free.fr>
---
 drm/nouveau/nvkm/subdev/therm/base.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drm/nouveau/nvkm/subdev/therm/base.c b/drm/nouveau/nvkm/subdev/therm/base.c
index 253da199..3e1767a0 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, int *val)
 {
@@ -102,6 +104,7 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode)
 {
 	struct nvkm_subdev *subdev = &therm->subdev;
 	struct nvkm_timer *tmr = subdev->device->timer;
+	struct nvkm_clk *clk = subdev->device->clk;
 	unsigned long flags;
 	bool immd = true;
 	bool poll = true;
@@ -156,6 +159,9 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode)
 		nvkm_debug(subdev, "FAN target request: %d%%\n", duty);
 		nvkm_therm_fan_set(therm, immd, duty);
 	}
+
+	if (clk)
+		nvkm_clk_tstate(clk, temp);
 }
 
 int
-- 
2.15.0



More information about the Nouveau mailing list