Skip to content

Commit

Permalink
drm/nouveau/therm: do not make assumptions on temperature
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Peres authored and Ben Skeggs committed Mar 18, 2013
1 parent eea4eb1 commit 7591782
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/nouveau/core/subdev/therm/temp.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ void nouveau_therm_sensor_event(struct nouveau_therm *therm,
const char *thresolds[] = {
"fanboost", "downclock", "critical", "shutdown"
};
uint8_t temperature = therm->temp_get(therm);
int temperature = therm->temp_get(therm);

if (thrs < 0 || thrs > 3)
return;

if (dir == NOUVEAU_THERM_THRS_FALLING)
nv_info(therm, "temperature (%u C) went below the '%s' threshold\n",
nv_info(therm, "temperature (%i C) went below the '%s' threshold\n",
temperature, thresolds[thrs]);
else
nv_info(therm, "temperature (%u C) hit the '%s' threshold\n",
nv_info(therm, "temperature (%i C) hit the '%s' threshold\n",
temperature, thresolds[thrs]);

active = (dir == NOUVEAU_THERM_THRS_RISING);
Expand Down

0 comments on commit 7591782

Please sign in to comment.