diff options
author | Wei Ni <wni@nvidia.com> | 2015-06-16 11:35:12 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 04:40:01 +0200 |
commit | 85fa319d8a5240bab2e4123cfc9178bff55694ca (patch) | |
tree | 1ccd341e0da1706d61c6f3a7037981de30c0bad7 /drivers/gpu/drm/nouveau/nvkm/subdev/clk | |
parent | drm/nouveau/pm: some fixes related to sources (diff) | |
download | linux-85fa319d8a5240bab2e4123cfc9178bff55694ca.tar.xz linux-85fa319d8a5240bab2e4123cfc9178bff55694ca.zip |
drm/nouveau/drm/nouveau/clk: fix tstate to pstate calculation
According to the tstate calculation in nvkm_clk_tstate(),
the range of tstate is from -(clk->state_nr - 1) to 0,
it mean the tstate is negative value. But in nvkm_pstate_work(),
it use (clk->state_nr - 1 - clk->tstate) to limit pstate,
it's not correct.
This patch fix it to use (clk->state_nr - 1 + clk->tstate) to
limit pstate.
Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/clk')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c index 39a83d82e0cd..77a0ab5ca3b0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c @@ -214,7 +214,7 @@ nvkm_pstate_work(struct work_struct *work) pstate = clk->pwrsrc ? clk->ustate_ac : clk->ustate_dc; if (clk->state_nr && pstate != -1) { pstate = (pstate < 0) ? clk->astate : pstate; - pstate = min(pstate, clk->state_nr - 1 - clk->tstate); + pstate = min(pstate, clk->state_nr - 1 + clk->tstate); pstate = max(pstate, clk->dstate); } else { pstate = clk->pstate = -1; |