GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.kernel.org — Managing Ownership of the Framebuffer Aperture — The Linux Kernel documentation Managing Ownership of the Framebuffer Aperture¶A graphics device might be supported by different drivers, but only one driver can be active at any given time. Many systems load a generic graphics drivers, such as EFI-GOP or VESA, early during the boot process. During later boot stages, they replace the generic driver with a dedicated, hardware-specific driver. To take over the device, the dedicated driver first has to remove the generic driver. Aperture functions manage ownership of framebuffer memory and hand-over between drivers. Graphics drivers should call static int example_probe(struct platform_device *pdev) { struct resource *mem; resource_size_t base, size; int ret; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) return -ENODEV; base = mem->start; size = resource_size(mem); ret = aperture_remove_conflicting_devices(base, size, "example"); if (ret) return ret; // Initialize the hardware ... return 0; } static const struct platform_driver example_driver = { .probe = example_probe, ... }; The given example reads the platform device’s I/O-memory range from the
device instance. An active framebuffer will be located within this range.
The call to While the given example uses a platform device, the aperture helpers work
with every bus that has an addressable framebuffer. In the case of PCI,
device drivers can also call Drivers that are susceptible to being removed by other drivers, such as
generic EFI or VESA drivers, have to register themselves as owners of their
framebuffer apertures. Ownership of the framebuffer memory is achieved
by calling static int generic_probe(struct platform_device *pdev) { struct resource *mem; resource_size_t base, size; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) return -ENODEV; base = mem->start; size = resource_size(mem); ret = devm_aperture_acquire_for_platform_device(pdev, base, size); if (ret) return ret; // Initialize the hardware ... return 0; } static int generic_remove(struct platform_device *) { // Hot-unplug the device ... return 0; } static const struct platform_driver generic_driver = { .probe = generic_probe, .remove = generic_remove, ... }; The similar to the previous example, the generic driver claims ownership of the framebuffer memory from its probe function. This will fail if the memory range, or parts of it, is already owned by another driver. If successful, the generic driver is now subject to forced removal by
another driver. This only works for platform drivers that support hot
unplugging. When a driver calls
Parameters
Description This function removes all graphics device drivers. Use this function on systems that can have their framebuffer located anywhere in memory. Return 0 on success, or a negative errno code otherwise
Parameters
Description Installs the given device as the new owner of the aperture. The function expects the aperture to be provided by a platform device. If another driver takes over ownership of the aperture, aperture helpers will then unregister the platform device automatically. All acquired apertures are released automatically when the underlying device goes away. The function fails if the aperture, or parts of it, is currently
owned by another device. To evict current owners, callers should use
Return 0 on success, or a negative errno value otherwise.
Parameters
Description This function removes devices that own apertures within base and size. Return 0 on success, or a negative errno code otherwise
Parameters
Description This function removes VGA devices provided by pdev, such as a VGA framebuffer or a console. This is useful if you have a VGA-compatible PCI graphics device with framebuffers in non-BAR locations. Drivers should acquire ownership of those memory areas and afterwards call this helper to release remaining VGA devices. If your hardware has its framebuffers accessible via PCI BARS, use
Return 0 on success, or a negative errno code otherwise
Parameters
Description This function removes devices that own apertures within any of pdev’s memory bars. The function assumes that PCI device with shadowed ROM drives a primary display and therefore kicks out vga16fb as well. Return 0 on success, or a negative errno code otherwise |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |