drm_aperture.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: MIT */
  2. #ifndef _DRM_APERTURE_H_
  3. #define _DRM_APERTURE_H_
  4. #include <linux/types.h>
  5. struct drm_device;
  6. struct drm_driver;
  7. struct pci_dev;
  8. int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t base,
  9. resource_size_t size);
  10. int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size,
  11. bool primary, const struct drm_driver *req_driver);
  12. int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
  13. const struct drm_driver *req_driver);
  14. /**
  15. * drm_aperture_remove_framebuffers - remove all existing framebuffers
  16. * @primary: also kick vga16fb if present
  17. * @req_driver: requesting DRM driver
  18. *
  19. * This function removes all graphics device drivers. Use this function on systems
  20. * that can have their framebuffer located anywhere in memory.
  21. *
  22. * Returns:
  23. * 0 on success, or a negative errno code otherwise
  24. */
  25. static inline int
  26. drm_aperture_remove_framebuffers(bool primary, const struct drm_driver *req_driver)
  27. {
  28. return drm_aperture_remove_conflicting_framebuffers(0, (resource_size_t)-1, primary,
  29. req_driver);
  30. }
  31. #endif