Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293729
b: refs/heads/master
c: bc6389e
h: refs/heads/master
i:
  293727: 98b9991
v: v3
  • Loading branch information
Martin Peres authored and Ben Skeggs committed Mar 13, 2012
1 parent f97028e commit 8a66fc4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 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: ddb2005516949dc50d117cb8381d7a3f8f0614b0
refs/heads/master: bc6389e4fa1a6535021ffc4d3b37d48f9a0542e2
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/nouveau/nouveau_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ struct nouveau_pm_memtimings {
};

struct nouveau_pm_fan {
u32 percent;
u32 min_duty;
u32 max_duty;
u32 pwm_freq;
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/nouveau_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ nouveau_pwmfan_set(struct drm_device *dev, int percent)
if (dev_priv->card_type <= NV_40 || (gpio.log[0] & 1))
duty = divs - duty;

return pm->pwm_set(dev, gpio.line, divs, duty);
ret = pm->pwm_set(dev, gpio.line, divs, duty);
if (!ret)
pm->fan.percent = percent;
return ret;
}

return -ENODEV;
Expand Down Expand Up @@ -800,6 +803,9 @@ nouveau_pm_init(struct drm_device *dev)
}
}

/* determine the current fan speed */
pm->fan.percent = nouveau_pwmfan_get(dev);

nouveau_sysfs_init(dev);
nouveau_hwmon_init(dev);
#if defined(CONFIG_ACPI) && defined(CONFIG_POWER_SUPPLY)
Expand Down Expand Up @@ -844,4 +850,5 @@ nouveau_pm_resume(struct drm_device *dev)
perflvl = pm->cur;
pm->cur = &pm->boot;
nouveau_pm_perflvl_set(dev, perflvl);
nouveau_pwmfan_set(dev, pm->fan.percent);
}

0 comments on commit 8a66fc4

Please sign in to comment.