drm/nouveau/bios: fetch images beyond the first one in the rom
authorBen Skeggs <bskeggs@redhat.com>
Mon, 22 Sep 2014 01:08:01 +0000 (11:08 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 2 Dec 2014 05:43:40 +0000 (15:43 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/bios/image.c

index 64ed641b82b4dab5ef1f981535115e52d011c76f..dd8fd2f4263b45acf521e207aba5085a36ee3024 100644 (file)
@@ -47,7 +47,7 @@ nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image)
                return false;
        image->size = pcir.image_size;
        image->type = pcir.image_type;
-       image->last = true;
+       image->last = pcir.last;
        return true;
 }
 
@@ -55,7 +55,10 @@ bool
 nvbios_image(struct nouveau_bios *bios, int idx, struct nvbios_image *image)
 {
        memset(image, 0x00, sizeof(*image));
-       if (idx)
-               return false;
-       return nvbios_imagen(bios, image);
+       do {
+               image->base += image->size;
+               if (image->last || !nvbios_imagen(bios, image))
+                       return false;
+       } while(idx--);
+       return true;
 }