aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_pm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-06-09 02:57:07 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 02:01:14 -0400
commit3b5565ddfd8fe71f6470a5d240a6bb50ba90d4ff (patch)
tree2ff079e372de919ebc486fad11e528391ac134fb /drivers/gpu/drm/nouveau/nouveau_pm.c
parenta31214ef3e6cf427afe76b54c67e11c92d2aaeb8 (diff)
drm/nouveau/pm: add support for parsing perflvl voltage on fermi chips
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_pm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_pm.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index f5703ef68518..cab576b2f15e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -64,11 +64,11 @@ nouveau_pm_perflvl_set(struct drm_device *dev, struct nouveau_pm_level *perflvl)
64 if (perflvl == pm->cur) 64 if (perflvl == pm->cur)
65 return 0; 65 return 0;
66 66
67 if (pm->voltage.supported && pm->voltage_set && perflvl->voltage) { 67 if (pm->voltage.supported && pm->voltage_set && perflvl->volt_min) {
68 ret = pm->voltage_set(dev, perflvl->voltage); 68 ret = pm->voltage_set(dev, perflvl->volt_min);
69 if (ret) { 69 if (ret) {
70 NV_ERROR(dev, "voltage_set %d failed: %d\n", 70 NV_ERROR(dev, "voltage_set %d failed: %d\n",
71 perflvl->voltage, ret); 71 perflvl->volt_min, ret);
72 } 72 }
73 } 73 }
74 74
@@ -146,8 +146,10 @@ nouveau_pm_perflvl_get(struct drm_device *dev, struct nouveau_pm_level *perflvl)
146 146
147 if (pm->voltage.supported && pm->voltage_get) { 147 if (pm->voltage.supported && pm->voltage_get) {
148 ret = pm->voltage_get(dev); 148 ret = pm->voltage_get(dev);
149 if (ret > 0) 149 if (ret > 0) {
150 perflvl->voltage = ret; 150 perflvl->volt_min = ret;
151 perflvl->volt_max = ret;
152 }
151 } 153 }
152 154
153 return 0; 155 return 0;
@@ -156,7 +158,7 @@ nouveau_pm_perflvl_get(struct drm_device *dev, struct nouveau_pm_level *perflvl)
156static void 158static void
157nouveau_pm_perflvl_info(struct nouveau_pm_level *perflvl, char *ptr, int len) 159nouveau_pm_perflvl_info(struct nouveau_pm_level *perflvl, char *ptr, int len)
158{ 160{
159 char c[16], s[16], v[16], f[16], t[16]; 161 char c[16], s[16], v[32], f[16], t[16];
160 162
161 c[0] = '\0'; 163 c[0] = '\0';
162 if (perflvl->core) 164 if (perflvl->core)
@@ -167,8 +169,14 @@ nouveau_pm_perflvl_info(struct nouveau_pm_level *perflvl, char *ptr, int len)
167 snprintf(s, sizeof(s), " shader %dMHz", perflvl->shader / 1000); 169 snprintf(s, sizeof(s), " shader %dMHz", perflvl->shader / 1000);
168 170
169 v[0] = '\0'; 171 v[0] = '\0';
170 if (perflvl->voltage) 172 if (perflvl->volt_min && perflvl->volt_min != perflvl->volt_max) {
171 snprintf(v, sizeof(v), " voltage %dmV", perflvl->voltage / 1000); 173 snprintf(v, sizeof(v), " voltage %dmV-%dmV",
174 perflvl->volt_min / 1000, perflvl->volt_max / 1000);
175 } else
176 if (perflvl->volt_min) {
177 snprintf(v, sizeof(v), " voltage %dmV",
178 perflvl->volt_min / 1000);
179 }
172 180
173 f[0] = '\0'; 181 f[0] = '\0';
174 if (perflvl->fanspeed) 182 if (perflvl->fanspeed)