Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362294
b: refs/heads/master
c: 06a0857
h: refs/heads/master
v: v3
  • Loading branch information
Matthew Garrett authored and Bjorn Helgaas committed Apr 1, 2013
1 parent c491415 commit 8375989
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 121cdf08cc854bda4892d2c755e32ef424772ac2
refs/heads/master: 06a08570085b3b20c45f45dc66dc46851ecbcb5b
26 changes: 26 additions & 0 deletions trunk/drivers/gpu/drm/radeon/radeon_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,29 @@ static bool radeon_read_bios(struct radeon_device *rdev)
return true;
}

static bool radeon_read_platform_bios(struct radeon_device *rdev)
{
uint8_t __iomem *bios;
size_t size;

rdev->bios = NULL;

bios = pci_platform_rom(rdev->pdev, &size);
if (!bios) {
return false;
}

if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
return false;
}
rdev->bios = kmemdup(bios, size, GFP_KERNEL);
if (rdev->bios == NULL) {
return false;
}

return true;
}

#ifdef CONFIG_ACPI
/* ATRM is used to get the BIOS on the discrete cards in
* dual-gpu systems.
Expand Down Expand Up @@ -620,6 +643,9 @@ bool radeon_get_bios(struct radeon_device *rdev)
if (r == false) {
r = radeon_read_disabled_bios(rdev);
}
if (r == false) {
r = radeon_read_platform_bios(rdev);
}
if (r == false || rdev->bios == NULL) {
DRM_ERROR("Unable to locate a BIOS ROM\n");
rdev->bios = NULL;
Expand Down

0 comments on commit 8375989

Please sign in to comment.