129160591SThomas Zimmermann /* SPDX-License-Identifier: MIT */ 229160591SThomas Zimmermann 329160591SThomas Zimmermann #ifndef _DRM_APERTURE_H_ 429160591SThomas Zimmermann #define _DRM_APERTURE_H_ 529160591SThomas Zimmermann 629160591SThomas Zimmermann #include <linux/types.h> 729160591SThomas Zimmermann 8730e7992SThomas Zimmermann struct drm_device; 997c9bfe3SThomas Zimmermann struct drm_driver; 1029160591SThomas Zimmermann struct pci_dev; 1129160591SThomas Zimmermann 12730e7992SThomas Zimmermann int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t base, 13730e7992SThomas Zimmermann resource_size_t size); 14730e7992SThomas Zimmermann 1529160591SThomas Zimmermann int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size, 16*62aeaeaaSDaniel Vetter const struct drm_driver *req_driver); 1729160591SThomas Zimmermann 1897c9bfe3SThomas Zimmermann int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, 1997c9bfe3SThomas Zimmermann const struct drm_driver *req_driver); 2029160591SThomas Zimmermann 2129160591SThomas Zimmermann /** 2229160591SThomas Zimmermann * drm_aperture_remove_framebuffers - remove all existing framebuffers 2397c9bfe3SThomas Zimmermann * @req_driver: requesting DRM driver 2429160591SThomas Zimmermann * 2529160591SThomas Zimmermann * This function removes all graphics device drivers. Use this function on systems 2629160591SThomas Zimmermann * that can have their framebuffer located anywhere in memory. 2729160591SThomas Zimmermann * 2829160591SThomas Zimmermann * Returns: 2929160591SThomas Zimmermann * 0 on success, or a negative errno code otherwise 3029160591SThomas Zimmermann */ 3197c9bfe3SThomas Zimmermann static inline int drm_aperture_remove_framebuffers(const struct drm_driver * req_driver)32*62aeaeaaSDaniel Vetterdrm_aperture_remove_framebuffers(const struct drm_driver *req_driver) 3329160591SThomas Zimmermann { 34*62aeaeaaSDaniel Vetter return drm_aperture_remove_conflicting_framebuffers(0, (resource_size_t)-1, 3597c9bfe3SThomas Zimmermann req_driver); 3629160591SThomas Zimmermann } 3729160591SThomas Zimmermann 3829160591SThomas Zimmermann #endif 39