drm/radeon: Fix usage of vga_pci_map_bios()
vga_pci_(un)map_bios() takes a vgapci device as argument, not a drmn one. This fixes a bug where the BIOS couldn't be mapped if the device wasn't the boot display. Approved by: re (kib; blanket for following drm2/radeon commits)
This commit is contained in:
parent
a38326da80
commit
f4bb978a66
@ -100,14 +100,16 @@ static bool igp_read_bios_from_vram(struct radeon_device *rdev)
|
||||
|
||||
static bool radeon_read_bios(struct radeon_device *rdev)
|
||||
{
|
||||
device_t vga_dev;
|
||||
uint8_t __iomem *bios;
|
||||
size_t size;
|
||||
|
||||
DRM_INFO("%s: ===> Try PCI Expansion ROM...\n", __func__);
|
||||
|
||||
vga_dev = device_get_parent(rdev->dev);
|
||||
rdev->bios = NULL;
|
||||
/* XXX: some cards may return 0 for rom size? ddx has a workaround */
|
||||
bios = vga_pci_map_bios(rdev->dev, &size);
|
||||
bios = vga_pci_map_bios(vga_dev, &size);
|
||||
if (!bios) {
|
||||
return false;
|
||||
}
|
||||
@ -120,11 +122,11 @@ static bool radeon_read_bios(struct radeon_device *rdev)
|
||||
DRM_INFO("%s: Incorrect BIOS signature: 0x%02X%02X\n",
|
||||
__func__, bios[0], bios[1]);
|
||||
}
|
||||
vga_pci_unmap_bios(rdev->dev, bios);
|
||||
vga_pci_unmap_bios(vga_dev, bios);
|
||||
}
|
||||
rdev->bios = malloc(size, DRM_MEM_DRIVER, M_WAITOK);
|
||||
memcpy(rdev->bios, bios, size);
|
||||
vga_pci_unmap_bios(rdev->dev, bios);
|
||||
vga_pci_unmap_bios(vga_dev, bios);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user