Commit c60ce623 authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave Airlie <airlied@linux.ie>
parent c6c656b4
This diff is collapsed.
...@@ -395,7 +395,7 @@ typedef struct drm_queue { ...@@ -395,7 +395,7 @@ typedef struct drm_queue {
atomic_t total_flushed; /**< Total flushes statistic */ atomic_t total_flushed; /**< Total flushes statistic */
atomic_t total_locks; /**< Total locks statistics */ atomic_t total_locks; /**< Total locks statistics */
#endif #endif
drm_ctx_flags_t flags; /**< Context preserving and 2D-only */ enum drm_ctx_flags flags; /**< Context preserving and 2D-only */
drm_waitlist_t waitlist; /**< Pending buffers */ drm_waitlist_t waitlist; /**< Pending buffers */
wait_queue_head_t flush_queue; /**< Processes waiting until flush */ wait_queue_head_t flush_queue; /**< Processes waiting until flush */
} drm_queue_t; } drm_queue_t;
...@@ -404,7 +404,7 @@ typedef struct drm_queue { ...@@ -404,7 +404,7 @@ typedef struct drm_queue {
* Lock data. * Lock data.
*/ */
typedef struct drm_lock_data { typedef struct drm_lock_data {
drm_hw_lock_t *hw_lock; /**< Hardware lock */ struct drm_hw_lock *hw_lock; /**< Hardware lock */
struct file *filp; /**< File descr of lock holder (0=kernel) */ struct file *filp; /**< File descr of lock holder (0=kernel) */
wait_queue_head_t lock_queue; /**< Queue of blocked processes */ wait_queue_head_t lock_queue; /**< Queue of blocked processes */
unsigned long lock_time; /**< Time of last lock in jiffies */ unsigned long lock_time; /**< Time of last lock in jiffies */
...@@ -477,7 +477,7 @@ typedef struct drm_sg_mem { ...@@ -477,7 +477,7 @@ typedef struct drm_sg_mem {
typedef struct drm_sigdata { typedef struct drm_sigdata {
int context; int context;
drm_hw_lock_t *lock; struct drm_hw_lock *lock;
} drm_sigdata_t; } drm_sigdata_t;
/** /**
...@@ -486,11 +486,11 @@ typedef struct drm_sigdata { ...@@ -486,11 +486,11 @@ typedef struct drm_sigdata {
typedef struct drm_map_list { typedef struct drm_map_list {
struct list_head head; /**< list head */ struct list_head head; /**< list head */
drm_hash_item_t hash; drm_hash_item_t hash;
drm_map_t *map; /**< mapping */ struct drm_map *map; /**< mapping */
unsigned int user_token; unsigned int user_token;
} drm_map_list_t; } drm_map_list_t;
typedef drm_map_t drm_local_map_t; typedef struct drm_map drm_local_map_t;
/** /**
* Context handle list * Context handle list
...@@ -594,9 +594,10 @@ struct drm_driver { ...@@ -594,9 +594,10 @@ struct drm_driver {
struct file *filp); struct file *filp);
void (*reclaim_buffers_idlelocked) (struct drm_device *dev, void (*reclaim_buffers_idlelocked) (struct drm_device *dev,
struct file * filp); struct file * filp);
unsigned long (*get_map_ofs) (drm_map_t * map); unsigned long (*get_map_ofs) (struct drm_map * map);
unsigned long (*get_reg_ofs) (struct drm_device * dev); unsigned long (*get_reg_ofs) (struct drm_device * dev);
void (*set_version) (struct drm_device * dev, drm_set_version_t * sv); void (*set_version) (struct drm_device * dev,
struct drm_set_version *sv);
int major; int major;
int minor; int minor;
...@@ -656,7 +657,7 @@ typedef struct drm_device { ...@@ -656,7 +657,7 @@ typedef struct drm_device {
/** \name Performance counters */ /** \name Performance counters */
/*@{ */ /*@{ */
unsigned long counters; unsigned long counters;
drm_stat_type_t types[15]; enum drm_stat_type types[15];
atomic_t counts[15]; atomic_t counts[15];
/*@} */ /*@} */
...@@ -679,7 +680,7 @@ typedef struct drm_device { ...@@ -679,7 +680,7 @@ typedef struct drm_device {
int ctx_count; /**< Number of context handles */ int ctx_count; /**< Number of context handles */
struct mutex ctxlist_mutex; /**< For ctxlist */ struct mutex ctxlist_mutex; /**< For ctxlist */
drm_map_t **context_sareas; /**< per-context SAREA's */ struct drm_map **context_sareas; /**< per-context SAREA's */
int max_context; int max_context;
struct list_head vmalist; /**< List of vmas (for debugging) */ struct list_head vmalist; /**< List of vmas (for debugging) */
...@@ -756,7 +757,7 @@ typedef struct drm_device { ...@@ -756,7 +757,7 @@ typedef struct drm_device {
unsigned int drw_bitfield_length; unsigned int drw_bitfield_length;
u32 *drw_bitfield; u32 *drw_bitfield;
unsigned int drw_info_length; unsigned int drw_info_length;
drm_drawable_info_t **drw_info; struct drm_drawable_info **drw_info;
/*@} */ /*@} */
} drm_device_t; } drm_device_t;
...@@ -904,7 +905,7 @@ extern int drm_rmdraw(struct inode *inode, struct file *filp, ...@@ -904,7 +905,7 @@ extern int drm_rmdraw(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern int drm_update_drawable_info(struct inode *inode, struct file *filp, extern int drm_update_drawable_info(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern drm_drawable_info_t *drm_get_drawable_info(drm_device_t *dev, extern struct drm_drawable_info *drm_get_drawable_info(drm_device_t *dev,
drm_drawable_t id); drm_drawable_t id);
/* Authentication IOCTL support (drm_auth.h) */ /* Authentication IOCTL support (drm_auth.h) */
...@@ -932,11 +933,11 @@ extern int drm_i_have_hw_lock(struct file *filp); ...@@ -932,11 +933,11 @@ extern int drm_i_have_hw_lock(struct file *filp);
extern int drm_kernel_take_hw_lock(struct file *filp); extern int drm_kernel_take_hw_lock(struct file *filp);
/* Buffer management support (drm_bufs.h) */ /* Buffer management support (drm_bufs.h) */
extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request); extern int drm_addbufs_agp(drm_device_t * dev, struct drm_buf_desc * request);
extern int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request); extern int drm_addbufs_pci(drm_device_t * dev, struct drm_buf_desc * request);
extern int drm_addmap(drm_device_t * dev, unsigned int offset, extern int drm_addmap(drm_device_t * dev, unsigned int offset,
unsigned int size, drm_map_type_t type, unsigned int size, enum drm_map_type type,
drm_map_flags_t flags, drm_local_map_t ** map_ptr); enum drm_map_flags flags, drm_local_map_t ** map_ptr);
extern int drm_addmap_ioctl(struct inode *inode, struct file *filp, extern int drm_addmap_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern int drm_rmmap(drm_device_t * dev, drm_local_map_t * map); extern int drm_rmmap(drm_device_t * dev, drm_local_map_t * map);
...@@ -989,22 +990,22 @@ extern int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp, ...@@ -989,22 +990,22 @@ extern int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp,
extern int drm_agp_release(drm_device_t * dev); extern int drm_agp_release(drm_device_t * dev);
extern int drm_agp_release_ioctl(struct inode *inode, struct file *filp, extern int drm_agp_release_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern int drm_agp_enable(drm_device_t * dev, drm_agp_mode_t mode); extern int drm_agp_enable(drm_device_t * dev, struct drm_agp_mode mode);
extern int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, extern int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern int drm_agp_info(drm_device_t * dev, drm_agp_info_t * info); extern int drm_agp_info(drm_device_t * dev, struct drm_agp_info * info);
extern int drm_agp_info_ioctl(struct inode *inode, struct file *filp, extern int drm_agp_info_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern int drm_agp_alloc(drm_device_t *dev, drm_agp_buffer_t *request); extern int drm_agp_alloc(drm_device_t *dev, struct drm_agp_buffer *request);
extern int drm_agp_alloc_ioctl(struct inode *inode, struct file *filp, extern int drm_agp_alloc_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern int drm_agp_free(drm_device_t *dev, drm_agp_buffer_t *request); extern int drm_agp_free(drm_device_t *dev, struct drm_agp_buffer *request);
extern int drm_agp_free_ioctl(struct inode *inode, struct file *filp, extern int drm_agp_free_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern int drm_agp_unbind(drm_device_t *dev, drm_agp_binding_t *request); extern int drm_agp_unbind(drm_device_t *dev, struct drm_agp_binding *request);
extern int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp, extern int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern int drm_agp_bind(drm_device_t *dev, drm_agp_binding_t *request); extern int drm_agp_bind(drm_device_t *dev, struct drm_agp_binding *request);
extern int drm_agp_bind_ioctl(struct inode *inode, struct file *filp, extern int drm_agp_bind_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge,
...@@ -1137,7 +1138,7 @@ extern void *drm_calloc(size_t nmemb, size_t size, int area); ...@@ -1137,7 +1138,7 @@ extern void *drm_calloc(size_t nmemb, size_t size, int area);
/*@}*/ /*@}*/
extern unsigned long drm_core_get_map_ofs(drm_map_t * map); extern unsigned long drm_core_get_map_ofs(struct drm_map * map);
extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev); extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
* Verifies the AGP device has been initialized and acquired and fills in the * Verifies the AGP device has been initialized and acquired and fills in the
* drm_agp_info structure with the information in drm_agp_head::agp_info. * drm_agp_info structure with the information in drm_agp_head::agp_info.
*/ */
int drm_agp_info(drm_device_t * dev, drm_agp_info_t * info) int drm_agp_info(drm_device_t * dev, struct drm_agp_info * info)
{ {
DRM_AGP_KERN *kern; DRM_AGP_KERN *kern;
...@@ -76,14 +76,14 @@ int drm_agp_info_ioctl(struct inode *inode, struct file *filp, ...@@ -76,14 +76,14 @@ int drm_agp_info_ioctl(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_agp_info_t info; struct drm_agp_info info;
int err; int err;
err = drm_agp_info(dev, &info); err = drm_agp_info(dev, &info);
if (err) if (err)
return err; return err;
if (copy_to_user((drm_agp_info_t __user *) arg, &info, sizeof(info))) if (copy_to_user((struct drm_agp_info __user *) arg, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -168,7 +168,7 @@ int drm_agp_release_ioctl(struct inode *inode, struct file *filp, ...@@ -168,7 +168,7 @@ int drm_agp_release_ioctl(struct inode *inode, struct file *filp,
* Verifies the AGP device has been acquired but not enabled, and calls * Verifies the AGP device has been acquired but not enabled, and calls
* \c agp_enable. * \c agp_enable.
*/ */
int drm_agp_enable(drm_device_t * dev, drm_agp_mode_t mode) int drm_agp_enable(drm_device_t * dev, struct drm_agp_mode mode)
{ {
if (!dev->agp || !dev->agp->acquired) if (!dev->agp || !dev->agp->acquired)
return -EINVAL; return -EINVAL;
...@@ -187,9 +187,9 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, ...@@ -187,9 +187,9 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_agp_mode_t mode; struct drm_agp_mode mode;
if (copy_from_user(&mode, (drm_agp_mode_t __user *) arg, sizeof(mode))) if (copy_from_user(&mode, (struct drm_agp_mode __user *) arg, sizeof(mode)))
return -EFAULT; return -EFAULT;
return drm_agp_enable(dev, mode); return drm_agp_enable(dev, mode);
...@@ -207,7 +207,7 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, ...@@ -207,7 +207,7 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
* Verifies the AGP device is present and has been acquired, allocates the * Verifies the AGP device is present and has been acquired, allocates the
* memory via alloc_agp() and creates a drm_agp_mem entry for it. * memory via alloc_agp() and creates a drm_agp_mem entry for it.
*/ */
int drm_agp_alloc(drm_device_t *dev, drm_agp_buffer_t *request) int drm_agp_alloc(drm_device_t *dev, struct drm_agp_buffer *request)
{ {
drm_agp_mem_t *entry; drm_agp_mem_t *entry;
DRM_AGP_MEM *memory; DRM_AGP_MEM *memory;
...@@ -246,8 +246,8 @@ int drm_agp_alloc_ioctl(struct inode *inode, struct file *filp, ...@@ -246,8 +246,8 @@ int drm_agp_alloc_ioctl(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_agp_buffer_t request; struct drm_agp_buffer request;
drm_agp_buffer_t __user *argp = (void __user *)arg; struct drm_agp_buffer __user *argp = (void __user *)arg;
int err; int err;
if (copy_from_user(&request, argp, sizeof(request))) if (copy_from_user(&request, argp, sizeof(request)))
...@@ -305,7 +305,7 @@ static drm_agp_mem_t *drm_agp_lookup_entry(drm_device_t * dev, ...@@ -305,7 +305,7 @@ static drm_agp_mem_t *drm_agp_lookup_entry(drm_device_t * dev,
* Verifies the AGP device is present and acquired, looks-up the AGP memory * Verifies the AGP device is present and acquired, looks-up the AGP memory
* entry and passes it to the unbind_agp() function. * entry and passes it to the unbind_agp() function.
*/ */
int drm_agp_unbind(drm_device_t *dev, drm_agp_binding_t *request) int drm_agp_unbind(drm_device_t *dev, struct drm_agp_binding *request)
{ {
drm_agp_mem_t *entry; drm_agp_mem_t *entry;
int ret; int ret;
...@@ -328,10 +328,10 @@ int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp, ...@@ -328,10 +328,10 @@ int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_agp_binding_t request; struct drm_agp_binding request;
if (copy_from_user if (copy_from_user
(&request, (drm_agp_binding_t __user *) arg, sizeof(request))) (&request, (struct drm_agp_binding __user *) arg, sizeof(request)))
return -EFAULT; return -EFAULT;
return drm_agp_unbind(dev, &request); return drm_agp_unbind(dev, &request);
...@@ -350,7 +350,7 @@ int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp, ...@@ -350,7 +350,7 @@ int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp,
* is currently bound into the GATT. Looks-up the AGP memory entry and passes * is currently bound into the GATT. Looks-up the AGP memory entry and passes
* it to bind_agp() function. * it to bind_agp() function.
*/ */
int drm_agp_bind(drm_device_t *dev, drm_agp_binding_t *request) int drm_agp_bind(drm_device_t *dev, struct drm_agp_binding *request)
{ {
drm_agp_mem_t *entry; drm_agp_mem_t *entry;
int retcode; int retcode;
...@@ -377,10 +377,10 @@ int drm_agp_bind_ioctl(struct inode *inode, struct file *filp, ...@@ -377,10 +377,10 @@ int drm_agp_bind_ioctl(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_agp_binding_t request; struct drm_agp_binding request;
if (copy_from_user if (copy_from_user
(&request, (drm_agp_binding_t __user *) arg, sizeof(request))) (&request, (struct drm_agp_binding __user *) arg, sizeof(request)))
return -EFAULT; return -EFAULT;
return drm_agp_bind(dev, &request); return drm_agp_bind(dev, &request);
...@@ -400,7 +400,7 @@ int drm_agp_bind_ioctl(struct inode *inode, struct file *filp, ...@@ -400,7 +400,7 @@ int drm_agp_bind_ioctl(struct inode *inode, struct file *filp,
* unbind_agp(). Frees it via free_agp() as well as the entry itself * unbind_agp(). Frees it via free_agp() as well as the entry itself
* and unlinks from the doubly linked list it's inserted in. * and unlinks from the doubly linked list it's inserted in.
*/ */
int drm_agp_free(drm_device_t *dev, drm_agp_buffer_t *request) int drm_agp_free(drm_device_t *dev, struct drm_agp_buffer *request)
{ {
drm_agp_mem_t *entry; drm_agp_mem_t *entry;
...@@ -424,10 +424,10 @@ int drm_agp_free_ioctl(struct inode *inode, struct file *filp, ...@@ -424,10 +424,10 @@ int drm_agp_free_ioctl(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_agp_buffer_t request; struct drm_agp_buffer request;
if (copy_from_user if (copy_from_user
(&request, (drm_agp_buffer_t __user *) arg, sizeof(request))) (&request, (struct drm_agp_buffer __user *) arg, sizeof(request)))
return -EFAULT; return -EFAULT;
return drm_agp_free(dev, &request); return drm_agp_free(dev, &request);
......
...@@ -144,7 +144,7 @@ int drm_getmagic(struct inode *inode, struct file *filp, ...@@ -144,7 +144,7 @@ int drm_getmagic(struct inode *inode, struct file *filp,
static DEFINE_SPINLOCK(lock); static DEFINE_SPINLOCK(lock);
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_auth_t auth; struct drm_auth auth;
/* Find unique magic */ /* Find unique magic */
if (priv->magic) { if (priv->magic) {
...@@ -162,7 +162,7 @@ int drm_getmagic(struct inode *inode, struct file *filp, ...@@ -162,7 +162,7 @@ int drm_getmagic(struct inode *inode, struct file *filp,
} }
DRM_DEBUG("%u\n", auth.magic); DRM_DEBUG("%u\n", auth.magic);
if (copy_to_user((drm_auth_t __user *) arg, &auth, sizeof(auth))) if (copy_to_user((struct drm_auth __user *) arg, &auth, sizeof(auth)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -183,10 +183,10 @@ int drm_authmagic(struct inode *inode, struct file *filp, ...@@ -183,10 +183,10 @@ int drm_authmagic(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_auth_t auth; struct drm_auth auth;
drm_file_t *file; drm_file_t *file;
if (copy_from_user(&auth, (drm_auth_t __user *) arg, sizeof(auth))) if (copy_from_user(&auth, (struct drm_auth __user *) arg, sizeof(auth)))
return -EFAULT; return -EFAULT;
DRM_DEBUG("%u\n", auth.magic); DRM_DEBUG("%u\n", auth.magic);
if ((file = drm_find_file(dev, auth.magic))) { if ((file = drm_find_file(dev, auth.magic))) {
......
...@@ -102,10 +102,10 @@ static int drm_map_handle(drm_device_t *dev, drm_hash_item_t *hash, ...@@ -102,10 +102,10 @@ static int drm_map_handle(drm_device_t *dev, drm_hash_item_t *hash,
* applicable and if supported by the kernel. * applicable and if supported by the kernel.
*/ */
static int drm_addmap_core(drm_device_t * dev, unsigned int offset, static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
unsigned int size, drm_map_type_t type, unsigned int size, enum drm_map_type type,
drm_map_flags_t flags, drm_map_list_t ** maplist) enum drm_map_flags flags, drm_map_list_t ** maplist)
{ {
drm_map_t *map; struct drm_map *map;
drm_map_list_t *list; drm_map_list_t *list;
drm_dma_handle_t *dmah; drm_dma_handle_t *dmah;
unsigned long user_token; unsigned long user_token;
...@@ -311,8 +311,8 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset, ...@@ -311,8 +311,8 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
} }
int drm_addmap(drm_device_t * dev, unsigned int offset, int drm_addmap(drm_device_t * dev, unsigned int offset,
unsigned int size, drm_map_type_t type, unsigned int size, enum drm_map_type type,
drm_map_flags_t flags, drm_local_map_t ** map_ptr) enum drm_map_flags flags, drm_local_map_t ** map_ptr)
{ {
drm_map_list_t *list; drm_map_list_t *list;
int rc; int rc;
...@@ -330,9 +330,9 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp, ...@@ -330,9 +330,9 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_map_t map; struct drm_map map;
drm_map_list_t *maplist; drm_map_list_t *maplist;
drm_map_t __user *argp = (void __user *)arg; struct drm_map __user *argp = (void __user *)arg;
int err; int err;
if (!(filp->f_mode & 3)) if (!(filp->f_mode & 3))
...@@ -351,7 +351,7 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp, ...@@ -351,7 +351,7 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
if (err) if (err)
return err; return err;
if (copy_to_user(argp, maplist->map, sizeof(drm_map_t))) if (copy_to_user(argp, maplist->map, sizeof(struct drm_map)))
return -EFAULT; return -EFAULT;
/* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */ /* 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,7 +367,7 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
* \param inode device inode. * \param inode device inode.
* \param filp file pointer. * \param filp file pointer.
* \param cmd command. * \param cmd command.
* \param arg pointer to a drm_map_t structure. * \param arg pointer to a struct drm_map structure.
* \return zero on success or a negative value on error. * \return zero on success or a negative value on error.
* *
* Searches the map on drm_device::maplist, removes it from the list, see if * 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,12 +451,12 @@ int drm_rmmap_ioctl(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_map_t request; struct drm_map request;
drm_local_map_t *map = NULL; drm_local_map_t *map = NULL;
drm_map_list_t *r_list; drm_map_list_t *r_list;
int ret; int ret;
if (copy_from_user(&request, (drm_map_t __user *) arg, sizeof(request))) { if (copy_from_user(&request, (struct drm_map __user *) arg, sizeof(request))) {
return -EFAULT; return -EFAULT;
} }
...@@ -542,14 +542,14 @@ static void drm_cleanup_buf_error(drm_device_t * dev, drm_buf_entry_t * entry) ...@@ -542,14 +542,14 @@ static void drm_cleanup_buf_error(drm_device_t * dev, drm_buf_entry_t * entry)
* Add AGP buffers for DMA transfers. * Add AGP buffers for DMA transfers.
* *
* \param dev drm_device_t to which the buffers are to be added. * \param dev drm_device_t to which the buffers are to be added.
* \param request pointer to a drm_buf_desc_t describing the request. * \param request pointer to a struct drm_buf_desc describing the request.
* \return zero on success or a negative number on failure. * \return zero on success or a negative number on failure.
* *
* After some sanity checks creates a drm_buf structure for each buffer and * After some sanity checks creates a drm_buf structure for each buffer and
* reallocates the buffer list of the same size order to accommodate the new * reallocates the buffer list of the same size order to accommodate the new
* buffers. * buffers.
*/ */
int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request) int drm_addbufs_agp(drm_device_t * dev, struct drm_buf_desc * request)
{ {
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_buf_entry_t *entry; drm_buf_entry_t *entry;
...@@ -719,7 +719,7 @@ int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request) ...@@ -719,7 +719,7 @@ int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request)
EXPORT_SYMBOL(drm_addbufs_agp); EXPORT_SYMBOL(drm_addbufs_agp);
#endif /* __OS_HAS_AGP */ #endif /* __OS_HAS_AGP */
int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request) int drm_addbufs_pci(drm_device_t * dev, struct drm_buf_desc * request)
{ {
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
int count; int count;
...@@ -945,7 +945,7 @@ int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request) ...@@ -945,7 +945,7 @@ int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request)
} }
EXPORT_SYMBOL(drm_addbufs_pci); EXPORT_SYMBOL(drm_addbufs_pci);
static int drm_addbufs_sg(drm_device_t * dev, drm_buf_desc_t * request) static int drm_addbufs_sg(drm_device_t * dev, struct drm_buf_desc * request)
{ {
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_buf_entry_t *entry; drm_buf_entry_t *entry;
...@@ -1107,7 +1107,7 @@ static int drm_addbufs_sg(drm_device_t * dev, drm_buf_desc_t * request) ...@@ -1107,7 +1107,7 @@ static int drm_addbufs_sg(drm_device_t * dev, drm_buf_desc_t * request)
return 0; return 0;
} }
static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) static int drm_addbufs_fb(drm_device_t * dev, struct drm_buf_desc * request)
{ {
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_buf_entry_t *entry; drm_buf_entry_t *entry;
...@@ -1274,7 +1274,7 @@ static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) ...@@ -1274,7 +1274,7 @@ static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)
* \param inode device inode. * \param inode device inode.
* \param filp file pointer. * \param filp file pointer.
* \param cmd command. * \param cmd command.
* \param arg pointer to a drm_buf_desc_t request. * \param arg pointer to a struct drm_buf_desc request.
* \return zero on success or a negative number on failure. * \return zero on success or a negative number on failure.
* *
* According with the memory type specified in drm_buf_desc::flags and the * 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,7 +1285,7 @@ static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)
int drm_addbufs(struct inode *inode, struct file *filp, int drm_addbufs(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
drm_buf_desc_t request; struct drm_buf_desc request;
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
int ret; int ret;
...@@ -1293,7 +1293,7 @@ int drm_addbufs(struct inode *inode, struct file *filp, ...@@ -1293,7 +1293,7 @@ int drm_addbufs(struct inode *inode, struct file *filp,
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
return -EINVAL; return -EINVAL;
if (copy_from_user(&request, (drm_buf_desc_t __user *) arg, if (copy_from_user(&request, (struct drm_buf_desc __user *) arg,
sizeof(request))) sizeof(request)))
return -EFAULT; return -EFAULT;
...@@ -1340,8 +1340,8 @@ int drm_infobufs(struct inode *inode, struct file *filp, ...@@ -1340,8 +1340,8 @@ int drm_infobufs(struct inode *inode, struct file *filp,
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_buf_info_t request; struct drm_buf_info request;
drm_buf_info_t __user *argp = (void __user *)arg; struct drm_buf_info __user *argp = (void __user *)arg;
int i; int i;
int count; int count;
...@@ -1372,7 +1372,7 @@ int drm_infobufs(struct inode *inode, struct file *filp, ...@@ -1372,7 +1372,7 @@ int drm_infobufs(struct inode *inode, struct file *filp,
if (request.count >= count) { if (request.count >= count) {
for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) { for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) {
if (dma->bufs[i].buf_count) { if (dma->bufs[i].buf_count) {
drm_buf_desc_t __user *to = struct drm_buf_desc __user *to =
&request.list[count]; &request.list[count];
drm_buf_entry_t *from = &dma->bufs[i]; drm_buf_entry_t *from = &dma->bufs[i];
drm_freelist_t *list = &dma->bufs[i].freelist; drm_freelist_t *list = &dma->bufs[i].freelist;
...@@ -1428,7 +1428,7 @@ int drm_markbufs(struct inode *inode, struct file *filp, ...@@ -1428,7 +1428,7 @@ int drm_markbufs(struct inode *inode, struct file *filp,
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_buf_desc_t request; struct drm_buf_desc request;
int order; int order;
drm_buf_entry_t *entry; drm_buf_entry_t *entry;
...@@ -1439,7 +1439,7 @@ int drm_markbufs(struct inode *inode, struct file *filp, ...@@ -1439,7 +1439,7 @@ int drm_markbufs(struct inode *inode, struct file *filp,
return -EINVAL; return -EINVAL;
if (copy_from_user(&request, if (copy_from_user(&request,
(drm_buf_desc_t __user *) arg, sizeof(request))) (struct drm_buf_desc __user *) arg, sizeof(request)))
return -EFAULT; return -EFAULT;
DRM_DEBUG("%d, %d, %d\n", DRM_DEBUG("%d, %d, %d\n",
...@@ -1478,7 +1478,7 @@ int drm_freebufs(struct inode *inode, struct file *filp, ...@@ -1478,7 +1478,7 @@ int drm_freebufs(struct inode *inode, struct file *filp,
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_buf_free_t request; struct drm_buf_free request;
int i; int i;
int idx; int idx;
drm_buf_t *buf; drm_buf_t *buf;
...@@ -1490,7 +1490,7 @@ int drm_freebufs(struct inode *inode, struct file *filp, ...@@ -1490,7 +1490,7 @@ int drm_freebufs(struct inode *inode, struct file *filp,
return -EINVAL; return -EINVAL;
if (copy_from_user(&request, if (copy_from_user(&request,
(drm_buf_free_t __user *) arg, sizeof(request))) (struct drm_buf_free __user *) arg, sizeof(request)))
return -EFAULT; return -EFAULT;
DRM_DEBUG("%d\n", request.count); DRM_DEBUG("%d\n", request.count);
...@@ -1534,12 +1534,12 @@ int drm_mapbufs(struct inode *inode, struct file *filp, ...@@ -1534,12 +1534,12 @@ int drm_mapbufs(struct inode *inode, struct file *filp,
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_buf_map_t __user *argp = (void __user *)arg; struct drm_buf_map __user *argp = (void __user *)arg;
int retcode = 0; int retcode = 0;
const int zero = 0; const int zero = 0;
unsigned long virtual; unsigned long virtual;
unsigned long address; unsigned long address;
drm_buf_map_t request; struct drm_buf_map request;
int i; int i;
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
...@@ -1565,7 +1565,7 @@ int drm_mapbufs(struct inode *inode, struct file *filp, ...@@ -1565,7 +1565,7 @@ int drm_mapbufs(struct inode *inode, struct file *filp,
&& (dma->flags & _DRM_DMA_USE_SG)) && (dma->flags & _DRM_DMA_USE_SG))
|| (drm_core_check_feature(dev, DRIVER_FB_DMA) || (drm_core_check_feature(dev, DRIVER_FB_DMA)
&& (dma->flags & _DRM_DMA_USE_FB))) { && (dma->flags & _DRM_DMA_USE_FB))) {
drm_map_t *map = dev->agp_buffer_map; struct drm_map *map = dev->agp_buffer_map;
unsigned long token = dev->agp_buffer_token; unsigned long token = dev->agp_buffer_token;
if (!map) { if (!map) {
......
...@@ -100,7 +100,7 @@ static int drm_ctxbitmap_next(drm_device_t * dev) ...@@ -100,7 +100,7 @@ static int drm_ctxbitmap_next(drm_device_t * dev)
if ((bit + 1) > dev->max_context) { if ((bit + 1) > dev->max_context) {
dev->max_context = (bit + 1); dev->max_context = (bit + 1);
if (dev->context_sareas) { if (dev->context_sareas) {
drm_map_t **ctx_sareas; struct drm_map **ctx_sareas;
ctx_sareas = drm_realloc(dev->context_sareas, ctx_sareas = drm_realloc(dev->context_sareas,
(dev->max_context - (dev->max_context -
...@@ -214,9 +214,9 @@ int drm_getsareactx(struct inode *inode, struct file *filp, ...@@ -214,9 +214,9 @@ int drm_getsareactx(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_ctx_priv_map_t __user *argp = (void __user *)arg; struct drm_ctx_priv_map __user *argp = (void __user *)arg;
drm_ctx_priv_map_t request; struct drm_ctx_priv_map request;
drm_map_t *map; struct drm_map *map;
drm_map_list_t *_entry; drm_map_list_t *_entry;
if (copy_from_user(&request, argp, sizeof(request))) if (copy_from_user(&request, argp, sizeof(request)))
...@@ -265,12 +265,13 @@ int drm_setsareactx(struct inode *inode, struct file *filp, ...@@ -265,12 +265,13 @@ int drm_setsareactx(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_ctx_priv_map_t request; struct drm_ctx_priv_map request;
drm_map_t *map = NULL; struct drm_map *map = NULL;
drm_map_list_t *r_list = NULL; drm_map_list_t *r_list = NULL;
if (copy_from_user(&request, if (copy_from_user(&request,
(drm_ctx_priv_map_t __user *) arg, sizeof(request))) (struct drm_ctx_priv_map __user *) arg,
sizeof(request)))
return -EFAULT; return -EFAULT;
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
...@@ -370,9 +371,9 @@ static int drm_context_switch_complete(drm_device_t * dev, int new) ...@@ -370,9 +371,9 @@ static int drm_context_switch_complete(drm_device_t * dev, int new)
int drm_resctx(struct inode *inode, struct file *filp, int drm_resctx(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
drm_ctx_res_t res; struct drm_ctx_res res;
drm_ctx_t __user *argp = (void __user *)arg; struct drm_ctx_res __user *argp = (void __user *)arg;
drm_ctx_t ctx; struct drm_ctx ctx;
int i; int i;
if (copy_from_user(&res, argp, sizeof(res))) if (copy_from_user(&res, argp, sizeof(res)))
...@@ -410,8 +411,8 @@ int drm_addctx(struct inode *inode, struct file *filp, ...@@ -410,8 +411,8 @@ int drm_addctx(struct inode *inode, struct file *filp,
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_ctx_list_t *ctx_entry; drm_ctx_list_t *ctx_entry;
drm_ctx_t __user *argp = (void __user *)arg; struct drm_ctx __user *argp = (void __user *)arg;
drm_ctx_t ctx; struct drm_ctx ctx;
if (copy_from_user(&ctx, argp, sizeof(ctx))) if (copy_from_user(&ctx, argp, sizeof(ctx)))
return -EFAULT; return -EFAULT;
...@@ -475,8 +476,8 @@ int drm_modctx(struct inode *inode, struct file *filp, ...@@ -475,8 +476,8 @@ int drm_modctx(struct inode *inode, struct file *filp,
int drm_getctx(struct inode *inode, struct file *filp, int drm_getctx(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
drm_ctx_t __user *argp = (void __user *)arg; struct drm_ctx __user *argp = (void __user *)arg;
drm_ctx_t ctx; struct drm_ctx ctx;
if (copy_from_user(&ctx, argp, sizeof(ctx))) if (copy_from_user(&ctx, argp, sizeof(ctx)))
return -EFAULT; return -EFAULT;
...@@ -505,9 +506,9 @@ int drm_switchctx(struct inode *inode, struct file *filp, ...@@ -505,9 +506,9 @@ int drm_switchctx(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_ctx_t ctx; struct drm_ctx ctx;
if (copy_from_user(&ctx, (drm_ctx_t __user *) arg, sizeof(ctx))) if (copy_from_user(&ctx, (struct drm_ctx __user *) arg, sizeof(ctx)))
return -EFAULT; return -EFAULT;
DRM_DEBUG("%d\n", ctx.handle); DRM_DEBUG("%d\n", ctx.handle);
...@@ -530,9 +531,9 @@ int drm_newctx(struct inode *inode, struct file *filp, ...@@ -530,9 +531,9 @@ int drm_newctx(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_ctx_t ctx; struct drm_ctx ctx;
if (copy_from_user(&ctx, (drm_ctx_t __user *) arg, sizeof(ctx))) if (copy_from_user(&ctx, (struct drm_ctx __user *) arg, sizeof(ctx)))
return -EFAULT; return -EFAULT;
DRM_DEBUG("%d\n", ctx.handle); DRM_DEBUG("%d\n", ctx.handle);
...@@ -557,9 +558,9 @@ int drm_rmctx(struct inode *inode, struct file *filp, ...@@ -557,9 +558,9 @@ int drm_rmctx(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_ctx_t ctx; struct drm_ctx ctx;
if (copy_from_user(&ctx, (drm_ctx_t __user *) arg, sizeof(ctx))) if (copy_from_user(&ctx, (struct drm_ctx __user *) arg, sizeof(ctx)))
return -EFAULT; return -EFAULT;
DRM_DEBUG("%d\n", ctx.handle); DRM_DEBUG("%d\n", ctx.handle);
......
...@@ -47,9 +47,9 @@ int drm_adddraw(DRM_IOCTL_ARGS) ...@@ -47,9 +47,9 @@ int drm_adddraw(DRM_IOCTL_ARGS)
int i, j; int i, j;
u32 *bitfield = dev->drw_bitfield; u32 *bitfield = dev->drw_bitfield;
unsigned int bitfield_length = dev->drw_bitfield_length; unsigned int bitfield_length = dev->drw_bitfield_length;
drm_drawable_info_t **info = dev->drw_info; struct drm_drawable_info **info = dev->drw_info;
unsigned int info_length = dev->drw_info_length; unsigned int info_length = dev->drw_info_length;
drm_draw_t draw; struct drm_draw draw;
for (i = 0, j = 0; i < bitfield_length; i++) { for (i = 0, j = 0; i < bitfield_length; i++) {
if (bitfield[i] == ~0) if (bitfield[i] == ~0)
...@@ -120,7 +120,7 @@ int drm_adddraw(DRM_IOCTL_ARGS) ...@@ -120,7 +120,7 @@ int drm_adddraw(DRM_IOCTL_ARGS)
spin_unlock_irqrestore(&dev->drw_lock, irqflags); spin_unlock_irqrestore(&dev->drw_lock, irqflags);
DRM_COPY_TO_USER_IOCTL((drm_draw_t __user *)data, draw, sizeof(draw)); DRM_COPY_TO_USER_IOCTL((struct drm_draw __user *)data, draw, sizeof(draw));
return 0; return 0;
} }
...@@ -131,16 +131,16 @@ int drm_adddraw(DRM_IOCTL_ARGS) ...@@ -131,16 +131,16 @@ int drm_adddraw(DRM_IOCTL_ARGS)
int drm_rmdraw(DRM_IOCTL_ARGS) int drm_rmdraw(DRM_IOCTL_ARGS)
{ {
DRM_DEVICE; DRM_DEVICE;
drm_draw_t draw; struct drm_draw draw;
int id, idx; int id, idx;
unsigned int shift; unsigned int shift;
unsigned long irqflags; unsigned long irqflags;
u32 *bitfield = dev->drw_bitfield; u32 *bitfield = dev->drw_bitfield;
unsigned int bitfield_length = dev->drw_bitfield_length; unsigned int bitfield_length = dev->drw_bitfield_length;
drm_drawable_info_t **info = dev->drw_info; struct drm_drawable_info **info = dev->drw_info;
unsigned int info_length = dev->drw_info_length; unsigned int info_length = dev->drw_info_length;
DRM_COPY_FROM_USER_IOCTL(draw, (drm_draw_t __user *) data, DRM_COPY_FROM_USER_IOCTL(draw, (struct drm_draw __user *) data,
sizeof(draw)); sizeof(draw));
id = draw.handle - 1; id = draw.handle - 1;
...@@ -161,7 +161,7 @@ int drm_rmdraw(DRM_IOCTL_ARGS) ...@@ -161,7 +161,7 @@ int drm_rmdraw(DRM_IOCTL_ARGS)
if (info[id]) { if (info[id]) {
drm_free(info[id]->rects, info[id]->num_rects * drm_free(info[id]->rects, info[id]->num_rects *
sizeof(drm_clip_rect_t), DRM_MEM_BUFS); sizeof(struct drm_clip_rect), DRM_MEM_BUFS);
drm_free(info[id], sizeof(**info), DRM_MEM_BUFS); drm_free(info[id], sizeof(**info), DRM_MEM_BUFS);
} }
...@@ -230,15 +230,15 @@ int drm_rmdraw(DRM_IOCTL_ARGS) ...@@ -230,15 +230,15 @@ int drm_rmdraw(DRM_IOCTL_ARGS)
int drm_update_drawable_info(DRM_IOCTL_ARGS) { int drm_update_drawable_info(DRM_IOCTL_ARGS) {
DRM_DEVICE; DRM_DEVICE;
drm_update_draw_t update; struct drm_update_draw update;
unsigned int id, idx, shift; unsigned int id, idx, shift;
u32 *bitfield = dev->drw_bitfield; u32 *bitfield = dev->drw_bitfield;
unsigned long irqflags, bitfield_length = dev->drw_bitfield_length; unsigned long irqflags, bitfield_length = dev->drw_bitfield_length;
drm_drawable_info_t *info; struct drm_drawable_info *info;
drm_clip_rect_t *rects; struct drm_clip_rect *rects;
int err; int err;
DRM_COPY_FROM_USER_IOCTL(update, (drm_update_draw_t __user *) data, DRM_COPY_FROM_USER_IOCTL(update, (struct drm_update_draw __user *) data,
sizeof(update)); sizeof(update));
id = update.handle - 1; id = update.handle - 1;
...@@ -254,7 +254,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) { ...@@ -254,7 +254,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
info = dev->drw_info[id]; info = dev->drw_info[id];
if (!info) { if (!info) {
info = drm_calloc(1, sizeof(drm_drawable_info_t), DRM_MEM_BUFS); info = drm_calloc(1, sizeof(struct drm_drawable_info), DRM_MEM_BUFS);
if (!info) { if (!info) {
DRM_ERROR("Failed to allocate drawable info memory\n"); DRM_ERROR("Failed to allocate drawable info memory\n");
...@@ -265,7 +265,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) { ...@@ -265,7 +265,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
switch (update.type) { switch (update.type) {
case DRM_DRAWABLE_CLIPRECTS: case DRM_DRAWABLE_CLIPRECTS:
if (update.num != info->num_rects) { if (update.num != info->num_rects) {
rects = drm_alloc(update.num * sizeof(drm_clip_rect_t), rects = drm_alloc(update.num * sizeof(struct drm_clip_rect),
DRM_MEM_BUFS); DRM_MEM_BUFS);
} else } else
rects = info->rects; rects = info->rects;
...@@ -277,7 +277,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) { ...@@ -277,7 +277,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
} }
if (update.num && DRM_COPY_FROM_USER(rects, if (update.num && DRM_COPY_FROM_USER(rects,
(drm_clip_rect_t __user *) (struct drm_clip_rect __user *)
(unsigned long)update.data, (unsigned long)update.data,
update.num * update.num *
sizeof(*rects))) { sizeof(*rects))) {
...@@ -290,7 +290,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) { ...@@ -290,7 +290,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
if (rects != info->rects) { if (rects != info->rects) {
drm_free(info->rects, info->num_rects * drm_free(info->rects, info->num_rects *
sizeof(drm_clip_rect_t), DRM_MEM_BUFS); sizeof(struct drm_clip_rect), DRM_MEM_BUFS);
} }
info->rects = rects; info->rects = rects;
...@@ -314,7 +314,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) { ...@@ -314,7 +314,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
drm_free(info, sizeof(*info), DRM_MEM_BUFS); drm_free(info, sizeof(*info), DRM_MEM_BUFS);
else if (rects != dev->drw_info[id]->rects) else if (rects != dev->drw_info[id]->rects)
drm_free(rects, update.num * drm_free(rects, update.num *
sizeof(drm_clip_rect_t), DRM_MEM_BUFS); sizeof(struct drm_clip_rect), DRM_MEM_BUFS);
return err; return err;
} }
...@@ -322,7 +322,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) { ...@@ -322,7 +322,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
/** /**
* Caller must hold the drawable spinlock! * Caller must hold the drawable spinlock!
*/ */
drm_drawable_info_t *drm_get_drawable_info(drm_device_t *dev, drm_drawable_t id) { struct drm_drawable_info *drm_get_drawable_info(drm_device_t *dev, drm_drawable_t id) {
u32 *bitfield = dev->drw_bitfield; u32 *bitfield = dev->drw_bitfield;
unsigned int idx, shift; unsigned int idx, shift;
......
...@@ -154,11 +154,11 @@ int drm_lastclose(drm_device_t * dev) ...@@ -154,11 +154,11 @@ int drm_lastclose(drm_device_t * dev)
/* Free drawable information memory */ /* Free drawable information memory */
for (i = 0; i < dev->drw_bitfield_length / sizeof(*dev->drw_bitfield); for (i = 0; i < dev->drw_bitfield_length / sizeof(*dev->drw_bitfield);
i++) { i++) {
drm_drawable_info_t *info = drm_get_drawable_info(dev, i); struct drm_drawable_info *info = drm_get_drawable_info(dev, i);
if (info) { if (info) {
drm_free(info->rects, info->num_rects * drm_free(info->rects, info->num_rects *
sizeof(drm_clip_rect_t), DRM_MEM_BUFS); sizeof(struct drm_clip_rect), DRM_MEM_BUFS);
drm_free(info, sizeof(*info), DRM_MEM_BUFS); drm_free(info, sizeof(*info), DRM_MEM_BUFS);
} }
} }
...@@ -432,8 +432,8 @@ static int drm_version(struct inode *inode, struct file *filp, ...@@ -432,8 +432,8 @@ static int drm_version(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_version_t __user *argp = (void __user *)arg; struct drm_version __user *argp = (void __user *)arg;
drm_version_t version; struct drm_version version;
int len; int len;
if (copy_from_user(&version, argp, sizeof(version))) if (copy_from_user(&version, argp, sizeof(version)))
......
...@@ -54,8 +54,8 @@ int drm_getunique(struct inode *inode, struct file *filp, ...@@ -54,8 +54,8 @@ int drm_getunique(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_unique_t __user *argp = (void __user *)arg; struct drm_unique __user *argp = (void __user *)arg;
drm_unique_t u; struct drm_unique u;
if (copy_from_user(&u, argp, sizeof(u))) if (copy_from_user(&u, argp, sizeof(u)))
return -EFAULT; return -EFAULT;
...@@ -88,13 +88,13 @@ int drm_setunique(struct inode *inode, struct file *filp, ...@@ -88,13 +88,13 @@ int drm_setunique(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_unique_t u; struct drm_unique u;
int domain, bus, slot, func, ret; int domain, bus, slot, func, ret;
if (dev->unique_len || dev->unique) if (dev->unique_len || dev->unique)
return -EBUSY; return -EBUSY;
if (copy_from_user(&u, (drm_unique_t __user *) arg, sizeof(u))) if (copy_from_user(&u, (struct drm_unique __user *) arg, sizeof(u)))
return -EFAULT; return -EFAULT;
if (!u.unique_len || u.unique_len > 1024) if (!u.unique_len || u.unique_len > 1024)
...@@ -186,8 +186,8 @@ int drm_getmap(struct inode *inode, struct file *filp, ...@@ -186,8 +186,8 @@ int drm_getmap(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_map_t __user *argp = (void __user *)arg; struct drm_map __user *argp = (void __user *)arg;
drm_map_t map; struct drm_map map;
drm_map_list_t *r_list = NULL; drm_map_list_t *r_list = NULL;
struct list_head *list; struct list_head *list;
int idx; int idx;
...@@ -247,8 +247,8 @@ int drm_getclient(struct inode *inode, struct file *filp, ...@@ -247,8 +247,8 @@ int drm_getclient(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_client_t __user *argp = (drm_client_t __user *)arg; struct drm_client __user *argp = (struct drm_client __user *)arg;
drm_client_t client; struct drm_client client;
drm_file_t *pt; drm_file_t *pt;
int idx; int idx;
int i; int i;
...@@ -296,7 +296,7 @@ int drm_getstats(struct inode *inode, struct file *filp, ...@@ -296,7 +296,7 @@ int drm_getstats(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_stats_t stats; struct drm_stats stats;
int i; int i;
memset(&stats, 0, sizeof(stats)); memset(&stats, 0, sizeof(stats));
...@@ -316,7 +316,7 @@ int drm_getstats(struct inode *inode, struct file *filp, ...@@ -316,7 +316,7 @@ int drm_getstats(struct inode *inode, struct file *filp,
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
if (copy_to_user((drm_stats_t __user *) arg, &stats, sizeof(stats))) if (copy_to_user((struct drm_stats __user *) arg, &stats, sizeof(stats)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -335,10 +335,10 @@ int drm_getstats(struct inode *inode, struct file *filp, ...@@ -335,10 +335,10 @@ int drm_getstats(struct inode *inode, struct file *filp,
int drm_setversion(DRM_IOCTL_ARGS) int drm_setversion(DRM_IOCTL_ARGS)
{ {
DRM_DEVICE; DRM_DEVICE;
drm_set_version_t sv; struct drm_set_version sv;
drm_set_version_t retv; struct drm_set_version retv;
int if_version; int if_version;
drm_set_version_t __user *argp = (void __user *)data; struct drm_set_version __user *argp = (void __user *)data;
int ret; int ret;
if (copy_from_user(&sv, argp, sizeof(sv))) if (copy_from_user(&sv, argp, sizeof(sv)))
......
...@@ -55,8 +55,8 @@ int drm_irq_by_busid(struct inode *inode, struct file *filp, ...@@ -55,8 +55,8 @@ int drm_irq_by_busid(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_irq_busid_t __user *argp = (void __user *)arg; struct drm_irq_busid __user *argp = (void __user *)arg;
drm_irq_busid_t p; struct drm_irq_busid p;
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL; return -EINVAL;
...@@ -199,11 +199,11 @@ int drm_control(struct inode *inode, struct file *filp, ...@@ -199,11 +199,11 @@ int drm_control(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_control_t ctl; struct drm_control ctl;
/* if we haven't irq we fallback for compatibility reasons - this used to be a separate function in drm_dma.h */ /* if we haven't irq we fallback for compatibility reasons - this used to be a separate function in drm_dma.h */
if (copy_from_user(&ctl, (drm_control_t __user *) arg, sizeof(ctl))) if (copy_from_user(&ctl, (struct drm_control __user *) arg, sizeof(ctl)))
return -EFAULT; return -EFAULT;
switch (ctl.func) { switch (ctl.func) {
...@@ -246,8 +246,8 @@ int drm_wait_vblank(DRM_IOCTL_ARGS) ...@@ -246,8 +246,8 @@ int drm_wait_vblank(DRM_IOCTL_ARGS)
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_wait_vblank_t __user *argp = (void __user *)data; union drm_wait_vblank __user *argp = (void __user *)data;
drm_wait_vblank_t vblwait; union drm_wait_vblank vblwait;
struct timeval now; struct timeval now;
int ret = 0; int ret = 0;
unsigned int flags, seq; unsigned int flags, seq;
......
...@@ -54,12 +54,12 @@ int drm_lock(struct inode *inode, struct file *filp, ...@@ -54,12 +54,12 @@ int drm_lock(struct inode *inode, struct file *filp,
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
DECLARE_WAITQUEUE(entry, current); DECLARE_WAITQUEUE(entry, current);
drm_lock_t lock; struct drm_lock lock;
int ret = 0; int ret = 0;
++priv->lock_count; ++priv->lock_count;
if (copy_from_user(&lock, (drm_lock_t __user *) arg, sizeof(lock))) if (copy_from_user(&lock, (struct drm_lock __user *) arg, sizeof(lock)))
return -EFAULT; return -EFAULT;
if (lock.context == DRM_KERNEL_CONTEXT) { if (lock.context == DRM_KERNEL_CONTEXT) {
...@@ -154,10 +154,10 @@ int drm_unlock(struct inode *inode, struct file *filp, ...@@ -154,10 +154,10 @@ int drm_unlock(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_lock_t lock; struct drm_lock lock;
unsigned long irqflags; unsigned long irqflags;
if (copy_from_user(&lock, (drm_lock_t __user *) arg, sizeof(lock))) if (copy_from_user(&lock, (struct drm_lock __user *) arg, sizeof(lock)))
return -EFAULT; return -EFAULT;
if (lock.context == DRM_KERNEL_CONTEXT) { if (lock.context == DRM_KERNEL_CONTEXT) {
......
...@@ -207,7 +207,7 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request, ...@@ -207,7 +207,7 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request,
{ {
drm_device_t *dev = (drm_device_t *) data; drm_device_t *dev = (drm_device_t *) data;
int len = 0; int len = 0;
drm_map_t *map; struct drm_map *map;
drm_map_list_t *r_list; drm_map_list_t *r_list;
/* Hardcoded from _DRM_FRAME_BUFFER, /* Hardcoded from _DRM_FRAME_BUFFER,
......
...@@ -67,9 +67,9 @@ typedef struct drm_sarea_frame { ...@@ -67,9 +67,9 @@ typedef struct drm_sarea_frame {
/** SAREA */ /** SAREA */
typedef struct drm_sarea { typedef struct drm_sarea {
/** first thing is always the DRM locking structure */ /** first thing is always the DRM locking structure */
drm_hw_lock_t lock; struct drm_hw_lock lock;
/** \todo Use readers/writer lock for drm_sarea::drawable_lock */ /** \todo Use readers/writer lock for drm_sarea::drawable_lock */
drm_hw_lock_t drawable_lock; struct drm_hw_lock drawable_lock;
drm_sarea_drawable_t drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */ drm_sarea_drawable_t drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */
drm_sarea_frame_t frame; /**< frame */ drm_sarea_frame_t frame; /**< frame */
drm_context_t dummy_context; drm_context_t dummy_context;
......
...@@ -67,8 +67,8 @@ int drm_sg_alloc(struct inode *inode, struct file *filp, ...@@ -67,8 +67,8 @@ int drm_sg_alloc(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_scatter_gather_t __user *argp = (void __user *)arg; struct drm_scatter_gather __user *argp = (void __user *)arg;
drm_scatter_gather_t request; struct drm_scatter_gather request;
drm_sg_mem_t *entry; drm_sg_mem_t *entry;
unsigned long pages, i, j; unsigned long pages, i, j;
...@@ -203,14 +203,14 @@ int drm_sg_free(struct inode *inode, struct file *filp, ...@@ -203,14 +203,14 @@ int drm_sg_free(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_scatter_gather_t request; struct drm_scatter_gather request;
drm_sg_mem_t *entry; drm_sg_mem_t *entry;
if (!drm_core_check_feature(dev, DRIVER_SG)) if (!drm_core_check_feature(dev, DRIVER_SG))
return -EINVAL; return -EINVAL;
if (copy_from_user(&request, if (copy_from_user(&request,
(drm_scatter_gather_t __user *) arg, (struct drm_scatter_gather __user *) arg,
sizeof(request))) sizeof(request)))
return -EFAULT; return -EFAULT;
......
...@@ -81,7 +81,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma, ...@@ -81,7 +81,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma,
{ {
drm_file_t *priv = vma->vm_file->private_data; drm_file_t *priv = vma->vm_file->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_map_t *map = NULL; struct drm_map *map = NULL;
drm_map_list_t *r_list; drm_map_list_t *r_list;
drm_hash_item_t *hash; drm_hash_item_t *hash;
...@@ -163,7 +163,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma, ...@@ -163,7 +163,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma,
static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma, static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma,
unsigned long address) unsigned long address)
{ {
drm_map_t *map = (drm_map_t *) vma->vm_private_data; struct drm_map *map = (struct drm_map *) vma->vm_private_data;
unsigned long offset; unsigned long offset;
unsigned long i; unsigned long i;
struct page *page; struct page *page;
...@@ -197,7 +197,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma) ...@@ -197,7 +197,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
drm_file_t *priv = vma->vm_file->private_data; drm_file_t *priv = vma->vm_file->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_vma_entry_t *pt, *temp; drm_vma_entry_t *pt, *temp;
drm_map_t *map; struct drm_map *map;
drm_map_list_t *r_list; drm_map_list_t *r_list;
int found_maps = 0; int found_maps = 0;
...@@ -310,7 +310,7 @@ static __inline__ struct page *drm_do_vm_dma_nopage(struct vm_area_struct *vma, ...@@ -310,7 +310,7 @@ static __inline__ struct page *drm_do_vm_dma_nopage(struct vm_area_struct *vma,
static __inline__ struct page *drm_do_vm_sg_nopage(struct vm_area_struct *vma, static __inline__ struct page *drm_do_vm_sg_nopage(struct vm_area_struct *vma,
unsigned long address) unsigned long address)
{ {
drm_map_t *map = (drm_map_t *) vma->vm_private_data; struct drm_map *map = (struct drm_map *) vma->vm_private_data;
drm_file_t *priv = vma->vm_file->private_data; drm_file_t *priv = vma->vm_file->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_sg_mem_t *entry = dev->sg; drm_sg_mem_t *entry = dev->sg;
...@@ -512,7 +512,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) ...@@ -512,7 +512,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
return 0; return 0;
} }
unsigned long drm_core_get_map_ofs(drm_map_t * map) unsigned long drm_core_get_map_ofs(struct drm_map * map)
{ {
return map->offset; return map->offset;
} }
...@@ -547,7 +547,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) ...@@ -547,7 +547,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_map_t *map = NULL; struct drm_map *map = NULL;
unsigned long offset = 0; unsigned long offset = 0;
drm_hash_item_t *hash; drm_hash_item_t *hash;
......
...@@ -397,11 +397,11 @@ static int i915_emit_cmds(drm_device_t * dev, int __user * buffer, int dwords) ...@@ -397,11 +397,11 @@ static int i915_emit_cmds(drm_device_t * dev, int __user * buffer, int dwords)
} }
static int i915_emit_box(drm_device_t * dev, static int i915_emit_box(drm_device_t * dev,
drm_clip_rect_t __user * boxes, struct drm_clip_rect __user * boxes,
int i, int DR1, int DR4) int i, int DR1, int DR4)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
drm_clip_rect_t box; struct drm_clip_rect box;
RING_LOCALS; RING_LOCALS;
if (DRM_COPY_FROM_USER_UNCHECKED(&box, &boxes[i], sizeof(box))) { if (DRM_COPY_FROM_USER_UNCHECKED(&box, &boxes[i], sizeof(box))) {
...@@ -493,7 +493,7 @@ static int i915_dispatch_batchbuffer(drm_device_t * dev, ...@@ -493,7 +493,7 @@ static int i915_dispatch_batchbuffer(drm_device_t * dev,
drm_i915_batchbuffer_t * batch) drm_i915_batchbuffer_t * batch)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
drm_clip_rect_t __user *boxes = batch->cliprects; struct drm_clip_rect __user *boxes = batch->cliprects;
int nbox = batch->num_cliprects; int nbox = batch->num_cliprects;
int i = 0, count; int i = 0, count;
RING_LOCALS; RING_LOCALS;
...@@ -625,7 +625,7 @@ static int i915_batchbuffer(DRM_IOCTL_ARGS) ...@@ -625,7 +625,7 @@ static int i915_batchbuffer(DRM_IOCTL_ARGS)
if (batch.num_cliprects && DRM_VERIFYAREA_READ(batch.cliprects, if (batch.num_cliprects && DRM_VERIFYAREA_READ(batch.cliprects,
batch.num_cliprects * batch.num_cliprects *
sizeof(drm_clip_rect_t))) sizeof(struct drm_clip_rect)))
return DRM_ERR(EFAULT); return DRM_ERR(EFAULT);
ret = i915_dispatch_batchbuffer(dev, &batch); ret = i915_dispatch_batchbuffer(dev, &batch);
...@@ -655,7 +655,7 @@ static int i915_cmdbuffer(DRM_IOCTL_ARGS) ...@@ -655,7 +655,7 @@ static int i915_cmdbuffer(DRM_IOCTL_ARGS)
if (cmdbuf.num_cliprects && if (cmdbuf.num_cliprects &&
DRM_VERIFYAREA_READ(cmdbuf.cliprects, DRM_VERIFYAREA_READ(cmdbuf.cliprects,
cmdbuf.num_cliprects * cmdbuf.num_cliprects *
sizeof(drm_clip_rect_t))) { sizeof(struct drm_clip_rect))) {
DRM_ERROR("Fault accessing cliprects\n"); DRM_ERROR("Fault accessing cliprects\n");
return DRM_ERR(EFAULT); return DRM_ERR(EFAULT);
} }
......
...@@ -64,7 +64,7 @@ typedef struct _drm_i915_init { ...@@ -64,7 +64,7 @@ typedef struct _drm_i915_init {
} drm_i915_init_t; } drm_i915_init_t;
typedef struct _drm_i915_sarea { typedef struct _drm_i915_sarea {
drm_tex_region_t texList[I915_NR_TEX_REGIONS + 1]; struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
int last_upload; /* last time texture was uploaded */ int last_upload; /* last time texture was uploaded */
int last_enqueue; /* last time a buffer was enqueued */ int last_enqueue; /* last time a buffer was enqueued */
int last_dispatch; /* age of the most recently dispatched buffer */ int last_dispatch; /* age of the most recently dispatched buffer */
...@@ -170,7 +170,7 @@ typedef struct _drm_i915_batchbuffer { ...@@ -170,7 +170,7 @@ typedef struct _drm_i915_batchbuffer {
int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
int num_cliprects; /* mulitpass with multiple cliprects? */ int num_cliprects; /* mulitpass with multiple cliprects? */
drm_clip_rect_t __user *cliprects; /* pointer to userspace cliprects */ struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
} drm_i915_batchbuffer_t; } drm_i915_batchbuffer_t;
/* As above, but pass a pointer to userspace buffer which can be /* As above, but pass a pointer to userspace buffer which can be
...@@ -182,7 +182,7 @@ typedef struct _drm_i915_cmdbuffer { ...@@ -182,7 +182,7 @@ typedef struct _drm_i915_cmdbuffer {
int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
int num_cliprects; /* mulitpass with multiple cliprects? */ int num_cliprects; /* mulitpass with multiple cliprects? */
drm_clip_rect_t __user *cliprects; /* pointer to userspace cliprects */ struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
} drm_i915_cmdbuffer_t; } drm_i915_cmdbuffer_t;
/* Userspace can request & wait on irq's: /* Userspace can request & wait on irq's:
...@@ -259,7 +259,7 @@ typedef struct drm_i915_vblank_pipe { ...@@ -259,7 +259,7 @@ typedef struct drm_i915_vblank_pipe {
*/ */
typedef struct drm_i915_vblank_swap { typedef struct drm_i915_vblank_swap {
drm_drawable_t drawable; drm_drawable_t drawable;
drm_vblank_seq_type_t seqtype; enum drm_vblank_seq_type seqtype;
unsigned int sequence; unsigned int sequence;
} drm_i915_vblank_swap_t; } drm_i915_vblank_swap_t;
......
...@@ -50,7 +50,7 @@ static void i915_vblank_tasklet(drm_device_t *dev) ...@@ -50,7 +50,7 @@ static void i915_vblank_tasklet(drm_device_t *dev)
int nhits, nrects, slice[2], upper[2], lower[2], i; int nhits, nrects, slice[2], upper[2], lower[2], i;
unsigned counter[2] = { atomic_read(&dev->vbl_received), unsigned counter[2] = { atomic_read(&dev->vbl_received),
atomic_read(&dev->vbl_received2) }; atomic_read(&dev->vbl_received2) };
drm_drawable_info_t *drw; struct drm_drawable_info *drw;
drm_i915_sarea_t *sarea_priv = dev_priv->sarea_priv; drm_i915_sarea_t *sarea_priv = dev_priv->sarea_priv;
u32 cpp = dev_priv->cpp; u32 cpp = dev_priv->cpp;
u32 cmd = (cpp == 4) ? (XY_SRC_COPY_BLT_CMD | u32 cmd = (cpp == 4) ? (XY_SRC_COPY_BLT_CMD |
...@@ -95,7 +95,7 @@ static void i915_vblank_tasklet(drm_device_t *dev) ...@@ -95,7 +95,7 @@ static void i915_vblank_tasklet(drm_device_t *dev)
list_for_each(hit, &hits) { list_for_each(hit, &hits) {
drm_i915_vbl_swap_t *swap_cmp = drm_i915_vbl_swap_t *swap_cmp =
list_entry(hit, drm_i915_vbl_swap_t, head); list_entry(hit, drm_i915_vbl_swap_t, head);
drm_drawable_info_t *drw_cmp = struct drm_drawable_info *drw_cmp =
drm_get_drawable_info(dev, swap_cmp->drw_id); drm_get_drawable_info(dev, swap_cmp->drw_id);
if (drw_cmp && if (drw_cmp &&
...@@ -160,7 +160,7 @@ static void i915_vblank_tasklet(drm_device_t *dev) ...@@ -160,7 +160,7 @@ static void i915_vblank_tasklet(drm_device_t *dev)
list_for_each(hit, &hits) { list_for_each(hit, &hits) {
drm_i915_vbl_swap_t *swap_hit = drm_i915_vbl_swap_t *swap_hit =
list_entry(hit, drm_i915_vbl_swap_t, head); list_entry(hit, drm_i915_vbl_swap_t, head);
drm_clip_rect_t *rect; struct drm_clip_rect *rect;
int num_rects, pipe; int num_rects, pipe;
unsigned short top, bottom; unsigned short top, bottom;
......
...@@ -47,7 +47,7 @@ static void mark_block(drm_device_t * dev, struct mem_block *p, int in_use) ...@@ -47,7 +47,7 @@ static void mark_block(drm_device_t * dev, struct mem_block *p, int in_use)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
drm_i915_sarea_t *sarea_priv = dev_priv->sarea_priv; drm_i915_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_tex_region_t *list; struct drm_tex_region *list;
unsigned shift, nr; unsigned shift, nr;
unsigned start; unsigned start;
unsigned end; unsigned end;
......
...@@ -55,7 +55,7 @@ static const int r300_cliprect_cntl[4] = { ...@@ -55,7 +55,7 @@ static const int r300_cliprect_cntl[4] = {
static int r300_emit_cliprects(drm_radeon_private_t *dev_priv, static int r300_emit_cliprects(drm_radeon_private_t *dev_priv,
drm_radeon_kcmd_buffer_t *cmdbuf, int n) drm_radeon_kcmd_buffer_t *cmdbuf, int n)
{ {
drm_clip_rect_t box; struct drm_clip_rect box;
int nr; int nr;
int i; int i;
RING_LOCALS; RING_LOCALS;
......
...@@ -2171,7 +2171,7 @@ int radeon_wait_ring(drm_radeon_private_t * dev_priv, int n) ...@@ -2171,7 +2171,7 @@ int radeon_wait_ring(drm_radeon_private_t * dev_priv, int n)
} }
static int radeon_cp_get_buffers(DRMFILE filp, drm_device_t * dev, static int radeon_cp_get_buffers(DRMFILE filp, drm_device_t * dev,
drm_dma_t * d) struct drm_dma * d)
{ {
int i; int i;
drm_buf_t *buf; drm_buf_t *buf;
...@@ -2200,8 +2200,8 @@ int radeon_cp_buffers(DRM_IOCTL_ARGS) ...@@ -2200,8 +2200,8 @@ int radeon_cp_buffers(DRM_IOCTL_ARGS)
DRM_DEVICE; DRM_DEVICE;
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
int ret = 0; int ret = 0;
drm_dma_t __user *argp = (void __user *)data; struct drm_dma __user *argp = (void __user *)data;
drm_dma_t d; struct drm_dma d;
LOCK_TEST_WITH_RETURN(dev, filp); LOCK_TEST_WITH_RETURN(dev, filp);
......
...@@ -417,7 +417,7 @@ typedef struct { ...@@ -417,7 +417,7 @@ typedef struct {
/* The current cliprects, or a subset thereof. /* The current cliprects, or a subset thereof.
*/ */
drm_clip_rect_t boxes[RADEON_NR_SAREA_CLIPRECTS]; struct drm_clip_rect boxes[RADEON_NR_SAREA_CLIPRECTS];
unsigned int nbox; unsigned int nbox;
/* Counters for client-side throttling of rendering clients. /* Counters for client-side throttling of rendering clients.
...@@ -426,7 +426,7 @@ typedef struct { ...@@ -426,7 +426,7 @@ typedef struct {
unsigned int last_dispatch; unsigned int last_dispatch;
unsigned int last_clear; unsigned int last_clear;
drm_tex_region_t tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS + struct drm_tex_region tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS +
1]; 1];
unsigned int tex_age[RADEON_NR_TEX_HEAPS]; unsigned int tex_age[RADEON_NR_TEX_HEAPS];
int ctx_owner; int ctx_owner;
...@@ -604,7 +604,7 @@ typedef struct drm_radeon_cmd_buffer { ...@@ -604,7 +604,7 @@ typedef struct drm_radeon_cmd_buffer {
int bufsz; int bufsz;
char __user *buf; char __user *buf;
int nbox; int nbox;
drm_clip_rect_t __user *boxes; struct drm_clip_rect __user *boxes;
} drm_radeon_cmd_buffer_t; } drm_radeon_cmd_buffer_t;
typedef struct drm_radeon_tex_image { typedef struct drm_radeon_tex_image {
......
...@@ -303,7 +303,7 @@ typedef struct drm_radeon_kcmd_buffer { ...@@ -303,7 +303,7 @@ typedef struct drm_radeon_kcmd_buffer {
int bufsz; int bufsz;
char *buf; char *buf;
int nbox; int nbox;
drm_clip_rect_t __user *boxes; struct drm_clip_rect __user *boxes;
} drm_radeon_kcmd_buffer_t; } drm_radeon_kcmd_buffer_t;
extern int radeon_no_wb; extern int radeon_no_wb;
......
...@@ -421,7 +421,7 @@ static __inline__ int radeon_check_and_fixup_packet3(drm_radeon_private_t * ...@@ -421,7 +421,7 @@ static __inline__ int radeon_check_and_fixup_packet3(drm_radeon_private_t *
*/ */
static __inline__ void radeon_emit_clip_rect(drm_radeon_private_t * dev_priv, static __inline__ void radeon_emit_clip_rect(drm_radeon_private_t * dev_priv,
drm_clip_rect_t * box) struct drm_clip_rect * box)
{ {
RING_LOCALS; RING_LOCALS;
...@@ -852,7 +852,7 @@ static void radeon_cp_dispatch_clear(drm_device_t * dev, ...@@ -852,7 +852,7 @@ static void radeon_cp_dispatch_clear(drm_device_t * dev,
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv; drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_depth_clear_t *depth_clear = &dev_priv->depth_clear; drm_radeon_depth_clear_t *depth_clear = &dev_priv->depth_clear;
int nbox = sarea_priv->nbox; int nbox = sarea_priv->nbox;
drm_clip_rect_t *pbox = sarea_priv->boxes; struct drm_clip_rect *pbox = sarea_priv->boxes;
unsigned int flags = clear->flags; unsigned int flags = clear->flags;
u32 rb3d_cntl = 0, rb3d_stencilrefmask = 0; u32 rb3d_cntl = 0, rb3d_stencilrefmask = 0;
int i; int i;
...@@ -1340,7 +1340,7 @@ static void radeon_cp_dispatch_swap(drm_device_t * dev) ...@@ -1340,7 +1340,7 @@ static void radeon_cp_dispatch_swap(drm_device_t * dev)
drm_radeon_private_t *dev_priv = dev->dev_private; drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv; drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
int nbox = sarea_priv->nbox; int nbox = sarea_priv->nbox;
drm_clip_rect_t *pbox = sarea_priv->boxes; struct drm_clip_rect *pbox = sarea_priv->boxes;
int i; int i;
RING_LOCALS; RING_LOCALS;
DRM_DEBUG("\n"); DRM_DEBUG("\n");
...@@ -2760,10 +2760,10 @@ static int radeon_emit_packet3_cliprect(drm_device_t *dev, ...@@ -2760,10 +2760,10 @@ static int radeon_emit_packet3_cliprect(drm_device_t *dev,
int orig_nbox) int orig_nbox)
{ {
drm_radeon_private_t *dev_priv = dev->dev_private; drm_radeon_private_t *dev_priv = dev->dev_private;
drm_clip_rect_t box; struct drm_clip_rect box;
unsigned int cmdsz; unsigned int cmdsz;
int ret; int ret;
drm_clip_rect_t __user *boxes = cmdbuf->boxes; struct drm_clip_rect __user *boxes = cmdbuf->boxes;
int i = 0; int i = 0;
RING_LOCALS; RING_LOCALS;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define VIA_NR_XVMC_LOCKS 5 #define VIA_NR_XVMC_LOCKS 5
#define VIA_MAX_CACHELINE_SIZE 64 #define VIA_MAX_CACHELINE_SIZE 64
#define XVMCLOCKPTR(saPriv,lockNo) \ #define XVMCLOCKPTR(saPriv,lockNo) \
((volatile drm_hw_lock_t *)(((((unsigned long) (saPriv)->XvMCLockArea) + \ ((volatile struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
(VIA_MAX_CACHELINE_SIZE - 1)) & \ (VIA_MAX_CACHELINE_SIZE - 1)) & \
~(VIA_MAX_CACHELINE_SIZE - 1)) + \ ~(VIA_MAX_CACHELINE_SIZE - 1)) + \
VIA_MAX_CACHELINE_SIZE*(lockNo))) VIA_MAX_CACHELINE_SIZE*(lockNo)))
...@@ -182,7 +182,7 @@ typedef struct _drm_via_tex_region { ...@@ -182,7 +182,7 @@ typedef struct _drm_via_tex_region {
typedef struct _drm_via_sarea { typedef struct _drm_via_sarea {
unsigned int dirty; unsigned int dirty;
unsigned int nbox; unsigned int nbox;
drm_clip_rect_t boxes[VIA_NR_SAREA_CLIPRECTS]; struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1]; drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
int texAge; /* last time texture was uploaded */ int texAge; /* last time texture was uploaded */
int ctxOwner; /* last context to upload state */ int ctxOwner; /* last context to upload state */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment