2021-04-12 21:10:41 +08:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
|
|
|
|
#ifndef _DRM_APERTURE_H_
|
|
|
|
#define _DRM_APERTURE_H_
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
2021-04-30 18:58:34 +08:00
|
|
|
struct drm_device;
|
2021-06-29 21:58:33 +08:00
|
|
|
struct drm_driver;
|
2021-04-12 21:10:41 +08:00
|
|
|
struct pci_dev;
|
|
|
|
|
2021-04-30 18:58:34 +08:00
|
|
|
int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t base,
|
|
|
|
resource_size_t size);
|
|
|
|
|
2021-04-12 21:10:41 +08:00
|
|
|
int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size,
|
2023-04-06 21:21:03 +08:00
|
|
|
const struct drm_driver *req_driver);
|
2021-04-12 21:10:41 +08:00
|
|
|
|
2021-06-29 21:58:33 +08:00
|
|
|
int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
|
|
|
|
const struct drm_driver *req_driver);
|
2021-04-12 21:10:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* drm_aperture_remove_framebuffers - remove all existing framebuffers
|
2021-06-29 21:58:33 +08:00
|
|
|
* @req_driver: requesting DRM driver
|
2021-04-12 21:10:41 +08:00
|
|
|
*
|
|
|
|
* This function removes all graphics device drivers. Use this function on systems
|
|
|
|
* that can have their framebuffer located anywhere in memory.
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* 0 on success, or a negative errno code otherwise
|
|
|
|
*/
|
2021-06-29 21:58:33 +08:00
|
|
|
static inline int
|
2023-04-06 21:21:03 +08:00
|
|
|
drm_aperture_remove_framebuffers(const struct drm_driver *req_driver)
|
2021-04-12 21:10:41 +08:00
|
|
|
{
|
2023-04-06 21:21:03 +08:00
|
|
|
return drm_aperture_remove_conflicting_framebuffers(0, (resource_size_t)-1,
|
2021-06-29 21:58:33 +08:00
|
|
|
req_driver);
|
2021-04-12 21:10:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|