diff options
author | Karol Herbst <nouveau@karolherbst.de> | 2016-04-16 21:01:59 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-05-20 07:43:04 +0300 |
commit | d07a97e939cd1e257d833758c43dd5b7ffd7ba44 (patch) | |
tree | 184ebe00f7e427d22c48f1e377d95c9903dbbcbb /drivers | |
parent | e976278ad231dbc44c00729df72cf9fe9a164412 (diff) | |
download | linux-d07a97e939cd1e257d833758c43dd5b7ffd7ba44.tar.xz |
drm/nouveau/volt/gk104: round up in gk104_volt_set
We always want a equal or higher voltage than the requested ones, otherwise
nouveau undervolts.
Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c index b735173a18ff..420bd84d8483 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c @@ -56,7 +56,7 @@ gk104_volt_set(struct nvkm_volt *base, u32 uv) /* the blob uses this crystal frequency, let's use it too. */ div = 27648000 / bios->pwm_freq; - duty = (uv - bios->base) * div / bios->pwm_range; + duty = DIV_ROUND_UP((uv - bios->base) * div, bios->pwm_range); nvkm_wr32(device, 0x20340, div); nvkm_wr32(device, 0x20344, 0x80000000 | duty); |