1 #ifndef _DRM_AGPSUPPORT_H_
2 #define _DRM_AGPSUPPORT_H_
4 #include <linux/kernel.h>
6 #include <linux/mutex.h>
7 #include <linux/types.h>
8 #include <linux/agp_backend.h>
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,
18 unsigned long num_pages,
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)
66 static inline int drm_unbind_agp(DRM_AGP_MEM * handle)
71 static inline DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
73 unsigned long num_pages,
80 static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
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)
98 static inline int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
99 struct drm_file *file_priv)
104 static inline int drm_agp_release(struct drm_device *dev)
109 static inline int drm_agp_release_ioctl(struct drm_device *dev, void *data,
110 struct drm_file *file_priv)
115 static inline int drm_agp_enable(struct drm_device *dev,
116 struct drm_agp_mode mode)
121 static inline int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
122 struct drm_file *file_priv)
127 static inline int drm_agp_info(struct drm_device *dev,
128 struct drm_agp_info *info)
133 static inline int drm_agp_info_ioctl(struct drm_device *dev, void *data,
134 struct drm_file *file_priv)
139 static inline int drm_agp_alloc(struct drm_device *dev,
140 struct drm_agp_buffer *request)
145 static inline int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
146 struct drm_file *file_priv)
151 static inline int drm_agp_free(struct drm_device *dev,
152 struct drm_agp_buffer *request)
157 static inline int drm_agp_free_ioctl(struct drm_device *dev, void *data,
158 struct drm_file *file_priv)
163 static inline int drm_agp_unbind(struct drm_device *dev,
164 struct drm_agp_binding *request)
169 static inline int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
170 struct drm_file *file_priv)
175 static inline int drm_agp_bind(struct drm_device *dev,
176 struct drm_agp_binding *request)
181 static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
182 struct drm_file *file_priv)
187 static inline int drm_core_has_AGP(struct drm_device *dev)
192 #endif /* __OS_HAS_AGP */
194 #endif /* _DRM_AGPSUPPORT_H_ */