diff options
| author | Martin Peres <martin.peres@labri.fr> | 2013-03-05 04:44:12 -0500 |
|---|---|---|
| committer | Ben Skeggs <bskeggs@redhat.com> | 2013-03-17 21:15:26 -0400 |
| commit | 7591782b9f30a5a8bcbba5744c85050ff6743d69 (patch) | |
| tree | cb88aed87c850e843391aea2ec63f58388e1398b | |
| parent | eea4eb14a0f74f806e7a458f174f880744a68bdd (diff) | |
drm/nouveau/therm: do not make assumptions on temperature
In nouveau_therm_sensor_event, temperature is stored as an uint8_t
even though the original interface returns an int.
This change should make it more obvious when the sensor is either
very-ill-calibrated or when we selected the wrong sensor style
on the nv40 family.
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/therm/temp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c b/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c index b37624af8297..0a17b9588e09 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c | |||
| @@ -106,16 +106,16 @@ void nouveau_therm_sensor_event(struct nouveau_therm *therm, | |||
| 106 | const char *thresolds[] = { | 106 | const char *thresolds[] = { |
| 107 | "fanboost", "downclock", "critical", "shutdown" | 107 | "fanboost", "downclock", "critical", "shutdown" |
| 108 | }; | 108 | }; |
| 109 | uint8_t temperature = therm->temp_get(therm); | 109 | int temperature = therm->temp_get(therm); |
| 110 | 110 | ||
| 111 | if (thrs < 0 || thrs > 3) | 111 | if (thrs < 0 || thrs > 3) |
| 112 | return; | 112 | return; |
| 113 | 113 | ||
| 114 | if (dir == NOUVEAU_THERM_THRS_FALLING) | 114 | if (dir == NOUVEAU_THERM_THRS_FALLING) |
| 115 | nv_info(therm, "temperature (%u C) went below the '%s' threshold\n", | 115 | nv_info(therm, "temperature (%i C) went below the '%s' threshold\n", |
| 116 | temperature, thresolds[thrs]); | 116 | temperature, thresolds[thrs]); |
| 117 | else | 117 | else |
| 118 | nv_info(therm, "temperature (%u C) hit the '%s' threshold\n", | 118 | nv_info(therm, "temperature (%i C) hit the '%s' threshold\n", |
| 119 | temperature, thresolds[thrs]); | 119 | temperature, thresolds[thrs]); |
| 120 | 120 | ||
| 121 | active = (dir == NOUVEAU_THERM_THRS_RISING); | 121 | active = (dir == NOUVEAU_THERM_THRS_RISING); |
