summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
diff options
context:
space:
mode:
authorKarol Herbst <karolherbst@gmail.com>2016-07-12 21:36:08 +0200
committerBen Skeggs <bskeggs@redhat.com>2016-10-12 17:29:21 +1000
commitfa6c4d8e2c614817c956a4ab59ab8bb24fb3653f (patch)
tree2fb3a30b8fe890265cda50cb69ab1a52eb4f5019 /drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
parent4a4555a7f1dd60fe34336f440ff1de73313820ee (diff)
downloadlinux-fa6c4d8e2c614817c956a4ab59ab8bb24fb3653f.tar.bz2
drm/nouveau/volt: Add min_id parameter to nvkm_volt_set_id
Each pstate has its own voltage map entry like each cstate has. The voltages of those entries act as a floor value for the currently selected pstate and nvidia never sets a voltage below them. Signed-off-by: Karol Herbst <karolherbst@gmail.com> Reviewed-by: Martin Peres <martin.peres@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
index 2881b2ceda32..9ee24ec2869b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
@@ -99,7 +99,8 @@ nvkm_cstate_prog(struct nvkm_clk *clk, struct nvkm_pstate *pstate, int cstatei)
}
if (volt) {
- ret = nvkm_volt_set_id(volt, cstate->voltage, +1);
+ ret = nvkm_volt_set_id(volt, cstate->voltage,
+ pstate->base.voltage, +1);
if (ret && ret != -ENODEV) {
nvkm_error(subdev, "failed to raise voltage: %d\n", ret);
return ret;
@@ -113,7 +114,8 @@ nvkm_cstate_prog(struct nvkm_clk *clk, struct nvkm_pstate *pstate, int cstatei)
}
if (volt) {
- ret = nvkm_volt_set_id(volt, cstate->voltage, -1);
+ ret = nvkm_volt_set_id(volt, cstate->voltage,
+ pstate->base.voltage, -1);
if (ret && ret != -ENODEV)
nvkm_error(subdev, "failed to lower voltage: %d\n", ret);
}