[v3,01/29] bios/volt: handle voltage table version 0x50 with 0ed header

Submitted by Karol Herbst on April 7, 2016, 9:23 p.m.


Message ID 1460064259-1243-2-git-send-email-nouveau@karolherbst.de
State New
Headers show
Series "Volting/Clocking improvements for Fermi and newer" ( rev: 3 ) in Nouveau

Not browsing as part of any series.

Commit Message

Karol Herbst April 7, 2016, 9:23 p.m.
Some Fermi+ gpus have no usefull header in the voltage table, which means
nouveau has to read the voltages out of the entries directly.

The mask may be bigger than 0x1fffff, but this value is already >2V, so it will
be fine for now.

This patch fixes volting issues on those cards enabling them to switch cstates.

Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Tested-by: Pierre Moreau <pierre.morrow@free.fr>
 drm/nouveau/nvkm/subdev/bios/volt.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drm/nouveau/nvkm/subdev/bios/volt.c b/drm/nouveau/nvkm/subdev/bios/volt.c
index 6e0a336..81a47b2 100644
--- a/drm/nouveau/nvkm/subdev/bios/volt.c
+++ b/drm/nouveau/nvkm/subdev/bios/volt.c
@@ -142,7 +142,10 @@  nvbios_volt_entry_parse(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len,
 		info->vid     = nvbios_rd08(bios, volt + 0x01) >> 2;
 	case 0x40:
+		break;
 	case 0x50:
+		info->voltage = nvbios_rd32(bios, volt) & 0x001fffff;
+		info->vid     = (nvbios_rd32(bios, volt) >> 23) & 0xff;
 	return volt;