Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7af4dec1 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/bios: use size/type from pci data structure



The field at +0x2 is technically processor specific, though I don't know
that it's ever mattered in practice (yet).

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 8d85e06b
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -24,10 +24,14 @@

#include <subdev/bios.h>
#include <subdev/bios/image.h>
#include <subdev/bios/pcir.h>

static bool
nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image)
{
	struct nvbios_pcirT pcir;
	u8  ver;
	u16 hdr;
	u32 data;

	switch ((data = nv_ro16(bios, image->base + 0x00))) {
@@ -39,8 +43,10 @@ nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image)
		return false;
	}

	image->size = nv_ro08(bios, image->base + 0x02) * 512;
	image->type = 0x00;
	if (!(data = nvbios_pcirTp(bios, image->base, &ver, &hdr, &pcir)))
		return false;
	image->size = pcir.image_size;
	image->type = pcir.image_type;
	image->last = true;
	return true;
}