mm: make wait_on_page_writeback() wait for multiple pending writebacks
[linux/fpc-iii.git] / include / drm / drm_agpsupport.h
blob664e120b93e6042120a782fe14c217bc4ccd0e0e
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _DRM_AGPSUPPORT_H_
3 #define _DRM_AGPSUPPORT_H_
5 #include <linux/agp_backend.h>
6 #include <linux/kernel.h>
7 #include <linux/list.h>
8 #include <linux/mm.h>
9 #include <linux/mutex.h>
10 #include <linux/types.h>
11 #include <uapi/drm/drm.h>
13 struct drm_device;
14 struct drm_file;
16 struct drm_agp_head {
17 struct agp_kern_info agp_info;
18 struct list_head memory;
19 unsigned long mode;
20 struct agp_bridge_data *bridge;
21 int enabled;
22 int acquired;
23 unsigned long base;
24 int agp_mtrr;
25 int cant_use_aperture;
26 unsigned long page_mask;
29 #if IS_ENABLED(CONFIG_AGP)
31 void drm_free_agp(struct agp_memory * handle, int pages);
32 int drm_bind_agp(struct agp_memory * handle, unsigned int start);
33 int drm_unbind_agp(struct agp_memory * handle);
35 struct drm_agp_head *drm_agp_init(struct drm_device *dev);
36 void drm_legacy_agp_clear(struct drm_device *dev);
37 int drm_agp_acquire(struct drm_device *dev);
38 int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
39 struct drm_file *file_priv);
40 int drm_agp_release(struct drm_device *dev);
41 int drm_agp_release_ioctl(struct drm_device *dev, void *data,
42 struct drm_file *file_priv);
43 int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode);
44 int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
45 struct drm_file *file_priv);
46 int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info);
47 int drm_agp_info_ioctl(struct drm_device *dev, void *data,
48 struct drm_file *file_priv);
49 int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request);
50 int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
51 struct drm_file *file_priv);
52 int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request);
53 int drm_agp_free_ioctl(struct drm_device *dev, void *data,
54 struct drm_file *file_priv);
55 int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request);
56 int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
57 struct drm_file *file_priv);
58 int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
59 int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
60 struct drm_file *file_priv);
62 #else /* CONFIG_AGP */
64 static inline void drm_free_agp(struct agp_memory * handle, int pages)
68 static inline int drm_bind_agp(struct agp_memory * handle, unsigned int start)
70 return -ENODEV;
73 static inline int drm_unbind_agp(struct agp_memory * handle)
75 return -ENODEV;
78 static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
80 return NULL;
83 static inline void drm_legacy_agp_clear(struct drm_device *dev)
87 static inline int drm_agp_acquire(struct drm_device *dev)
89 return -ENODEV;
92 static inline int drm_agp_release(struct drm_device *dev)
94 return -ENODEV;
97 static inline int drm_agp_enable(struct drm_device *dev,
98 struct drm_agp_mode mode)
100 return -ENODEV;
103 static inline int drm_agp_info(struct drm_device *dev,
104 struct drm_agp_info *info)
106 return -ENODEV;
109 static inline int drm_agp_alloc(struct drm_device *dev,
110 struct drm_agp_buffer *request)
112 return -ENODEV;
115 static inline int drm_agp_free(struct drm_device *dev,
116 struct drm_agp_buffer *request)
118 return -ENODEV;
121 static inline int drm_agp_unbind(struct drm_device *dev,
122 struct drm_agp_binding *request)
124 return -ENODEV;
127 static inline int drm_agp_bind(struct drm_device *dev,
128 struct drm_agp_binding *request)
130 return -ENODEV;
133 #endif /* CONFIG_AGP */
135 #endif /* _DRM_AGPSUPPORT_H_ */