drm/nouveau/bios: use NPDE to locate images beyond those defined by PCIR
authorBen Skeggs <bskeggs@redhat.com>
Mon, 22 Sep 2014 01:21:57 +0000 (11:21 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 2 Dec 2014 05:43:41 +0000 (15:43 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/bios/image.c

index dd8fd2f4263b45acf521e207aba5085a36ee3024..df85cc6d0fc7ee36ae2cf066ea31434a197c2b38 100644 (file)
 #include <subdev/bios.h>
 #include <subdev/bios/image.h>
 #include <subdev/bios/pcir.h>
+#include <subdev/bios/npde.h>
 
 static bool
 nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image)
 {
        struct nvbios_pcirT pcir;
+       struct nvbios_npdeT npde;
        u8  ver;
        u16 hdr;
        u32 data;
@@ -48,6 +50,11 @@ nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image)
        image->size = pcir.image_size;
        image->type = pcir.image_type;
        image->last = pcir.last;
+
+       if (!(data = nvbios_npdeTp(bios, image->base, &npde)))
+               return true;
+       image->size = npde.image_size;
+       image->last = npde.last;
        return true;
 }