diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2021-04-30 12:58:34 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2021-05-01 12:45:03 +0200 |
commit | 730e7992dc1beedf2c33001cc0d791c3cdf6c842 (patch) | |
tree | ac8b38748e8e3ad3d4eb15baad495632a617d258 /include/drm/drm_aperture.h | |
parent | 900d3e4a978928fb6da95637e5dd64e88bae6ce6 (diff) | |
download | linux-stable-730e7992dc1beedf2c33001cc0d791c3cdf6c842.tar.gz linux-stable-730e7992dc1beedf2c33001cc0d791c3cdf6c842.tar.bz2 linux-stable-730e7992dc1beedf2c33001cc0d791c3cdf6c842.zip |
drm/aperture: Add infrastructure for aperture ownership
Platform devices might operate on firmware framebuffers, such as VESA or
EFI. Before a native driver for the graphics hardware can take over the
device, it has to remove any platform driver that operates on the firmware
framebuffer. Aperture helpers provide the infrastructure for platform
drivers to acquire firmware framebuffers, and for native drivers to remove
them later on.
It works similar to the related fbdev mechanism. During initialization, the
platform driver acquires the firmware framebuffer's I/O memory and provides
a callback to be removed. The native driver later uses this information to
remove any platform driver for it's framebuffer I/O memory.
The aperture removal code is integrated into the existing code for removing
conflicting framebuffers, so native drivers use it automatically.
v5:
* fix build error introduced by rebasing v4
* fix typo in documentation
v4:
* hide detach callback in implementation (Daniel)
* documentation fixes
v3:
* rebase onto existing aperture infrastructure
* release aperture from list during detach; fix dangling apertures
* don't export struct drm_aperture
* document struct drm_aperture_funcs
v2:
* rename plaform helpers to aperture helpers
* tie to device lifetime with devm_ functions
* removed unsued remove() callback
* rename kickout to detach
* make struct drm_aperture private
* rebase onto existing drm_aperture.h header file
* use MIT license only for simplicity
* documentation
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20210430105840.30515-4-tzimmermann@suse.de
Diffstat (limited to 'include/drm/drm_aperture.h')
-rw-r--r-- | include/drm/drm_aperture.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/drm/drm_aperture.h b/include/drm/drm_aperture.h index 23cc01647ed3..6c148078780c 100644 --- a/include/drm/drm_aperture.h +++ b/include/drm/drm_aperture.h @@ -5,8 +5,12 @@ #include <linux/types.h> +struct drm_device; struct pci_dev; +int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t base, + resource_size_t size); + int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size, bool primary, const char *name); |