Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361527
b: refs/heads/master
c: ad40d73
h: refs/heads/master
i:
  361525: 1cc7ff4
  361523: 9ff86b3
  361519: 5edb07b
v: v3
  • Loading branch information
Martin Peres authored and Ben Skeggs committed Mar 18, 2013
1 parent 8c1af79 commit fe8a405
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 13506e2ab40ebec3be3e2fda708d40d3ba972e3e
refs/heads/master: ad40d73ef533ab0ad16b4a1ab2f7870c1f8ab954
10 changes: 4 additions & 6 deletions trunk/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,10 @@ nv40_temp_get(struct nouveau_therm *therm)
} else
return -ENODEV;

if (sensor->slope_div == 0)
sensor->slope_div = 1;
if (sensor->offset_den == 0)
sensor->offset_den = 1;
if (sensor->slope_mult < 1)
sensor->slope_mult = 1;
/* if the slope or the offset is unset, do no use the sensor */
if (!sensor->slope_div || !sensor->slope_mult ||
!sensor->offset_num || !sensor->offset_den)
return -ENODEV;

core_temp = core_temp * sensor->slope_mult / sensor->slope_div;
core_temp = core_temp + sensor->offset_num / sensor->offset_den;
Expand Down
9 changes: 0 additions & 9 deletions trunk/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ nouveau_therm_temp_set_defaults(struct nouveau_therm *therm)
{
struct nouveau_therm_priv *priv = (void *)therm;

priv->bios_sensor.slope_mult = 1;
priv->bios_sensor.slope_div = 1;
priv->bios_sensor.offset_num = 0;
priv->bios_sensor.offset_den = 1;
priv->bios_sensor.offset_constant = 0;

priv->bios_sensor.thrs_fan_boost.temp = 90;
Expand All @@ -60,11 +56,6 @@ nouveau_therm_temp_safety_checks(struct nouveau_therm *therm)
struct nouveau_therm_priv *priv = (void *)therm;
struct nvbios_therm_sensor *s = &priv->bios_sensor;

if (!priv->bios_sensor.slope_div)
priv->bios_sensor.slope_div = 1;
if (!priv->bios_sensor.offset_den)
priv->bios_sensor.offset_den = 1;

/* enforce a minimum hysteresis on thresholds */
s->thrs_fan_boost.hysteresis = max_t(u8, s->thrs_fan_boost.hysteresis, 2);
s->thrs_down_clock.hysteresis = max_t(u8, s->thrs_down_clock.hysteresis, 2);
Expand Down

0 comments on commit fe8a405

Please sign in to comment.