diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-09-25 00:28:13 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-09-25 00:28:13 -0400 |
commit | b5e89ed53ed8d24f83ba1941c07382af00ed238e (patch) | |
tree | 747bae7a565f88a2e1d5974776eeb054a932c505 /drivers/char/drm/drm_agpsupport.c | |
parent | 99a2657a29e2d623c3568cd86b27cac13fb63140 (diff) |
drm: lindent the drm directory.
I've been threatening this for a while, so no point hanging around.
This lindents the DRM code which was always really bad in tabbing department.
I've also fixed some misnamed files in comments and removed some trailing
whitespace.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_agpsupport.c')
-rw-r--r-- | drivers/char/drm/drm_agpsupport.c | 150 |
1 files changed, 79 insertions, 71 deletions
diff --git a/drivers/char/drm/drm_agpsupport.c b/drivers/char/drm/drm_agpsupport.c index 8c215adcb4b2..2b6453a9ffce 100644 --- a/drivers/char/drm/drm_agpsupport.c +++ b/drivers/char/drm/drm_agpsupport.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /** | 1 | /** |
2 | * \file drm_agpsupport.h | 2 | * \file drm_agpsupport.h |
3 | * DRM support for AGP/GART backend | 3 | * DRM support for AGP/GART backend |
4 | * | 4 | * |
5 | * \author Rickard E. (Rik) Faith <faith@valinux.com> | 5 | * \author Rickard E. (Rik) Faith <faith@valinux.com> |
6 | * \author Gareth Hughes <gareth@valinux.com> | 6 | * \author Gareth Hughes <gareth@valinux.com> |
7 | */ | 7 | */ |
@@ -48,30 +48,31 @@ | |||
48 | * Verifies the AGP device has been initialized and acquired and fills in the | 48 | * Verifies the AGP device has been initialized and acquired and fills in the |
49 | * drm_agp_info structure with the information in drm_agp_head::agp_info. | 49 | * drm_agp_info structure with the information in drm_agp_head::agp_info. |
50 | */ | 50 | */ |
51 | int drm_agp_info(drm_device_t *dev, drm_agp_info_t *info) | 51 | int drm_agp_info(drm_device_t * dev, drm_agp_info_t * info) |
52 | { | 52 | { |
53 | DRM_AGP_KERN *kern; | 53 | DRM_AGP_KERN *kern; |
54 | 54 | ||
55 | if (!dev->agp || !dev->agp->acquired) | 55 | if (!dev->agp || !dev->agp->acquired) |
56 | return -EINVAL; | 56 | return -EINVAL; |
57 | 57 | ||
58 | kern = &dev->agp->agp_info; | 58 | kern = &dev->agp->agp_info; |
59 | info->agp_version_major = kern->version.major; | 59 | info->agp_version_major = kern->version.major; |
60 | info->agp_version_minor = kern->version.minor; | 60 | info->agp_version_minor = kern->version.minor; |
61 | info->mode = kern->mode; | 61 | info->mode = kern->mode; |
62 | info->aperture_base = kern->aper_base; | 62 | info->aperture_base = kern->aper_base; |
63 | info->aperture_size = kern->aper_size * 1024 * 1024; | 63 | info->aperture_size = kern->aper_size * 1024 * 1024; |
64 | info->memory_allowed = kern->max_memory << PAGE_SHIFT; | 64 | info->memory_allowed = kern->max_memory << PAGE_SHIFT; |
65 | info->memory_used = kern->current_memory << PAGE_SHIFT; | 65 | info->memory_used = kern->current_memory << PAGE_SHIFT; |
66 | info->id_vendor = kern->device->vendor; | 66 | info->id_vendor = kern->device->vendor; |
67 | info->id_device = kern->device->device; | 67 | info->id_device = kern->device->device; |
68 | 68 | ||
69 | return 0; | 69 | return 0; |
70 | } | 70 | } |
71 | |||
71 | EXPORT_SYMBOL(drm_agp_info); | 72 | EXPORT_SYMBOL(drm_agp_info); |
72 | 73 | ||
73 | int drm_agp_info_ioctl(struct inode *inode, struct file *filp, | 74 | int drm_agp_info_ioctl(struct inode *inode, struct file *filp, |
74 | unsigned int cmd, unsigned long arg) | 75 | unsigned int cmd, unsigned long arg) |
75 | { | 76 | { |
76 | drm_file_t *priv = filp->private_data; | 77 | drm_file_t *priv = filp->private_data; |
77 | drm_device_t *dev = priv->head->dev; | 78 | drm_device_t *dev = priv->head->dev; |
@@ -81,7 +82,7 @@ int drm_agp_info_ioctl(struct inode *inode, struct file *filp, | |||
81 | err = drm_agp_info(dev, &info); | 82 | err = drm_agp_info(dev, &info); |
82 | if (err) | 83 | if (err) |
83 | return err; | 84 | return err; |
84 | 85 | ||
85 | if (copy_to_user((drm_agp_info_t __user *) arg, &info, sizeof(info))) | 86 | if (copy_to_user((drm_agp_info_t __user *) arg, &info, sizeof(info))) |
86 | return -EFAULT; | 87 | return -EFAULT; |
87 | return 0; | 88 | return 0; |
@@ -91,12 +92,12 @@ int drm_agp_info_ioctl(struct inode *inode, struct file *filp, | |||
91 | * Acquire the AGP device. | 92 | * Acquire the AGP device. |
92 | * | 93 | * |
93 | * \param dev DRM device that is to acquire AGP | 94 | * \param dev DRM device that is to acquire AGP |
94 | * \return zero on success or a negative number on failure. | 95 | * \return zero on success or a negative number on failure. |
95 | * | 96 | * |
96 | * Verifies the AGP device hasn't been acquired before and calls | 97 | * Verifies the AGP device hasn't been acquired before and calls |
97 | * \c agp_backend_acquire. | 98 | * \c agp_backend_acquire. |
98 | */ | 99 | */ |
99 | int drm_agp_acquire(drm_device_t *dev) | 100 | int drm_agp_acquire(drm_device_t * dev) |
100 | { | 101 | { |
101 | if (!dev->agp) | 102 | if (!dev->agp) |
102 | return -ENODEV; | 103 | return -ENODEV; |
@@ -107,6 +108,7 @@ int drm_agp_acquire(drm_device_t *dev) | |||
107 | dev->agp->acquired = 1; | 108 | dev->agp->acquired = 1; |
108 | return 0; | 109 | return 0; |
109 | } | 110 | } |
111 | |||
110 | EXPORT_SYMBOL(drm_agp_acquire); | 112 | EXPORT_SYMBOL(drm_agp_acquire); |
111 | 113 | ||
112 | /** | 114 | /** |
@@ -125,8 +127,8 @@ int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp, | |||
125 | unsigned int cmd, unsigned long arg) | 127 | unsigned int cmd, unsigned long arg) |
126 | { | 128 | { |
127 | drm_file_t *priv = filp->private_data; | 129 | drm_file_t *priv = filp->private_data; |
128 | 130 | ||
129 | return drm_agp_acquire( (drm_device_t *) priv->head->dev ); | 131 | return drm_agp_acquire((drm_device_t *) priv->head->dev); |
130 | } | 132 | } |
131 | 133 | ||
132 | /** | 134 | /** |
@@ -137,7 +139,7 @@ int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp, | |||
137 | * | 139 | * |
138 | * Verifies the AGP device has been acquired and calls \c agp_backend_release. | 140 | * Verifies the AGP device has been acquired and calls \c agp_backend_release. |
139 | */ | 141 | */ |
140 | int drm_agp_release(drm_device_t *dev) | 142 | int drm_agp_release(drm_device_t * dev) |
141 | { | 143 | { |
142 | if (!dev->agp || !dev->agp->acquired) | 144 | if (!dev->agp || !dev->agp->acquired) |
143 | return -EINVAL; | 145 | return -EINVAL; |
@@ -145,6 +147,7 @@ int drm_agp_release(drm_device_t *dev) | |||
145 | dev->agp->acquired = 0; | 147 | dev->agp->acquired = 0; |
146 | return 0; | 148 | return 0; |
147 | } | 149 | } |
150 | |||
148 | EXPORT_SYMBOL(drm_agp_release); | 151 | EXPORT_SYMBOL(drm_agp_release); |
149 | 152 | ||
150 | int drm_agp_release_ioctl(struct inode *inode, struct file *filp, | 153 | int drm_agp_release_ioctl(struct inode *inode, struct file *filp, |
@@ -152,13 +155,13 @@ int drm_agp_release_ioctl(struct inode *inode, struct file *filp, | |||
152 | { | 155 | { |
153 | drm_file_t *priv = filp->private_data; | 156 | drm_file_t *priv = filp->private_data; |
154 | drm_device_t *dev = priv->head->dev; | 157 | drm_device_t *dev = priv->head->dev; |
155 | 158 | ||
156 | return drm_agp_release(dev); | 159 | return drm_agp_release(dev); |
157 | } | 160 | } |
158 | 161 | ||
159 | /** | 162 | /** |
160 | * Enable the AGP bus. | 163 | * Enable the AGP bus. |
161 | * | 164 | * |
162 | * \param dev DRM device that has previously acquired AGP. | 165 | * \param dev DRM device that has previously acquired AGP. |
163 | * \param mode Requested AGP mode. | 166 | * \param mode Requested AGP mode. |
164 | * \return zero on success or a negative number on failure. | 167 | * \return zero on success or a negative number on failure. |
@@ -166,27 +169,27 @@ int drm_agp_release_ioctl(struct inode *inode, struct file *filp, | |||
166 | * Verifies the AGP device has been acquired but not enabled, and calls | 169 | * Verifies the AGP device has been acquired but not enabled, and calls |
167 | * \c agp_enable. | 170 | * \c agp_enable. |
168 | */ | 171 | */ |
169 | int drm_agp_enable(drm_device_t *dev, drm_agp_mode_t mode) | 172 | int drm_agp_enable(drm_device_t * dev, drm_agp_mode_t mode) |
170 | { | 173 | { |
171 | if (!dev->agp || !dev->agp->acquired) | 174 | if (!dev->agp || !dev->agp->acquired) |
172 | return -EINVAL; | 175 | return -EINVAL; |
173 | 176 | ||
174 | dev->agp->mode = mode.mode; | 177 | dev->agp->mode = mode.mode; |
175 | agp_enable(dev->agp->bridge, mode.mode); | 178 | agp_enable(dev->agp->bridge, mode.mode); |
176 | dev->agp->base = dev->agp->agp_info.aper_base; | 179 | dev->agp->base = dev->agp->agp_info.aper_base; |
177 | dev->agp->enabled = 1; | 180 | dev->agp->enabled = 1; |
178 | return 0; | 181 | return 0; |
179 | } | 182 | } |
183 | |||
180 | EXPORT_SYMBOL(drm_agp_enable); | 184 | EXPORT_SYMBOL(drm_agp_enable); |
181 | 185 | ||
182 | int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, | 186 | int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, |
183 | unsigned int cmd, unsigned long arg) | 187 | unsigned int cmd, unsigned long arg) |
184 | { | 188 | { |
185 | drm_file_t *priv = filp->private_data; | 189 | drm_file_t *priv = filp->private_data; |
186 | drm_device_t *dev = priv->head->dev; | 190 | drm_device_t *dev = priv->head->dev; |
187 | drm_agp_mode_t mode; | 191 | drm_agp_mode_t mode; |
188 | 192 | ||
189 | |||
190 | if (copy_from_user(&mode, (drm_agp_mode_t __user *) arg, sizeof(mode))) | 193 | if (copy_from_user(&mode, (drm_agp_mode_t __user *) arg, sizeof(mode))) |
191 | return -EFAULT; | 194 | return -EFAULT; |
192 | 195 | ||
@@ -201,20 +204,20 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, | |||
201 | * \param cmd command. | 204 | * \param cmd command. |
202 | * \param arg pointer to a drm_agp_buffer structure. | 205 | * \param arg pointer to a drm_agp_buffer structure. |
203 | * \return zero on success or a negative number on failure. | 206 | * \return zero on success or a negative number on failure. |
204 | * | 207 | * |
205 | * Verifies the AGP device is present and has been acquired, allocates the | 208 | * Verifies the AGP device is present and has been acquired, allocates the |
206 | * memory via alloc_agp() and creates a drm_agp_mem entry for it. | 209 | * memory via alloc_agp() and creates a drm_agp_mem entry for it. |
207 | */ | 210 | */ |
208 | int drm_agp_alloc(struct inode *inode, struct file *filp, | 211 | int drm_agp_alloc(struct inode *inode, struct file *filp, |
209 | unsigned int cmd, unsigned long arg) | 212 | unsigned int cmd, unsigned long arg) |
210 | { | 213 | { |
211 | drm_file_t *priv = filp->private_data; | 214 | drm_file_t *priv = filp->private_data; |
212 | drm_device_t *dev = priv->head->dev; | 215 | drm_device_t *dev = priv->head->dev; |
213 | drm_agp_buffer_t request; | 216 | drm_agp_buffer_t request; |
214 | drm_agp_mem_t *entry; | 217 | drm_agp_mem_t *entry; |
215 | DRM_AGP_MEM *memory; | 218 | DRM_AGP_MEM *memory; |
216 | unsigned long pages; | 219 | unsigned long pages; |
217 | u32 type; | 220 | u32 type; |
218 | drm_agp_buffer_t __user *argp = (void __user *)arg; | 221 | drm_agp_buffer_t __user *argp = (void __user *)arg; |
219 | 222 | ||
220 | if (!dev->agp || !dev->agp->acquired) | 223 | if (!dev->agp || !dev->agp->acquired) |
@@ -224,7 +227,7 @@ int drm_agp_alloc(struct inode *inode, struct file *filp, | |||
224 | if (!(entry = drm_alloc(sizeof(*entry), DRM_MEM_AGPLISTS))) | 227 | if (!(entry = drm_alloc(sizeof(*entry), DRM_MEM_AGPLISTS))) |
225 | return -ENOMEM; | 228 | return -ENOMEM; |
226 | 229 | ||
227 | memset(entry, 0, sizeof(*entry)); | 230 | memset(entry, 0, sizeof(*entry)); |
228 | 231 | ||
229 | pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE; | 232 | pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE; |
230 | type = (u32) request.type; | 233 | type = (u32) request.type; |
@@ -234,21 +237,21 @@ int drm_agp_alloc(struct inode *inode, struct file *filp, | |||
234 | return -ENOMEM; | 237 | return -ENOMEM; |
235 | } | 238 | } |
236 | 239 | ||
237 | entry->handle = (unsigned long)memory->key + 1; | 240 | entry->handle = (unsigned long)memory->key + 1; |
238 | entry->memory = memory; | 241 | entry->memory = memory; |
239 | entry->bound = 0; | 242 | entry->bound = 0; |
240 | entry->pages = pages; | 243 | entry->pages = pages; |
241 | entry->prev = NULL; | 244 | entry->prev = NULL; |
242 | entry->next = dev->agp->memory; | 245 | entry->next = dev->agp->memory; |
243 | if (dev->agp->memory) | 246 | if (dev->agp->memory) |
244 | dev->agp->memory->prev = entry; | 247 | dev->agp->memory->prev = entry; |
245 | dev->agp->memory = entry; | 248 | dev->agp->memory = entry; |
246 | 249 | ||
247 | request.handle = entry->handle; | 250 | request.handle = entry->handle; |
248 | request.physical = memory->physical; | 251 | request.physical = memory->physical; |
249 | 252 | ||
250 | if (copy_to_user(argp, &request, sizeof(request))) { | 253 | if (copy_to_user(argp, &request, sizeof(request))) { |
251 | dev->agp->memory = entry->next; | 254 | dev->agp->memory = entry->next; |
252 | dev->agp->memory->prev = NULL; | 255 | dev->agp->memory->prev = NULL; |
253 | drm_free_agp(memory, pages); | 256 | drm_free_agp(memory, pages); |
254 | drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS); | 257 | drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS); |
@@ -263,11 +266,11 @@ int drm_agp_alloc(struct inode *inode, struct file *filp, | |||
263 | * \param dev DRM device structure. | 266 | * \param dev DRM device structure. |
264 | * \param handle AGP memory handle. | 267 | * \param handle AGP memory handle. |
265 | * \return pointer to the drm_agp_mem structure associated with \p handle. | 268 | * \return pointer to the drm_agp_mem structure associated with \p handle. |
266 | * | 269 | * |
267 | * Walks through drm_agp_head::memory until finding a matching handle. | 270 | * Walks through drm_agp_head::memory until finding a matching handle. |
268 | */ | 271 | */ |
269 | static drm_agp_mem_t *drm_agp_lookup_entry(drm_device_t *dev, | 272 | static drm_agp_mem_t *drm_agp_lookup_entry(drm_device_t * dev, |
270 | unsigned long handle) | 273 | unsigned long handle) |
271 | { | 274 | { |
272 | drm_agp_mem_t *entry; | 275 | drm_agp_mem_t *entry; |
273 | 276 | ||
@@ -291,17 +294,18 @@ static drm_agp_mem_t *drm_agp_lookup_entry(drm_device_t *dev, | |||
291 | * entry and passes it to the unbind_agp() function. | 294 | * entry and passes it to the unbind_agp() function. |
292 | */ | 295 | */ |
293 | int drm_agp_unbind(struct inode *inode, struct file *filp, | 296 | int drm_agp_unbind(struct inode *inode, struct file *filp, |
294 | unsigned int cmd, unsigned long arg) | 297 | unsigned int cmd, unsigned long arg) |
295 | { | 298 | { |
296 | drm_file_t *priv = filp->private_data; | 299 | drm_file_t *priv = filp->private_data; |
297 | drm_device_t *dev = priv->head->dev; | 300 | drm_device_t *dev = priv->head->dev; |
298 | drm_agp_binding_t request; | 301 | drm_agp_binding_t request; |
299 | drm_agp_mem_t *entry; | 302 | drm_agp_mem_t *entry; |
300 | int ret; | 303 | int ret; |
301 | 304 | ||
302 | if (!dev->agp || !dev->agp->acquired) | 305 | if (!dev->agp || !dev->agp->acquired) |
303 | return -EINVAL; | 306 | return -EINVAL; |
304 | if (copy_from_user(&request, (drm_agp_binding_t __user *)arg, sizeof(request))) | 307 | if (copy_from_user |
308 | (&request, (drm_agp_binding_t __user *) arg, sizeof(request))) | ||
305 | return -EFAULT; | 309 | return -EFAULT; |
306 | if (!(entry = drm_agp_lookup_entry(dev, request.handle))) | 310 | if (!(entry = drm_agp_lookup_entry(dev, request.handle))) |
307 | return -EINVAL; | 311 | return -EINVAL; |
@@ -309,7 +313,7 @@ int drm_agp_unbind(struct inode *inode, struct file *filp, | |||
309 | return -EINVAL; | 313 | return -EINVAL; |
310 | ret = drm_unbind_agp(entry->memory); | 314 | ret = drm_unbind_agp(entry->memory); |
311 | if (ret == 0) | 315 | if (ret == 0) |
312 | entry->bound = 0; | 316 | entry->bound = 0; |
313 | return ret; | 317 | return ret; |
314 | } | 318 | } |
315 | 319 | ||
@@ -327,18 +331,19 @@ int drm_agp_unbind(struct inode *inode, struct file *filp, | |||
327 | * it to bind_agp() function. | 331 | * it to bind_agp() function. |
328 | */ | 332 | */ |
329 | int drm_agp_bind(struct inode *inode, struct file *filp, | 333 | int drm_agp_bind(struct inode *inode, struct file *filp, |
330 | unsigned int cmd, unsigned long arg) | 334 | unsigned int cmd, unsigned long arg) |
331 | { | 335 | { |
332 | drm_file_t *priv = filp->private_data; | 336 | drm_file_t *priv = filp->private_data; |
333 | drm_device_t *dev = priv->head->dev; | 337 | drm_device_t *dev = priv->head->dev; |
334 | drm_agp_binding_t request; | 338 | drm_agp_binding_t request; |
335 | drm_agp_mem_t *entry; | 339 | drm_agp_mem_t *entry; |
336 | int retcode; | 340 | int retcode; |
337 | int page; | 341 | int page; |
338 | 342 | ||
339 | if (!dev->agp || !dev->agp->acquired) | 343 | if (!dev->agp || !dev->agp->acquired) |
340 | return -EINVAL; | 344 | return -EINVAL; |
341 | if (copy_from_user(&request, (drm_agp_binding_t __user *)arg, sizeof(request))) | 345 | if (copy_from_user |
346 | (&request, (drm_agp_binding_t __user *) arg, sizeof(request))) | ||
342 | return -EFAULT; | 347 | return -EFAULT; |
343 | if (!(entry = drm_agp_lookup_entry(dev, request.handle))) | 348 | if (!(entry = drm_agp_lookup_entry(dev, request.handle))) |
344 | return -EINVAL; | 349 | return -EINVAL; |
@@ -368,16 +373,17 @@ int drm_agp_bind(struct inode *inode, struct file *filp, | |||
368 | * and unlinks from the doubly linked list it's inserted in. | 373 | * and unlinks from the doubly linked list it's inserted in. |
369 | */ | 374 | */ |
370 | int drm_agp_free(struct inode *inode, struct file *filp, | 375 | int drm_agp_free(struct inode *inode, struct file *filp, |
371 | unsigned int cmd, unsigned long arg) | 376 | unsigned int cmd, unsigned long arg) |
372 | { | 377 | { |
373 | drm_file_t *priv = filp->private_data; | 378 | drm_file_t *priv = filp->private_data; |
374 | drm_device_t *dev = priv->head->dev; | 379 | drm_device_t *dev = priv->head->dev; |
375 | drm_agp_buffer_t request; | 380 | drm_agp_buffer_t request; |
376 | drm_agp_mem_t *entry; | 381 | drm_agp_mem_t *entry; |
377 | 382 | ||
378 | if (!dev->agp || !dev->agp->acquired) | 383 | if (!dev->agp || !dev->agp->acquired) |
379 | return -EINVAL; | 384 | return -EINVAL; |
380 | if (copy_from_user(&request, (drm_agp_buffer_t __user *)arg, sizeof(request))) | 385 | if (copy_from_user |
386 | (&request, (drm_agp_buffer_t __user *) arg, sizeof(request))) | ||
381 | return -EFAULT; | 387 | return -EFAULT; |
382 | if (!(entry = drm_agp_lookup_entry(dev, request.handle))) | 388 | if (!(entry = drm_agp_lookup_entry(dev, request.handle))) |
383 | return -EINVAL; | 389 | return -EINVAL; |
@@ -403,9 +409,9 @@ int drm_agp_free(struct inode *inode, struct file *filp, | |||
403 | * \return pointer to a drm_agp_head structure. | 409 | * \return pointer to a drm_agp_head structure. |
404 | * | 410 | * |
405 | */ | 411 | */ |
406 | drm_agp_head_t *drm_agp_init(drm_device_t *dev) | 412 | drm_agp_head_t *drm_agp_init(drm_device_t * dev) |
407 | { | 413 | { |
408 | drm_agp_head_t *head = NULL; | 414 | drm_agp_head_t *head = NULL; |
409 | 415 | ||
410 | if (!(head = drm_alloc(sizeof(*head), DRM_MEM_AGPLISTS))) | 416 | if (!(head = drm_alloc(sizeof(*head), DRM_MEM_AGPLISTS))) |
411 | return NULL; | 417 | return NULL; |
@@ -433,13 +439,14 @@ drm_agp_head_t *drm_agp_init(drm_device_t *dev) | |||
433 | } | 439 | } |
434 | 440 | ||
435 | /** Calls agp_allocate_memory() */ | 441 | /** Calls agp_allocate_memory() */ |
436 | DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size_t pages, u32 type) | 442 | DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data * bridge, |
443 | size_t pages, u32 type) | ||
437 | { | 444 | { |
438 | return agp_allocate_memory(bridge, pages, type); | 445 | return agp_allocate_memory(bridge, pages, type); |
439 | } | 446 | } |
440 | 447 | ||
441 | /** Calls agp_free_memory() */ | 448 | /** Calls agp_free_memory() */ |
442 | int drm_agp_free_memory(DRM_AGP_MEM *handle) | 449 | int drm_agp_free_memory(DRM_AGP_MEM * handle) |
443 | { | 450 | { |
444 | if (!handle) | 451 | if (!handle) |
445 | return 0; | 452 | return 0; |
@@ -448,20 +455,21 @@ int drm_agp_free_memory(DRM_AGP_MEM *handle) | |||
448 | } | 455 | } |
449 | 456 | ||
450 | /** Calls agp_bind_memory() */ | 457 | /** Calls agp_bind_memory() */ |
451 | int drm_agp_bind_memory(DRM_AGP_MEM *handle, off_t start) | 458 | int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start) |
452 | { | 459 | { |
453 | if (!handle) | 460 | if (!handle) |
454 | return -EINVAL; | 461 | return -EINVAL; |
455 | return agp_bind_memory(handle, start); | 462 | return agp_bind_memory(handle, start); |
456 | } | 463 | } |
464 | |||
457 | EXPORT_SYMBOL(drm_agp_bind_memory); | 465 | EXPORT_SYMBOL(drm_agp_bind_memory); |
458 | 466 | ||
459 | /** Calls agp_unbind_memory() */ | 467 | /** Calls agp_unbind_memory() */ |
460 | int drm_agp_unbind_memory(DRM_AGP_MEM *handle) | 468 | int drm_agp_unbind_memory(DRM_AGP_MEM * handle) |
461 | { | 469 | { |
462 | if (!handle) | 470 | if (!handle) |
463 | return -EINVAL; | 471 | return -EINVAL; |
464 | return agp_unbind_memory(handle); | 472 | return agp_unbind_memory(handle); |
465 | } | 473 | } |
466 | 474 | ||
467 | #endif /* __OS_HAS_AGP */ | 475 | #endif /* __OS_HAS_AGP */ |