Skip to content

Commit

Permalink
drm/nouveau/bios: attempt to fetch entire acpi rom image in one shot
Browse files Browse the repository at this point in the history
v2: fdo#55948 - the _ROM method silently truncates size to 4KiB, perform
    a checksum test and fall back to slow _ROM access on failure.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Nov 28, 2012
1 parent 28164fd commit de2b8b8
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/bios/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,19 @@ nouveau_bios_shadow_acpi(struct nouveau_bios *bios)
return;

bios->data = kmalloc(bios->size, GFP_KERNEL);
for (i = 0; bios->data && i < bios->size; i += cnt) {
cnt = min((bios->size - i), (u32)4096);
ret = nouveau_acpi_get_bios_chunk(bios->data, i, cnt);
if (ret != cnt)
break;
if (bios->data) {
/* disobey the acpi spec - much faster on at least w530 ... */
ret = nouveau_acpi_get_bios_chunk(bios->data, 0, bios->size);
if (ret != bios->size ||
nvbios_checksum(bios->data, bios->size)) {
/* ... that didn't work, ok, i'll be good now */
for (i = 0; i < bios->size; i += cnt) {
cnt = min((bios->size - i), (u32)4096);
ret = nouveau_acpi_get_bios_chunk(bios->data, i, cnt);
if (ret != cnt)
break;
}
}
}
}

Expand Down

0 comments on commit de2b8b8

Please sign in to comment.