Skip to content

Commit f706037

Browse files
karolherbstBen Skeggs
authored andcommitted
drm/nouveau/bios/vpstate: There are some fermi vbios with no boost or tdp entry
If the entry size is too small, default to invalid values for both boost_id and tdp_id, so as to default to the base clock in both cases. Signed-off-by: Karol Herbst <karolherbst@gmail.com> Signed-off-by: Martin Peres <martin.peres@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1 parent 2ae4c5f commit f706037

File tree

1 file changed

+8
-2
lines changed
  • drivers/gpu/drm/nouveau/nvkm/subdev/bios

1 file changed

+8
-2
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/bios/vpstate.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ nvbios_vpstate_parse(struct nvkm_bios *b, struct nvbios_vpstate_header *h)
5858
h->ecount = nvbios_rd08(b, h->offset + 0x5);
5959

6060
h->base_id = nvbios_rd08(b, h->offset + 0x0f);
61-
h->boost_id = nvbios_rd08(b, h->offset + 0x10);
62-
h->tdp_id = nvbios_rd08(b, h->offset + 0x11);
61+
if (h->hlen > 0x10)
62+
h->boost_id = nvbios_rd08(b, h->offset + 0x10);
63+
else
64+
h->boost_id = 0xff;
65+
if (h->hlen > 0x11)
66+
h->tdp_id = nvbios_rd08(b, h->offset + 0x11);
67+
else
68+
h->tdp_id = 0xff;
6369
return 0;
6470
default:
6571
return -EINVAL;

0 commit comments

Comments
 (0)