aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h6
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_temp.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index d610edb044c4..72bfc143eb47 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -461,9 +461,9 @@ struct nouveau_pm_level {
461struct nouveau_pm_temp_sensor_constants { 461struct nouveau_pm_temp_sensor_constants {
462 u16 offset_constant; 462 u16 offset_constant;
463 s16 offset_mult; 463 s16 offset_mult;
464 u16 offset_div; 464 s16 offset_div;
465 u16 slope_mult; 465 s16 slope_mult;
466 u16 slope_div; 466 s16 slope_div;
467}; 467};
468 468
469struct nouveau_pm_threshold_temp { 469struct nouveau_pm_threshold_temp {
diff --git a/drivers/gpu/drm/nouveau/nouveau_temp.c b/drivers/gpu/drm/nouveau/nouveau_temp.c
index 649b0413b09f..47630fb669d0 100644
--- a/drivers/gpu/drm/nouveau/nouveau_temp.c
+++ b/drivers/gpu/drm/nouveau/nouveau_temp.c
@@ -43,7 +43,7 @@ nouveau_temp_vbios_parse(struct drm_device *dev, u8 *temp)
43 43
44 /* Set the default sensor's contants */ 44 /* Set the default sensor's contants */
45 sensor->offset_constant = 0; 45 sensor->offset_constant = 0;
46 sensor->offset_mult = 1; 46 sensor->offset_mult = 0;
47 sensor->offset_div = 1; 47 sensor->offset_div = 1;
48 sensor->slope_mult = 1; 48 sensor->slope_mult = 1;
49 sensor->slope_div = 1; 49 sensor->slope_div = 1;
@@ -109,7 +109,7 @@ nouveau_temp_vbios_parse(struct drm_device *dev, u8 *temp)
109 109
110 /* Read the entries from the table */ 110 /* Read the entries from the table */
111 for (i = 0; i < entries; i++) { 111 for (i = 0; i < entries; i++) {
112 u16 value = ROM16(temp[1]); 112 s16 value = ROM16(temp[1]);
113 113
114 switch (temp[0]) { 114 switch (temp[0]) {
115 case 0x01: 115 case 0x01:
@@ -160,8 +160,8 @@ nv40_sensor_setup(struct drm_device *dev)
160 struct drm_nouveau_private *dev_priv = dev->dev_private; 160 struct drm_nouveau_private *dev_priv = dev->dev_private;
161 struct nouveau_pm_engine *pm = &dev_priv->engine.pm; 161 struct nouveau_pm_engine *pm = &dev_priv->engine.pm;
162 struct nouveau_pm_temp_sensor_constants *sensor = &pm->sensor_constants; 162 struct nouveau_pm_temp_sensor_constants *sensor = &pm->sensor_constants;
163 u32 offset = sensor->offset_mult / sensor->offset_div; 163 s32 offset = sensor->offset_mult / sensor->offset_div;
164 u32 sensor_calibration; 164 s32 sensor_calibration;
165 165
166 /* set up the sensors */ 166 /* set up the sensors */
167 sensor_calibration = 120 - offset - sensor->offset_constant; 167 sensor_calibration = 120 - offset - sensor->offset_constant;