Skip to content

Commit 5d2f476

Browse files
imirkinBen Skeggs
authored andcommitted
drm/nouveau/bios: fix offset calculation for BMPv1 bioses
The only BIOS on record that needs the 14 offset has a bios major version 2 but BMP version 1.01. Another bunch of BIOSes that need the 18 offset have BMP version 2.01 or 5.01 or higher. So instead of looking at the bios major version, look at the BMP version. BIOSes with BMP version 0 do not contain a detectable script, so always return 0 for them. See https://bugs.freedesktop.org/show_bug.cgi?id=68835 Reported-by: Mauro Molinari <mauromol@tiscali.it> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1 parent c1ccaa6 commit 5d2f476

File tree

1 file changed

+4
-4
lines changed
  • drivers/gpu/drm/nouveau/core/subdev/bios

1 file changed

+4
-4
lines changed

drivers/gpu/drm/nouveau/core/subdev/bios/init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,13 @@ static u16
365365
init_script(struct nouveau_bios *bios, int index)
366366
{
367367
struct nvbios_init init = { .bios = bios };
368-
u16 data;
368+
u16 bmp_ver = bmp_version(bios), data;
369369

370-
if (bmp_version(bios) && bmp_version(bios) < 0x0510) {
371-
if (index > 1)
370+
if (bmp_ver && bmp_ver < 0x0510) {
371+
if (index > 1 || bmp_ver < 0x0100)
372372
return 0x0000;
373373

374-
data = bios->bmp_offset + (bios->version.major < 2 ? 14 : 18);
374+
data = bios->bmp_offset + (bmp_ver < 0x0200 ? 14 : 18);
375375
return nv_ro16(bios, data + (index * 2));
376376
}
377377

0 commit comments

Comments
 (0)