Karol Herbst
2017-Apr-05 21:46 UTC
[Nouveau] [PATCH] bios/perf: Correctly parse PCIe speeds for ver 0x40
Signed-off-by: Karol Herbst <karolherbst at gmail.com> --- drm/nouveau/nvkm/subdev/bios/perf.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drm/nouveau/nvkm/subdev/bios/perf.c b/drm/nouveau/nvkm/subdev/bios/perf.c index c3068358..9fdf3736 100644 --- a/drm/nouveau/nvkm/subdev/bios/perf.c +++ b/drm/nouveau/nvkm/subdev/bios/perf.c @@ -146,18 +146,16 @@ nvbios_perfEp(struct nvkm_bios *bios, int idx, break; case 0x40: info->voltage = nvbios_rd08(bios, perf + 0x02); - switch (nvbios_rd08(bios, perf + 0xb) & 0x3) { - case 0: - info->pcie_speed = NVKM_PCIE_SPEED_5_0; - break; - case 3: - case 1: + switch (nvbios_rd08(bios, perf + 0xb) & 0x21) { + case 0x01: info->pcie_speed = NVKM_PCIE_SPEED_2_5; break; - case 2: - info->pcie_speed = NVKM_PCIE_SPEED_8_0; + case 0x20: + info->pcie_speed = NVKM_PCIE_SPEED_5_0; break; + case 0x00: default: + info->pcie_speed = NVKM_PCIE_SPEED_8_0; break; } info->pcie_width = 0xff; -- 2.12.2