Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293731
b: refs/heads/master
c: b010374
h: refs/heads/master
i:
  293729: 8a66fc4
  293727: 98b9991
v: v3
  • Loading branch information
Martin Peres authored and Ben Skeggs committed Mar 13, 2012
1 parent 4e6a439 commit 23c31b8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 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: b1aa5531cc74ea023ad35e9cf5872112a15b4f70
refs/heads/master: b0103747094b62231fc951dfaca4897f67670874
30 changes: 25 additions & 5 deletions trunk/drivers/gpu/drm/nouveau/nouveau_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,25 @@ nouveau_pm_perflvl_set(struct drm_device *dev, struct nouveau_pm_level *perflvl)
return ret;

state = pm->clocks_pre(dev, perflvl);
if (IS_ERR(state))
return PTR_ERR(state);
pm->clocks_set(dev, state);
if (IS_ERR(state)) {
ret = PTR_ERR(state);
goto error;
}
ret = pm->clocks_set(dev, state);
if (ret)
goto error;

ret = nouveau_pm_perflvl_aux(dev, perflvl, perflvl, pm->cur);
if (ret)
return ret;

pm->cur = perflvl;
return 0;

error:
/* restore the fan speed and voltage before leaving */
nouveau_pm_perflvl_aux(dev, perflvl, perflvl, pm->cur);
return ret;
}

static int
Expand All @@ -165,6 +174,8 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile)
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_pm_engine *pm = &dev_priv->engine.pm;
struct nouveau_pm_level *perflvl = NULL;
u64 start_time;
int ret = 0;
long pl;

/* safety precaution, for now */
Expand All @@ -189,8 +200,17 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile)
return -EINVAL;
}

NV_INFO(dev, "setting performance level: %s\n", profile);
return nouveau_pm_perflvl_set(dev, perflvl);
NV_INFO(dev, "setting performance level: %s", profile);
start_time = nv04_timer_read(dev);
ret = nouveau_pm_perflvl_set(dev, perflvl);
if (!ret) {
NV_INFO(dev, "> reclocking took %lluns\n\n",
(nv04_timer_read(dev) - start_time));
} else {
NV_INFO(dev, "> reclocking failed\n\n");
}

return ret;
}

static int
Expand Down

0 comments on commit 23c31b8

Please sign in to comment.