1 #ifndef _DRM_AGPSUPPORT_H_
2 #define _DRM_AGPSUPPORT_H_
4 #include <linux/kernel.h>
5 #include <linux/list.h>
7 #include <linux/mutex.h>
8 #include <linux/types.h>
10 #include <dev/agp/agpvar.h>
11 #include <uapi_drm/drm.h>
16 #define __OS_HAS_AGP 1
20 struct agp_info agp_info;
21 struct drm_agp_mem *memory;
27 int cant_use_aperture;
28 unsigned long page_mask;
34 void drm_free_agp(struct agp_memory * handle, int pages);
35 int drm_bind_agp(struct agp_memory * handle, unsigned int start);
36 int drm_unbind_agp(struct agp_memory * handle);
37 struct agp_memory *drm_agp_bind_pages(struct drm_device *dev,
39 unsigned long num_pages,
44 struct drm_agp_head *drm_agp_init(struct drm_device *dev);
45 void drm_agp_clear(struct drm_device *dev);
46 int drm_agp_acquire(struct drm_device *dev);
47 int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
48 struct drm_file *file_priv);
49 int drm_agp_release(struct drm_device *dev);
50 int drm_agp_release_ioctl(struct drm_device *dev, void *data,
51 struct drm_file *file_priv);
52 int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode);
53 int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
54 struct drm_file *file_priv);
55 int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info);
56 int drm_agp_info_ioctl(struct drm_device *dev, void *data,
57 struct drm_file *file_priv);
58 int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request);
59 int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
60 struct drm_file *file_priv);
61 int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request);
62 int drm_agp_free_ioctl(struct drm_device *dev, void *data,
63 struct drm_file *file_priv);
64 int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request);
65 int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
66 struct drm_file *file_priv);
67 int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
68 int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
69 struct drm_file *file_priv);
71 #else /* __OS_HAS_AGP */
74 static inline void drm_free_agp(struct agp_memory * handle, int pages)
78 static inline int drm_bind_agp(struct agp_memory * handle, unsigned int start)
83 static inline int drm_unbind_agp(struct agp_memory * handle)
88 static inline struct agp_memory *drm_agp_bind_pages(struct drm_device *dev,
90 unsigned long num_pages,
98 static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
103 static inline void drm_agp_clear(struct drm_device *dev)
107 static inline int drm_agp_acquire(struct drm_device *dev)
112 static inline int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
113 struct drm_file *file_priv)
118 static inline int drm_agp_release(struct drm_device *dev)
123 static inline int drm_agp_release_ioctl(struct drm_device *dev, void *data,
124 struct drm_file *file_priv)
129 static inline int drm_agp_enable(struct drm_device *dev,
130 struct drm_agp_mode mode)
135 static inline int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
136 struct drm_file *file_priv)
141 static inline int drm_agp_info(struct drm_device *dev,
142 struct drm_agp_info *info)
147 static inline int drm_agp_info_ioctl(struct drm_device *dev, void *data,
148 struct drm_file *file_priv)
153 static inline int drm_agp_alloc(struct drm_device *dev,
154 struct drm_agp_buffer *request)
159 static inline int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
160 struct drm_file *file_priv)
165 static inline int drm_agp_free(struct drm_device *dev,
166 struct drm_agp_buffer *request)
171 static inline int drm_agp_free_ioctl(struct drm_device *dev, void *data,
172 struct drm_file *file_priv)
177 static inline int drm_agp_unbind(struct drm_device *dev,
178 struct drm_agp_binding *request)
183 static inline int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
184 struct drm_file *file_priv)
189 static inline int drm_agp_bind(struct drm_device *dev,
190 struct drm_agp_binding *request)
195 static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
196 struct drm_file *file_priv)
201 #endif /* __OS_HAS_AGP */
203 #endif /* _DRM_AGPSUPPORT_H_ */