summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@labri.fr>2012-11-04 23:18:49 (GMT)
committerBen Skeggs <bskeggs@redhat.com>2013-02-20 06:00:23 (GMT)
commit0083b91dac482c70eeb96745d9ef604f904da3e5 (patch)
tree657ddc161b7e1190fb1bbd6a48a5c9b2b1dfd482 /drivers/gpu/drm/nouveau/core/subdev/therm/base.c
parent9d7175c808793b3e30db455da7529d3c05b00712 (diff)
downloadlinux-fsl-qoriq-0083b91dac482c70eeb96745d9ef604f904da3e5.tar.xz
drm/nouveau/therm: implement support for temperature alarms
For now, we only boost the fan speed to the maximum and auto-mode when hitting the FAN_BOOST threshold and halt the computer when it reaches the shutdown temperature. The downclock and critical thresholds do nothing. On nv43:50 and nva3+, temperature is polled because of the limited hardware. I'll improve the nva3+ situation by implementing alarm management in PDAEMON whenever I can but polling once every second shouldn't be such a problem. v2 (Ben Skeggs): - rebased v3: fixed false-detections and threshold reprogrammation handling on nv50:nvc0 Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Martin Peres <martin.peres@labri.fr>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/subdev/therm/base.c')
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/therm/base.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
index dee764c..f54495a 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
@@ -123,7 +123,7 @@ nouveau_therm_alarm(struct nouveau_alarm *alarm)
nouveau_therm_update(&priv->base, -1);
}
-static int
+int
nouveau_therm_mode(struct nouveau_therm *therm, int mode)
{
struct nouveau_therm_priv *priv = (void *)therm;
@@ -212,27 +212,35 @@ nouveau_therm_attr_set(struct nouveau_therm *therm,
return nouveau_therm_mode(therm, value);
case NOUVEAU_THERM_ATTR_THRS_FAN_BOOST:
priv->bios_sensor.thrs_fan_boost.temp = value;
+ priv->sensor.program_alarms(therm);
return 0;
case NOUVEAU_THERM_ATTR_THRS_FAN_BOOST_HYST:
priv->bios_sensor.thrs_fan_boost.hysteresis = value;
+ priv->sensor.program_alarms(therm);
return 0;
case NOUVEAU_THERM_ATTR_THRS_DOWN_CLK:
priv->bios_sensor.thrs_down_clock.temp = value;
+ priv->sensor.program_alarms(therm);
return 0;
case NOUVEAU_THERM_ATTR_THRS_DOWN_CLK_HYST:
priv->bios_sensor.thrs_down_clock.hysteresis = value;
+ priv->sensor.program_alarms(therm);
return 0;
case NOUVEAU_THERM_ATTR_THRS_CRITICAL:
priv->bios_sensor.thrs_critical.temp = value;
+ priv->sensor.program_alarms(therm);
return 0;
case NOUVEAU_THERM_ATTR_THRS_CRITICAL_HYST:
priv->bios_sensor.thrs_critical.hysteresis = value;
+ priv->sensor.program_alarms(therm);
return 0;
case NOUVEAU_THERM_ATTR_THRS_SHUTDOWN:
priv->bios_sensor.thrs_shutdown.temp = value;
+ priv->sensor.program_alarms(therm);
return 0;
case NOUVEAU_THERM_ATTR_THRS_SHUTDOWN_HYST:
priv->bios_sensor.thrs_shutdown.hysteresis = value;
+ priv->sensor.program_alarms(therm);
return 0;
}
@@ -253,6 +261,7 @@ _nouveau_therm_init(struct nouveau_object *object)
if (priv->fan->percent >= 0)
therm->fan_set(therm, priv->fan->percent);
+ priv->sensor.program_alarms(therm);
return 0;
}