diff options
author | Dave Airlie <airlied@linux.ie> | 2007-07-11 01:27:12 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-07-11 01:27:12 -0400 |
commit | c60ce623bd16137627009d05e311d877729f2ad6 (patch) | |
tree | 4d06337a217ccc6c21f8ad96c3b342a1e9452057 /drivers/char/drm/drm_bufs.c | |
parent | c6c656b4b6ddfc964f1a43394bf86bc76c5e8119 (diff) |
drm: remove a bunch of typedefs on the userspace interface
This moves a bunch of typedefs into a !defined __KERNEL__ to keep userspace
API compatiblity, it changes all internal usages to structs/enum/unions.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_bufs.c')
-rw-r--r-- | drivers/char/drm/drm_bufs.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index dac057879594..6678db2abd8e 100644 --- a/drivers/char/drm/drm_bufs.c +++ b/drivers/char/drm/drm_bufs.c | |||
@@ -102,10 +102,10 @@ static int drm_map_handle(drm_device_t *dev, drm_hash_item_t *hash, | |||
102 | * applicable and if supported by the kernel. | 102 | * applicable and if supported by the kernel. |
103 | */ | 103 | */ |
104 | static int drm_addmap_core(drm_device_t * dev, unsigned int offset, | 104 | static int drm_addmap_core(drm_device_t * dev, unsigned int offset, |
105 | unsigned int size, drm_map_type_t type, | 105 | unsigned int size, enum drm_map_type type, |
106 | drm_map_flags_t flags, drm_map_list_t ** maplist) | 106 | enum drm_map_flags flags, drm_map_list_t ** maplist) |
107 | { | 107 | { |
108 | drm_map_t *map; | 108 | struct drm_map *map; |
109 | drm_map_list_t *list; | 109 | drm_map_list_t *list; |
110 | drm_dma_handle_t *dmah; | 110 | drm_dma_handle_t *dmah; |
111 | unsigned long user_token; | 111 | unsigned long user_token; |
@@ -311,8 +311,8 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset, | |||
311 | } | 311 | } |
312 | 312 | ||
313 | int drm_addmap(drm_device_t * dev, unsigned int offset, | 313 | int drm_addmap(drm_device_t * dev, unsigned int offset, |
314 | unsigned int size, drm_map_type_t type, | 314 | unsigned int size, enum drm_map_type type, |
315 | drm_map_flags_t flags, drm_local_map_t ** map_ptr) | 315 | enum drm_map_flags flags, drm_local_map_t ** map_ptr) |
316 | { | 316 | { |
317 | drm_map_list_t *list; | 317 | drm_map_list_t *list; |
318 | int rc; | 318 | int rc; |
@@ -330,9 +330,9 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp, | |||
330 | { | 330 | { |
331 | drm_file_t *priv = filp->private_data; | 331 | drm_file_t *priv = filp->private_data; |
332 | drm_device_t *dev = priv->head->dev; | 332 | drm_device_t *dev = priv->head->dev; |
333 | drm_map_t map; | 333 | struct drm_map map; |
334 | drm_map_list_t *maplist; | 334 | drm_map_list_t *maplist; |
335 | drm_map_t __user *argp = (void __user *)arg; | 335 | struct drm_map __user *argp = (void __user *)arg; |
336 | int err; | 336 | int err; |
337 | 337 | ||
338 | if (!(filp->f_mode & 3)) | 338 | if (!(filp->f_mode & 3)) |
@@ -351,7 +351,7 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp, | |||
351 | if (err) | 351 | if (err) |
352 | return err; | 352 | return err; |
353 | 353 | ||
354 | if (copy_to_user(argp, maplist->map, sizeof(drm_map_t))) | 354 | if (copy_to_user(argp, maplist->map, sizeof(struct drm_map))) |
355 | return -EFAULT; | 355 | return -EFAULT; |
356 | 356 | ||
357 | /* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */ | 357 | /* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */ |
@@ -367,7 +367,7 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp, | |||
367 | * \param inode device inode. | 367 | * \param inode device inode. |
368 | * \param filp file pointer. | 368 | * \param filp file pointer. |
369 | * \param cmd command. | 369 | * \param cmd command. |
370 | * \param arg pointer to a drm_map_t structure. | 370 | * \param arg pointer to a struct drm_map structure. |
371 | * \return zero on success or a negative value on error. | 371 | * \return zero on success or a negative value on error. |
372 | * | 372 | * |
373 | * Searches the map on drm_device::maplist, removes it from the list, see if | 373 | * Searches the map on drm_device::maplist, removes it from the list, see if |
@@ -451,12 +451,12 @@ int drm_rmmap_ioctl(struct inode *inode, struct file *filp, | |||
451 | { | 451 | { |
452 | drm_file_t *priv = filp->private_data; | 452 | drm_file_t *priv = filp->private_data; |
453 | drm_device_t *dev = priv->head->dev; | 453 | drm_device_t *dev = priv->head->dev; |
454 | drm_map_t request; | 454 | struct drm_map request; |
455 | drm_local_map_t *map = NULL; | 455 | drm_local_map_t *map = NULL; |
456 | drm_map_list_t *r_list; | 456 | drm_map_list_t *r_list; |
457 | int ret; | 457 | int ret; |
458 | 458 | ||
459 | if (copy_from_user(&request, (drm_map_t __user *) arg, sizeof(request))) { | 459 | if (copy_from_user(&request, (struct drm_map __user *) arg, sizeof(request))) { |
460 | return -EFAULT; | 460 | return -EFAULT; |
461 | } | 461 | } |
462 | 462 | ||
@@ -542,14 +542,14 @@ static void drm_cleanup_buf_error(drm_device_t * dev, drm_buf_entry_t * entry) | |||
542 | * Add AGP buffers for DMA transfers. | 542 | * Add AGP buffers for DMA transfers. |
543 | * | 543 | * |
544 | * \param dev drm_device_t to which the buffers are to be added. | 544 | * \param dev drm_device_t to which the buffers are to be added. |
545 | * \param request pointer to a drm_buf_desc_t describing the request. | 545 | * \param request pointer to a struct drm_buf_desc describing the request. |
546 | * \return zero on success or a negative number on failure. | 546 | * \return zero on success or a negative number on failure. |
547 | * | 547 | * |
548 | * After some sanity checks creates a drm_buf structure for each buffer and | 548 | * After some sanity checks creates a drm_buf structure for each buffer and |
549 | * reallocates the buffer list of the same size order to accommodate the new | 549 | * reallocates the buffer list of the same size order to accommodate the new |
550 | * buffers. | 550 | * buffers. |
551 | */ | 551 | */ |
552 | int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request) | 552 | int drm_addbufs_agp(drm_device_t * dev, struct drm_buf_desc * request) |
553 | { | 553 | { |
554 | drm_device_dma_t *dma = dev->dma; | 554 | drm_device_dma_t *dma = dev->dma; |
555 | drm_buf_entry_t *entry; | 555 | drm_buf_entry_t *entry; |
@@ -719,7 +719,7 @@ int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request) | |||
719 | EXPORT_SYMBOL(drm_addbufs_agp); | 719 | EXPORT_SYMBOL(drm_addbufs_agp); |
720 | #endif /* __OS_HAS_AGP */ | 720 | #endif /* __OS_HAS_AGP */ |
721 | 721 | ||
722 | int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request) | 722 | int drm_addbufs_pci(drm_device_t * dev, struct drm_buf_desc * request) |
723 | { | 723 | { |
724 | drm_device_dma_t *dma = dev->dma; | 724 | drm_device_dma_t *dma = dev->dma; |
725 | int count; | 725 | int count; |
@@ -945,7 +945,7 @@ int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request) | |||
945 | } | 945 | } |
946 | EXPORT_SYMBOL(drm_addbufs_pci); | 946 | EXPORT_SYMBOL(drm_addbufs_pci); |
947 | 947 | ||
948 | static int drm_addbufs_sg(drm_device_t * dev, drm_buf_desc_t * request) | 948 | static int drm_addbufs_sg(drm_device_t * dev, struct drm_buf_desc * request) |
949 | { | 949 | { |
950 | drm_device_dma_t *dma = dev->dma; | 950 | drm_device_dma_t *dma = dev->dma; |
951 | drm_buf_entry_t *entry; | 951 | drm_buf_entry_t *entry; |
@@ -1107,7 +1107,7 @@ static int drm_addbufs_sg(drm_device_t * dev, drm_buf_desc_t * request) | |||
1107 | return 0; | 1107 | return 0; |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) | 1110 | static int drm_addbufs_fb(drm_device_t * dev, struct drm_buf_desc * request) |
1111 | { | 1111 | { |
1112 | drm_device_dma_t *dma = dev->dma; | 1112 | drm_device_dma_t *dma = dev->dma; |
1113 | drm_buf_entry_t *entry; | 1113 | drm_buf_entry_t *entry; |
@@ -1274,7 +1274,7 @@ static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) | |||
1274 | * \param inode device inode. | 1274 | * \param inode device inode. |
1275 | * \param filp file pointer. | 1275 | * \param filp file pointer. |
1276 | * \param cmd command. | 1276 | * \param cmd command. |
1277 | * \param arg pointer to a drm_buf_desc_t request. | 1277 | * \param arg pointer to a struct drm_buf_desc request. |
1278 | * \return zero on success or a negative number on failure. | 1278 | * \return zero on success or a negative number on failure. |
1279 | * | 1279 | * |
1280 | * According with the memory type specified in drm_buf_desc::flags and the | 1280 | * According with the memory type specified in drm_buf_desc::flags and the |
@@ -1285,7 +1285,7 @@ static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) | |||
1285 | int drm_addbufs(struct inode *inode, struct file *filp, | 1285 | int drm_addbufs(struct inode *inode, struct file *filp, |
1286 | unsigned int cmd, unsigned long arg) | 1286 | unsigned int cmd, unsigned long arg) |
1287 | { | 1287 | { |
1288 | drm_buf_desc_t request; | 1288 | struct drm_buf_desc request; |
1289 | drm_file_t *priv = filp->private_data; | 1289 | drm_file_t *priv = filp->private_data; |
1290 | drm_device_t *dev = priv->head->dev; | 1290 | drm_device_t *dev = priv->head->dev; |
1291 | int ret; | 1291 | int ret; |
@@ -1293,7 +1293,7 @@ int drm_addbufs(struct inode *inode, struct file *filp, | |||
1293 | if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) | 1293 | if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) |
1294 | return -EINVAL; | 1294 | return -EINVAL; |
1295 | 1295 | ||
1296 | if (copy_from_user(&request, (drm_buf_desc_t __user *) arg, | 1296 | if (copy_from_user(&request, (struct drm_buf_desc __user *) arg, |
1297 | sizeof(request))) | 1297 | sizeof(request))) |
1298 | return -EFAULT; | 1298 | return -EFAULT; |
1299 | 1299 | ||
@@ -1340,8 +1340,8 @@ int drm_infobufs(struct inode *inode, struct file *filp, | |||
1340 | drm_file_t *priv = filp->private_data; | 1340 | drm_file_t *priv = filp->private_data; |
1341 | drm_device_t *dev = priv->head->dev; | 1341 | drm_device_t *dev = priv->head->dev; |
1342 | drm_device_dma_t *dma = dev->dma; | 1342 | drm_device_dma_t *dma = dev->dma; |
1343 | drm_buf_info_t request; | 1343 | struct drm_buf_info request; |
1344 | drm_buf_info_t __user *argp = (void __user *)arg; | 1344 | struct drm_buf_info __user *argp = (void __user *)arg; |
1345 | int i; | 1345 | int i; |
1346 | int count; | 1346 | int count; |
1347 | 1347 | ||
@@ -1372,7 +1372,7 @@ int drm_infobufs(struct inode *inode, struct file *filp, | |||
1372 | if (request.count >= count) { | 1372 | if (request.count >= count) { |
1373 | for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) { | 1373 | for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) { |
1374 | if (dma->bufs[i].buf_count) { | 1374 | if (dma->bufs[i].buf_count) { |
1375 | drm_buf_desc_t __user *to = | 1375 | struct drm_buf_desc __user *to = |
1376 | &request.list[count]; | 1376 | &request.list[count]; |
1377 | drm_buf_entry_t *from = &dma->bufs[i]; | 1377 | drm_buf_entry_t *from = &dma->bufs[i]; |
1378 | drm_freelist_t *list = &dma->bufs[i].freelist; | 1378 | drm_freelist_t *list = &dma->bufs[i].freelist; |
@@ -1428,7 +1428,7 @@ int drm_markbufs(struct inode *inode, struct file *filp, | |||
1428 | drm_file_t *priv = filp->private_data; | 1428 | drm_file_t *priv = filp->private_data; |
1429 | drm_device_t *dev = priv->head->dev; | 1429 | drm_device_t *dev = priv->head->dev; |
1430 | drm_device_dma_t *dma = dev->dma; | 1430 | drm_device_dma_t *dma = dev->dma; |
1431 | drm_buf_desc_t request; | 1431 | struct drm_buf_desc request; |
1432 | int order; | 1432 | int order; |
1433 | drm_buf_entry_t *entry; | 1433 | drm_buf_entry_t *entry; |
1434 | 1434 | ||
@@ -1439,7 +1439,7 @@ int drm_markbufs(struct inode *inode, struct file *filp, | |||
1439 | return -EINVAL; | 1439 | return -EINVAL; |
1440 | 1440 | ||
1441 | if (copy_from_user(&request, | 1441 | if (copy_from_user(&request, |
1442 | (drm_buf_desc_t __user *) arg, sizeof(request))) | 1442 | (struct drm_buf_desc __user *) arg, sizeof(request))) |
1443 | return -EFAULT; | 1443 | return -EFAULT; |
1444 | 1444 | ||
1445 | DRM_DEBUG("%d, %d, %d\n", | 1445 | DRM_DEBUG("%d, %d, %d\n", |
@@ -1478,7 +1478,7 @@ int drm_freebufs(struct inode *inode, struct file *filp, | |||
1478 | drm_file_t *priv = filp->private_data; | 1478 | drm_file_t *priv = filp->private_data; |
1479 | drm_device_t *dev = priv->head->dev; | 1479 | drm_device_t *dev = priv->head->dev; |
1480 | drm_device_dma_t *dma = dev->dma; | 1480 | drm_device_dma_t *dma = dev->dma; |
1481 | drm_buf_free_t request; | 1481 | struct drm_buf_free request; |
1482 | int i; | 1482 | int i; |
1483 | int idx; | 1483 | int idx; |
1484 | drm_buf_t *buf; | 1484 | drm_buf_t *buf; |
@@ -1490,7 +1490,7 @@ int drm_freebufs(struct inode *inode, struct file *filp, | |||
1490 | return -EINVAL; | 1490 | return -EINVAL; |
1491 | 1491 | ||
1492 | if (copy_from_user(&request, | 1492 | if (copy_from_user(&request, |
1493 | (drm_buf_free_t __user *) arg, sizeof(request))) | 1493 | (struct drm_buf_free __user *) arg, sizeof(request))) |
1494 | return -EFAULT; | 1494 | return -EFAULT; |
1495 | 1495 | ||
1496 | DRM_DEBUG("%d\n", request.count); | 1496 | DRM_DEBUG("%d\n", request.count); |
@@ -1534,12 +1534,12 @@ int drm_mapbufs(struct inode *inode, struct file *filp, | |||
1534 | drm_file_t *priv = filp->private_data; | 1534 | drm_file_t *priv = filp->private_data; |
1535 | drm_device_t *dev = priv->head->dev; | 1535 | drm_device_t *dev = priv->head->dev; |
1536 | drm_device_dma_t *dma = dev->dma; | 1536 | drm_device_dma_t *dma = dev->dma; |
1537 | drm_buf_map_t __user *argp = (void __user *)arg; | 1537 | struct drm_buf_map __user *argp = (void __user *)arg; |
1538 | int retcode = 0; | 1538 | int retcode = 0; |
1539 | const int zero = 0; | 1539 | const int zero = 0; |
1540 | unsigned long virtual; | 1540 | unsigned long virtual; |
1541 | unsigned long address; | 1541 | unsigned long address; |
1542 | drm_buf_map_t request; | 1542 | struct drm_buf_map request; |
1543 | int i; | 1543 | int i; |
1544 | 1544 | ||
1545 | if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) | 1545 | if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) |
@@ -1565,7 +1565,7 @@ int drm_mapbufs(struct inode *inode, struct file *filp, | |||
1565 | && (dma->flags & _DRM_DMA_USE_SG)) | 1565 | && (dma->flags & _DRM_DMA_USE_SG)) |
1566 | || (drm_core_check_feature(dev, DRIVER_FB_DMA) | 1566 | || (drm_core_check_feature(dev, DRIVER_FB_DMA) |
1567 | && (dma->flags & _DRM_DMA_USE_FB))) { | 1567 | && (dma->flags & _DRM_DMA_USE_FB))) { |
1568 | drm_map_t *map = dev->agp_buffer_map; | 1568 | struct drm_map *map = dev->agp_buffer_map; |
1569 | unsigned long token = dev->agp_buffer_token; | 1569 | unsigned long token = dev->agp_buffer_token; |
1570 | 1570 | ||
1571 | if (!map) { | 1571 | if (!map) { |