Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / include / drm / drm_agpsupport.h
bloba184eeee9c96bfb4afc4a1bc8b173a0a71fa1225
1 #ifndef _DRM_AGPSUPPORT_H_
2 #define _DRM_AGPSUPPORT_H_
4 #include <linux/kernel.h>
5 #include <linux/mm.h>
6 #include <linux/mutex.h>
7 #include <linux/types.h>
8 #include <linux/agp_backend.h>
9 #include <drm/drmP.h>
11 #if __OS_HAS_AGP
13 void drm_free_agp(DRM_AGP_MEM * handle, int pages);
14 int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
15 int drm_unbind_agp(DRM_AGP_MEM * handle);
16 DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
17 struct page **pages,
18 unsigned long num_pages,
19 uint32_t gtt_offset,
20 uint32_t type);
22 struct drm_agp_head *drm_agp_init(struct drm_device *dev);
23 void drm_agp_destroy(struct drm_agp_head *agp);
24 void drm_agp_clear(struct drm_device *dev);
25 int drm_agp_acquire(struct drm_device *dev);
26 int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
27 struct drm_file *file_priv);
28 int drm_agp_release(struct drm_device *dev);
29 int drm_agp_release_ioctl(struct drm_device *dev, void *data,
30 struct drm_file *file_priv);
31 int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode);
32 int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
33 struct drm_file *file_priv);
34 int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info);
35 int drm_agp_info_ioctl(struct drm_device *dev, void *data,
36 struct drm_file *file_priv);
37 int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request);
38 int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
39 struct drm_file *file_priv);
40 int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request);
41 int drm_agp_free_ioctl(struct drm_device *dev, void *data,
42 struct drm_file *file_priv);
43 int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request);
44 int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
45 struct drm_file *file_priv);
46 int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
47 int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
48 struct drm_file *file_priv);
50 static inline int drm_core_has_AGP(struct drm_device *dev)
52 return drm_core_check_feature(dev, DRIVER_USE_AGP);
55 #else /* __OS_HAS_AGP */
57 static inline void drm_free_agp(DRM_AGP_MEM * handle, int pages)
61 static inline int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start)
63 return -ENODEV;
66 static inline int drm_unbind_agp(DRM_AGP_MEM * handle)
68 return -ENODEV;
71 static inline DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
72 struct page **pages,
73 unsigned long num_pages,
74 uint32_t gtt_offset,
75 uint32_t type)
77 return NULL;
80 static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
82 return NULL;
85 static inline void drm_agp_destroy(struct drm_agp_head *agp)
89 static inline void drm_agp_clear(struct drm_device *dev)
93 static inline int drm_agp_acquire(struct drm_device *dev)
95 return -ENODEV;
98 static inline int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
99 struct drm_file *file_priv)
101 return -ENODEV;
104 static inline int drm_agp_release(struct drm_device *dev)
106 return -ENODEV;
109 static inline int drm_agp_release_ioctl(struct drm_device *dev, void *data,
110 struct drm_file *file_priv)
112 return -ENODEV;
115 static inline int drm_agp_enable(struct drm_device *dev,
116 struct drm_agp_mode mode)
118 return -ENODEV;
121 static inline int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
122 struct drm_file *file_priv)
124 return -ENODEV;
127 static inline int drm_agp_info(struct drm_device *dev,
128 struct drm_agp_info *info)
130 return -ENODEV;
133 static inline int drm_agp_info_ioctl(struct drm_device *dev, void *data,
134 struct drm_file *file_priv)
136 return -ENODEV;
139 static inline int drm_agp_alloc(struct drm_device *dev,
140 struct drm_agp_buffer *request)
142 return -ENODEV;
145 static inline int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
146 struct drm_file *file_priv)
148 return -ENODEV;
151 static inline int drm_agp_free(struct drm_device *dev,
152 struct drm_agp_buffer *request)
154 return -ENODEV;
157 static inline int drm_agp_free_ioctl(struct drm_device *dev, void *data,
158 struct drm_file *file_priv)
160 return -ENODEV;
163 static inline int drm_agp_unbind(struct drm_device *dev,
164 struct drm_agp_binding *request)
166 return -ENODEV;
169 static inline int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
170 struct drm_file *file_priv)
172 return -ENODEV;
175 static inline int drm_agp_bind(struct drm_device *dev,
176 struct drm_agp_binding *request)
178 return -ENODEV;
181 static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
182 struct drm_file *file_priv)
184 return -ENODEV;
187 static inline int drm_core_has_AGP(struct drm_device *dev)
189 return 0;
192 #endif /* __OS_HAS_AGP */
194 #endif /* _DRM_AGPSUPPORT_H_ */