XenevaOS
Loading...
Searching...
No Matches
aperture.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
2
3#ifndef _LINUX_APERTURE_H_
4#define _LINUX_APERTURE_H_
5
6/*
7 * DCL <linux/aperture.h> -- upstream's header, including the shapes that
8 * matter here: CONFIG_APERTURE_HELPERS is not defined in this tree, so the
9 * #else arm below is the live code and every entry point answers 0.
10 *
11 * That is not a shortcut around mainline's logic, it is the same answer a
12 * mainline build without the option gives: aperture helpers are how one
13 * driver evicts another's firmware framebuffer from the PCI BARs they share
14 * (the simpledrm/efifb/vesafb conflicts). This target's boot console is
15 * Xeneva's own GOP framebuffer on its own device, not a PCI driver, and the
16 * DRM device a vendored driver claims (bochs) never overlaps it -- there is
17 * nothing to evict and no registry to evict it through. The return value is
18 * what every call site tests before proceeding, so 0 keeps the driver on its
19 * happy path, exactly as it would be on mainline.
20 *
21 * Kept as inline functions rather than deleted declarations so that a
22 * driver's `aperture_remove_conflicting_pci_devices(pdev, name)` call site
23 * compiles without a DCL shim symbol behind it.
24 */
25
26#include <linux/types.h>
27
28struct pci_dev;
29struct platform_device;
30
31#if defined(CONFIG_APERTURE_HELPERS)
32int devm_aperture_acquire_for_platform_device(struct platform_device *pdev,
35
36int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size,
37 const char *name);
38
39int __aperture_remove_legacy_vga_devices(struct pci_dev *pdev);
40
41int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name);
42#else
43static inline int devm_aperture_acquire_for_platform_device(struct platform_device *pdev,
46{
47 (void)pdev;
48 (void)base;
49 (void)size;
50 return 0;
51}
52
53static inline int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size,
54 const char *name)
55{
56 (void)base;
57 (void)size;
58 (void)name;
59 return 0;
60}
61
62static inline int __aperture_remove_legacy_vga_devices(struct pci_dev *pdev)
63{
64 (void)pdev;
65 return 0;
66}
67
68static inline int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name)
69{
70 (void)pdev;
71 (void)name;
72 return 0;
73}
74#endif
75
76static inline int aperture_remove_all_conflicting_devices(const char *name)
77{
78 return aperture_remove_conflicting_devices(0, (resource_size_t)-1, name);
79}
80
81#endif /* _LINUX_APERTURE_H_ */
size_t size
Definition drm_bridge.h:1299
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition drm_crtc.h:1242
struct i915_user_extension base
Definition i915_drm.h:0
uintptr_t resource_size_t
Definition kernel.h:41
Definition pci.h:102