]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/drm/nouveau/clk: fix tstate to pstate calculation
authorWei Ni <wni@nvidia.com>
Tue, 16 Jun 2015 09:35:12 +0000 (17:35 +0800)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 28 Aug 2015 02:40:01 +0000 (12:40 +1000)
commit425315303ec3172e3c1aedb620887d6875cea032
tree1ccd341e0da1706d61c6f3a7037981de30c0bad7
parent15f1c6f57fa46b7de892587561a79b44b7dd47af
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>
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c