aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2014-01-07 12:33:59 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-06 14:08:12 -0500
commit366d6b206f19ebe663503dbb58c2d05ab5f1b3f4 (patch)
tree6d91560ae5aedb7e6ff618d3f742248246bf9cc7 /drivers/gpu
parent6ba854e9bf9aa4a481038cf20ccbb878cacb8418 (diff)
drm/nouveau/bios: fix offset calculation for BMPv1 bioses
commit 5d2f4767c4eacab351b8450b0de4d3261fe1a957 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/bios/init.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
index 3044b07230db..c7bf974ed4a6 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
@@ -366,13 +366,13 @@ static u16
366init_script(struct nouveau_bios *bios, int index) 366init_script(struct nouveau_bios *bios, int index)
367{ 367{
368 struct nvbios_init init = { .bios = bios }; 368 struct nvbios_init init = { .bios = bios };
369 u16 data; 369 u16 bmp_ver = bmp_version(bios), data;
370 370
371 if (bmp_version(bios) && bmp_version(bios) < 0x0510) { 371 if (bmp_ver && bmp_ver < 0x0510) {
372 if (index > 1) 372 if (index > 1 || bmp_ver < 0x0100)
373 return 0x0000; 373 return 0x0000;
374 374
375 data = bios->bmp_offset + (bios->version.major < 2 ? 14 : 18); 375 data = bios->bmp_offset + (bmp_ver < 0x0200 ? 14 : 18);
376 return nv_ro16(bios, data + (index * 2)); 376 return nv_ro16(bios, data + (index * 2));
377 } 377 }
378 378