From: Ben Skeggs Date: Mon, 22 Sep 2014 00:51:37 +0000 (+1000) Subject: drm/nouveau/bios: use size/type from pci data structure X-Git-Tag: v3.19-rc4~12^2~2^2~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7af4dec166d22f0b4fe30649fc5263a91126c64d;p=platform%2Fkernel%2Flinux-exynos.git 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: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/image.c b/drivers/gpu/drm/nouveau/core/subdev/bios/image.c index 4b2120b..64ed641 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/image.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/image.c @@ -24,10 +24,14 @@ #include #include +#include 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; }