mirror of https://gitee.com/openkylin/linux.git
drm/nouveau/bios/perf: parse the pci speed from the bios for tesla and newer cards
Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
This commit is contained in:
parent
3aba825ffa
commit
c6e2f9bc03
|
@ -13,6 +13,8 @@ struct nvbios_perfE {
|
||||||
u32 vdec;
|
u32 vdec;
|
||||||
u32 disp;
|
u32 disp;
|
||||||
u32 script;
|
u32 script;
|
||||||
|
u8 pcie_speed;
|
||||||
|
u8 pcie_width;
|
||||||
};
|
};
|
||||||
|
|
||||||
u16 nvbios_perf_entry(struct nvkm_bios *, int idx,
|
u16 nvbios_perf_entry(struct nvkm_bios *, int idx,
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <subdev/bios.h>
|
#include <subdev/bios.h>
|
||||||
#include <subdev/bios/bit.h>
|
#include <subdev/bios/bit.h>
|
||||||
#include <subdev/bios/perf.h>
|
#include <subdev/bios/perf.h>
|
||||||
|
#include <subdev/pci.h>
|
||||||
|
|
||||||
u16
|
u16
|
||||||
nvbios_perf_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr,
|
nvbios_perf_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr,
|
||||||
|
@ -145,6 +146,21 @@ nvbios_perfEp(struct nvkm_bios *bios, int idx,
|
||||||
break;
|
break;
|
||||||
case 0x40:
|
case 0x40:
|
||||||
info->voltage = nvbios_rd08(bios, perf + 0x02);
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0x0000;
|
return 0x0000;
|
||||||
|
|
Loading…
Reference in New Issue