David Herrmann | 00fd78e | 2013-08-08 22:19:12 +0200 | [diff] [blame^] | 1 | #ifndef _DRM_AGPSUPPORT_H_ |
| 2 | #define _DRM_AGPSUPPORT_H_ |
| 3 | |
| 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> |
| 10 | |
| 11 | #if __OS_HAS_AGP |
| 12 | |
| 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); |
| 21 | |
| 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); |
| 49 | |
| 50 | static inline int drm_core_has_AGP(struct drm_device *dev) |
| 51 | { |
| 52 | return drm_core_check_feature(dev, DRIVER_USE_AGP); |
| 53 | } |
| 54 | |
| 55 | #else /* __OS_HAS_AGP */ |
| 56 | |
| 57 | static inline void drm_free_agp(DRM_AGP_MEM * handle, int pages) |
| 58 | { |
| 59 | } |
| 60 | |
| 61 | static inline int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start) |
| 62 | { |
| 63 | return -ENODEV; |
| 64 | } |
| 65 | |
| 66 | static inline int drm_unbind_agp(DRM_AGP_MEM * handle) |
| 67 | { |
| 68 | return -ENODEV; |
| 69 | } |
| 70 | |
| 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) |
| 76 | { |
| 77 | return NULL; |
| 78 | } |
| 79 | |
| 80 | static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev) |
| 81 | { |
| 82 | return NULL; |
| 83 | } |
| 84 | |
| 85 | static inline void drm_agp_destroy(struct drm_agp_head *agp) |
| 86 | { |
| 87 | } |
| 88 | |
| 89 | static inline void drm_agp_clear(struct drm_device *dev) |
| 90 | { |
| 91 | } |
| 92 | |
| 93 | static inline int drm_agp_acquire(struct drm_device *dev) |
| 94 | { |
| 95 | return -ENODEV; |
| 96 | } |
| 97 | |
| 98 | static inline int drm_agp_acquire_ioctl(struct drm_device *dev, void *data, |
| 99 | struct drm_file *file_priv) |
| 100 | { |
| 101 | return -ENODEV; |
| 102 | } |
| 103 | |
| 104 | static inline int drm_agp_release(struct drm_device *dev) |
| 105 | { |
| 106 | return -ENODEV; |
| 107 | } |
| 108 | |
| 109 | static inline int drm_agp_release_ioctl(struct drm_device *dev, void *data, |
| 110 | struct drm_file *file_priv) |
| 111 | { |
| 112 | return -ENODEV; |
| 113 | } |
| 114 | |
| 115 | static inline int drm_agp_enable(struct drm_device *dev, |
| 116 | struct drm_agp_mode mode) |
| 117 | { |
| 118 | return -ENODEV; |
| 119 | } |
| 120 | |
| 121 | static inline int drm_agp_enable_ioctl(struct drm_device *dev, void *data, |
| 122 | struct drm_file *file_priv) |
| 123 | { |
| 124 | return -ENODEV; |
| 125 | } |
| 126 | |
| 127 | static inline int drm_agp_info(struct drm_device *dev, |
| 128 | struct drm_agp_info *info) |
| 129 | { |
| 130 | return -ENODEV; |
| 131 | } |
| 132 | |
| 133 | static inline int drm_agp_info_ioctl(struct drm_device *dev, void *data, |
| 134 | struct drm_file *file_priv) |
| 135 | { |
| 136 | return -ENODEV; |
| 137 | } |
| 138 | |
| 139 | static inline int drm_agp_alloc(struct drm_device *dev, |
| 140 | struct drm_agp_buffer *request) |
| 141 | { |
| 142 | return -ENODEV; |
| 143 | } |
| 144 | |
| 145 | static inline int drm_agp_alloc_ioctl(struct drm_device *dev, void *data, |
| 146 | struct drm_file *file_priv) |
| 147 | { |
| 148 | return -ENODEV; |
| 149 | } |
| 150 | |
| 151 | static inline int drm_agp_free(struct drm_device *dev, |
| 152 | struct drm_agp_buffer *request) |
| 153 | { |
| 154 | return -ENODEV; |
| 155 | } |
| 156 | |
| 157 | static inline int drm_agp_free_ioctl(struct drm_device *dev, void *data, |
| 158 | struct drm_file *file_priv) |
| 159 | { |
| 160 | return -ENODEV; |
| 161 | } |
| 162 | |
| 163 | static inline int drm_agp_unbind(struct drm_device *dev, |
| 164 | struct drm_agp_binding *request) |
| 165 | { |
| 166 | return -ENODEV; |
| 167 | } |
| 168 | |
| 169 | static inline int drm_agp_unbind_ioctl(struct drm_device *dev, void *data, |
| 170 | struct drm_file *file_priv) |
| 171 | { |
| 172 | return -ENODEV; |
| 173 | } |
| 174 | |
| 175 | static inline int drm_agp_bind(struct drm_device *dev, |
| 176 | struct drm_agp_binding *request) |
| 177 | { |
| 178 | return -ENODEV; |
| 179 | } |
| 180 | |
| 181 | static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data, |
| 182 | struct drm_file *file_priv) |
| 183 | { |
| 184 | return -ENODEV; |
| 185 | } |
| 186 | |
| 187 | static inline int drm_core_has_AGP(struct drm_device *dev) |
| 188 | { |
| 189 | return 0; |
| 190 | } |
| 191 | |
| 192 | #endif /* __OS_HAS_AGP */ |
| 193 | |
| 194 | #endif /* _DRM_AGPSUPPORT_H_ */ |