drm/nv40: fix reading temp value

Signed-off-by: Francesco Marella <fmarl@paranoici.org>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
Francesco Marella 2010-09-23 09:14:22 +02:00 committed by Ben Skeggs
parent 5e6a74436e
commit 4164743c82
1 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ nouveau_nv40_sensor_setup(struct drm_device *dev)
msleep(5);
/* read */
return nv_rd32(dev, 0x0015b4);
return nv_rd32(dev, 0x0015b4) & 0x1fff;
}
s16
@ -197,7 +197,7 @@ nouveau_temp_get(struct drm_device *dev)
if (dev_priv->chipset >= 0x50) {
core_temp = nv_rd32(dev, 0x20008);
} else {
core_temp = nv_rd32(dev, 0x0015b4);
core_temp = nv_rd32(dev, 0x0015b4) & 0x1fff;
/* Setup the sensor if the temperature is 0 */
if (core_temp == 0)
core_temp = nouveau_nv40_sensor_setup(dev);