diff options
author | Martin Peres <martin.peres@ensi-bourges.fr> | 2011-11-02 19:03:06 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-03-13 03:06:19 -0400 |
commit | b0103747094b62231fc951dfaca4897f67670874 (patch) | |
tree | 64f310267a466acbf20c11336ad64cb2e9c7c3fc /drivers/gpu/drm/nouveau/nouveau_pm.c | |
parent | b1aa5531cc74ea023ad35e9cf5872112a15b4f70 (diff) |
drm/nouveau/pm: improve the reclocking logs' readability
Signed-off-by: Martin Peres <martin.peres@labri.fr>
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.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index 5ee5ca6166aa..08c563dfa28e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c | |||
@@ -147,9 +147,13 @@ nouveau_pm_perflvl_set(struct drm_device *dev, struct nouveau_pm_level *perflvl) | |||
147 | return ret; | 147 | return ret; |
148 | 148 | ||
149 | state = pm->clocks_pre(dev, perflvl); | 149 | state = pm->clocks_pre(dev, perflvl); |
150 | if (IS_ERR(state)) | 150 | if (IS_ERR(state)) { |
151 | return PTR_ERR(state); | 151 | ret = PTR_ERR(state); |
152 | pm->clocks_set(dev, state); | 152 | goto error; |
153 | } | ||
154 | ret = pm->clocks_set(dev, state); | ||
155 | if (ret) | ||
156 | goto error; | ||
153 | 157 | ||
154 | ret = nouveau_pm_perflvl_aux(dev, perflvl, perflvl, pm->cur); | 158 | ret = nouveau_pm_perflvl_aux(dev, perflvl, perflvl, pm->cur); |
155 | if (ret) | 159 | if (ret) |
@@ -157,6 +161,11 @@ nouveau_pm_perflvl_set(struct drm_device *dev, struct nouveau_pm_level *perflvl) | |||
157 | 161 | ||
158 | pm->cur = perflvl; | 162 | pm->cur = perflvl; |
159 | return 0; | 163 | return 0; |
164 | |||
165 | error: | ||
166 | /* restore the fan speed and voltage before leaving */ | ||
167 | nouveau_pm_perflvl_aux(dev, perflvl, perflvl, pm->cur); | ||
168 | return ret; | ||
160 | } | 169 | } |
161 | 170 | ||
162 | static int | 171 | static int |
@@ -165,6 +174,8 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile) | |||
165 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 174 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
166 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; | 175 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; |
167 | struct nouveau_pm_level *perflvl = NULL; | 176 | struct nouveau_pm_level *perflvl = NULL; |
177 | u64 start_time; | ||
178 | int ret = 0; | ||
168 | long pl; | 179 | long pl; |
169 | 180 | ||
170 | /* safety precaution, for now */ | 181 | /* safety precaution, for now */ |
@@ -189,8 +200,17 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile) | |||
189 | return -EINVAL; | 200 | return -EINVAL; |
190 | } | 201 | } |
191 | 202 | ||
192 | NV_INFO(dev, "setting performance level: %s\n", profile); | 203 | NV_INFO(dev, "setting performance level: %s", profile); |
193 | return nouveau_pm_perflvl_set(dev, perflvl); | 204 | start_time = nv04_timer_read(dev); |
205 | ret = nouveau_pm_perflvl_set(dev, perflvl); | ||
206 | if (!ret) { | ||
207 | NV_INFO(dev, "> reclocking took %lluns\n\n", | ||
208 | (nv04_timer_read(dev) - start_time)); | ||
209 | } else { | ||
210 | NV_INFO(dev, "> reclocking failed\n\n"); | ||
211 | } | ||
212 | |||
213 | return ret; | ||
194 | } | 214 | } |
195 | 215 | ||
196 | static int | 216 | static int |