diff options
author | Karol Herbst <nouveau@karolherbst.de> | 2015-09-15 19:47:12 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-01-11 04:30:22 +0300 |
commit | c6e2f9bc0367c0e5c734bf8b3ab1ee097977f1e2 (patch) | |
tree | 8a79e7bf6457431b306f9a14deae46261138e75b /drivers/gpu/drm/nouveau/nvkm/subdev | |
parent | 3aba825ffa6615971bb5feae57806288c14d4096 (diff) | |
download | linux-c6e2f9bc0367c0e5c734bf8b3ab1ee097977f1e2.tar.xz |
drm/nouveau/bios/perf: parse the pci speed from the bios for tesla and newer cards
Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c index aa7e33b42b30..636bfb665bb9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c @@ -24,6 +24,7 @@ #include <subdev/bios.h> #include <subdev/bios/bit.h> #include <subdev/bios/perf.h> +#include <subdev/pci.h> u16 nvbios_perf_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, @@ -145,6 +146,21 @@ 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: + info->pcie_speed = NVKM_PCIE_SPEED_2_5; + break; + case 2: + info->pcie_speed = NVKM_PCIE_SPEED_8_0; + break; + default: + break; + } + info->pcie_width = 0xff; break; default: return 0x0000; |