drm/nouveau/clk: Respect voltage limits in nvkm_cstate_prog
authorKarol Herbst <karolherbst@gmail.com>
Sat, 16 Jul 2016 13:26:25 +0000 (15:26 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 12 Oct 2016 07:29:24 +0000 (17:29 +1000)
commit1f7f3d91ad38afc706f838fb5a642b21d28e4485
tree2e9b734e2d52c66b5d91687416d6d6db2c01fc1e
parent0d6f81003e9ecc2d6552be92d3d894c916097552
drm/nouveau/clk: Respect voltage limits in nvkm_cstate_prog

We should never allow to select a cstate which current voltage (depending
on the temperature) is higher than

1. the max volt entries in the voltage map table.
2. what tha gpu actually can volt to.

v3: Use find_best for all cstates before actually trying.
    Add nvkm_cstate_get function to get cstate by index.
v5: Cstates with voltages lower then min_uv are valid.
    Move nvkm_cstate_get into the previous commit.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c