if (screen_info_lfb_pdev) { struct resource *pr = &screen_info_lfb_pdev->resource[screen_info_lfb_bar];
if (pr->start != screen_info_lfb_res_start) { if (__screen_info_relocation_is_valid(si, pr)) { /* * Only update base if we have an actual * relocation to a valid I/O range.
*/
__screen_info_set_lfb_base(si, pr->start + screen_info_lfb_offset);
pr_info("Relocating firmware framebuffer to offset %pa[d] within %pr\n",
&screen_info_lfb_offset, pr);
} else {
pr_warn("Invalid relocating, disabling firmware framebuffer\n");
}
}
}
}
if (screen_info_lfb_pdev) return; // already found
type = screen_info_video_type(si); if (!__screen_info_has_lfb(type)) return; // only applies to EFI; maybe VESA
ret = __screen_info_lfb_pci_bus_region(si, type, &bus_region); if (ret < 0) return;
/* * Translate the PCI bus address to resource. Account * for an offset if the framebuffer is behind a PCI host * bridge.
*/
pcibios_bus_to_resource(pdev->bus, &r, &bus_region);
pr = pci_find_resource(pdev, &r); if (!pr) return;
/* * We've found a PCI device with the framebuffer * resource. Store away the parameters to track * relocation of the framebuffer aperture.
*/
screen_info_lfb_pdev = pdev;
screen_info_lfb_bar = pr - pdev->resource;
screen_info_lfb_offset = r.start - pr->start;
screen_info_lfb_res_start = bus_region.start;
}
DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY, 16,
screen_info_fixup_lfb);
while (!r && (pdev = pci_get_base_class(PCI_BASE_CLASS_DISPLAY, pdev))) {
r = pci_find_resource(pdev, res);
}
return pdev;
}
/** * screen_info_pci_dev() - Return PCI parent device that contains screen_info's framebuffer * @si: the screen_info * * Returns: * The screen_info's parent device or NULL on success, or a pointer-encoded * errno value otherwise. The value NULL is not an error. It signals that no * PCI device has been found.
*/ struct pci_dev *screen_info_pci_dev(conststruct screen_info *si)
{ struct resource res[SCREEN_INFO_MAX_RESOURCES];
ssize_t i, numres;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.