#define DRM_COMMAND_END 0xA0
/* typedef area */
-#if !defined(__KERNEL__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#ifndef __KERNEL__
typedef struct drm_clip_rect drm_clip_rect_t;
typedef struct drm_tex_region drm_tex_region_t;
typedef struct drm_hw_lock drm_hw_lock_t;
};
struct drm_lock_data {
- drm_hw_lock_t *hw_lock; /* Hardware lock */
+ struct drm_hw_lock *hw_lock; /* Hardware lock */
/* Unique identifier of holding process (NULL is kernel) */
- struct drm_file *file_priv;
- int lock_queue; /* Queue of blocked processes */
- unsigned long lock_time; /* Time of last lock in jiffies */
+ struct drm_file *file_priv;
+ int lock_queue; /* Queue of blocked processes */
+ unsigned long lock_time; /* Time of last lock */
};
/* This structure, in the struct drm_device, is always initialized while
bus_space_tag_t bst; /* Tag for mapped pci mem */
bus_space_handle_t bsh; /* Handle to mapped pci mem */
u_long ext; /* extent for mmap */
- drm_map_flags_t flags; /* Flags */
+ enum drm_map_flags flags; /* Flags */
int mtrr; /* Boolean: MTRR used */
unsigned long offset;/* Physical address */
unsigned long size; /* Physical size (bytes) */
- drm_map_type_t type; /* Type of memory mapped */
+ enum drm_map_type type; /* Type of memory mapped */
} drm_local_map_t;
struct drm_vblank {
/* Performance counters */
unsigned long counters;
- drm_stat_type_t types[15];
+ enum drm_stat_type types[15];
atomic_t counts[15];
/* Authentication */
drm_local_map_t
*drm_find_matching_map(struct drm_device *, drm_local_map_t *);
int drm_addmap(struct drm_device *, unsigned long, unsigned long,
- drm_map_type_t, drm_map_flags_t, drm_local_map_t **);
-int drm_addbufs_pci(struct drm_device *, drm_buf_desc_t *);
-int drm_addbufs_sg(struct drm_device *, drm_buf_desc_t *);
-int drm_addbufs_agp(struct drm_device *, drm_buf_desc_t *);
+ enum drm_map_type, enum drm_lock_flags, drm_local_map_t **);
+int drm_addbufs_pci(struct drm_device *, struct drm_buf_desc *);
+int drm_addbufs_sg(struct drm_device *, struct drm_buf_desc *);
+int drm_addbufs_agp(struct drm_device *, struct drm_buf_desc *);
/* DMA support (drm_dma.c) */
int drm_dma_setup(struct drm_device *);
drm_agp_head_t *drm_agp_init(void);
int drm_agp_acquire(struct drm_device *);
int drm_agp_release(struct drm_device *);
-int drm_agp_info(struct drm_device *, drm_agp_info_t *);
-int drm_agp_enable(struct drm_device *, drm_agp_mode_t);
+int drm_agp_info(struct drm_device *, struct drm_agp_info *);
+int drm_agp_enable(struct drm_device *, struct drm_agp_mode);
void *drm_agp_allocate_memory(size_t, u32);
int drm_agp_free_memory(void *);
int drm_agp_bind_memory(void *, off_t);
int drm_agp_unbind_memory(void *);
-int drm_agp_alloc(struct drm_device *, drm_agp_buffer_t *);
-int drm_agp_free(struct drm_device *, drm_agp_buffer_t *);
-int drm_agp_bind(struct drm_device *, drm_agp_binding_t *);
-int drm_agp_unbind(struct drm_device *, drm_agp_binding_t *);
+int drm_agp_alloc(struct drm_device *, struct drm_agp_buffer *);
+int drm_agp_free(struct drm_device *, struct drm_agp_buffer *);
+int drm_agp_bind(struct drm_device *, struct drm_agp_binding *);
+int drm_agp_unbind(struct drm_device *, struct drm_agp_binding *);
/* Scatter Gather Support (drm_scatter.c) */
void drm_sg_cleanup(drm_sg_mem_t *);
-int drm_sg_alloc(struct drm_device *, drm_scatter_gather_t *);
+int drm_sg_alloc(struct drm_device *, struct drm_scatter_gather *);
/* ATI PCIGART support (ati_pcigart.c) */
int drm_ati_pcigart_init(struct drm_device *,
}
int
-drm_agp_info(struct drm_device * dev, drm_agp_info_t *info)
+drm_agp_info(struct drm_device * dev, struct drm_agp_info *info)
{
struct agp_info *kern;
drm_agp_info_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_agp_info_t *info = data;
+ struct drm_agp_info *info = data;
return (drm_agp_info(dev, info));
}
drm_agp_enable_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_agp_mode_t *mode = data;
+ struct drm_agp_mode *mode = data;
return (drm_agp_enable(dev, *mode));
}
int
-drm_agp_alloc(struct drm_device *dev, drm_agp_buffer_t *request)
+drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
{
#ifndef DRM_NO_AGP
struct drm_agp_mem *entry;
drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_agp_buffer_t *request = data;
+ struct drm_agp_buffer *request = data;
int retcode;
DRM_LOCK();
}
int
-drm_agp_unbind(struct drm_device *dev, drm_agp_binding_t *request)
+drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request)
{
struct drm_agp_mem *entry;
int retcode;
drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_agp_binding_t *request = data;
+ struct drm_agp_binding *request = data;
int retcode;
DRM_LOCK();
}
int
-drm_agp_bind(struct drm_device *dev, drm_agp_binding_t *request)
+drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request)
{
struct drm_agp_mem *entry;
int retcode, page;
drm_agp_bind_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_agp_binding_t *request = data;
+ struct drm_agp_binding *request = data;
int retcode;
DRM_LOCK();
}
int
-drm_agp_free(struct drm_device *dev, drm_agp_buffer_t *request)
+drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request)
{
struct drm_agp_mem *entry;
drm_agp_free_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_agp_buffer_t *request = data;
+ struct drm_agp_buffer *request = data;
int retcode;
DRM_LOCK();
int
drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_auth_t *auth = data;
+ struct drm_auth *auth = data;
/* Find unique magic */
if (file_priv->magic) {
int
drm_authmagic(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_auth_t *auth = data;
+ struct drm_auth *auth = data;
struct drm_file *priv;
DRM_DEBUG("%u\n", auth->magic);
int
drm_addmap(struct drm_device * dev, unsigned long offset, unsigned long size,
- drm_map_type_t type, drm_map_flags_t flags, drm_local_map_t **map_ptr)
+ enum drm_map_type type, enum drm_map_flags flags, drm_local_map_t **map_ptr)
{
drm_local_map_t *map;
int align, ret = 0;
int
drm_addmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_map_t *request = data;
- drm_local_map_t *map;
- int err;
+ struct drm_map *request = data;
+ drm_local_map_t *map;
+ int err;
if (!(file_priv->flags & (FREAD|FWRITE)))
return EACCES; /* Require read/write */
int
drm_rmmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_local_map_t *map;
- drm_map_t *request = data;
+ drm_local_map_t *map;
+ struct drm_map *request = data;
DRM_LOCK();
TAILQ_FOREACH(map, &dev->maplist, link) {
}
int
-drm_do_addbufs_agp(struct drm_device *dev, drm_buf_desc_t *request)
+drm_do_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *request)
{
drm_device_dma_t *dma = dev->dma;
drm_buf_entry_t *entry;
}
int
-drm_do_addbufs_pci(struct drm_device *dev, drm_buf_desc_t *request)
+drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request)
{
drm_device_dma_t *dma = dev->dma;
int count;
}
int
-drm_do_addbufs_sg(struct drm_device *dev, drm_buf_desc_t *request)
+drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *request)
{
drm_device_dma_t *dma = dev->dma;
drm_buf_entry_t *entry;
}
int
-drm_addbufs_agp(struct drm_device *dev, drm_buf_desc_t *request)
+drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *request)
{
int order, ret;
}
int
-drm_addbufs_sg(struct drm_device *dev, drm_buf_desc_t *request)
+drm_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *request)
{
int order, ret;
}
int
-drm_addbufs_pci(struct drm_device *dev, drm_buf_desc_t *request)
+drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request)
{
int order, ret;
drm_addbufs_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_buf_desc_t *request = data;
+ struct drm_buf_desc *request = data;
int err;
if (request->flags & _DRM_AGP_BUFFER)
int
drm_freebufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_device_dma_t *dma = dev->dma;
- drm_buf_free_t *request = data;
- int i;
- int idx;
- drm_buf_t *buf;
- int retcode = 0;
+ drm_device_dma_t *dma = dev->dma;
+ struct drm_buf_free *request = data;
+ drm_buf_t *buf;
+ int i, idx, retcode = 0;
DRM_DEBUG("%d\n", request->count);
int retcode = 0;
const int zero = 0;
- drm_buf_map_t *request = data;
+ struct drm_buf_map *request = data;
int i;
if (!vfinddev(file_priv->kdev, VCHR, &vn))
int
drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_ctx_res_t *res = data;
- drm_ctx_t ctx;
- int i;
+ struct drm_ctx_res *res = data;
+ struct drm_ctx ctx;
+ int i;
if (res->count >= DRM_RESERVED_CONTEXTS) {
bzero(&ctx, sizeof(ctx));
int
drm_addctx(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_ctx_t *ctx = data;
+ struct drm_ctx *ctx = data;
ctx->handle = drm_ctxbitmap_next(dev);
if (ctx->handle == DRM_KERNEL_CONTEXT) {
int
drm_getctx(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_ctx_t *ctx = data;
+ struct drm_ctx *ctx = data;
/* This is 0, because we don't handle any context flags */
ctx->flags = 0;
int
drm_rmctx(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_ctx_t *ctx = data;
+ struct drm_ctx *ctx = data;
DRM_DEBUG("%d\n", ctx->handle);
if (ctx->handle != DRM_KERNEL_CONTEXT) {
int
drm_adddraw(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_draw_t *draw = data;
- struct bsd_drm_drawable_info *info;
+ struct drm_draw *draw = data;
+ struct bsd_drm_drawable_info *info;
info = drm_calloc(1, sizeof(struct bsd_drm_drawable_info),
DRM_MEM_DRAWABLE);
int
drm_rmdraw(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_draw_t *draw = (drm_draw_t *)data;
- struct bsd_drm_drawable_info *info;
+ struct drm_draw *draw = (drm_draw_t *)data;
+ struct bsd_drm_drawable_info *info;
DRM_SPINLOCK(&dev->drw_lock);
info = drm_get_drawable(dev, draw->handle);
int
drm_version(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_version_t *version = data;
- int len;
+ struct drm_version *version = data;
+ int len;
#define DRM_COPY(name, value) \
len = strlen( value ); \
int
drm_getunique(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_unique_t *u = data;
+ struct drm_unique *u = data;
if (u->unique_len >= dev->unique_len) {
if (DRM_COPY_TO_USER(u->unique, dev->unique, dev->unique_len))
int
drm_setunique(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_unique_t *u = data;
- int domain, bus, slot, func, ret;
- char *busid;
+ struct drm_unique *u = data;
+ char *busid;
+ int domain, bus, slot, func, ret;
#if defined (__NetBSD__)
return EOPNOTSUPP;
#endif
int
drm_getmap(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_map_t *map = data;
- drm_local_map_t *mapinlist;
- int idx;
- int i = 0;
+ struct drm_map *map = data;
+ drm_local_map_t *mapinlist;
+ int idx, i = 0;
idx = map->offset;
int
drm_getclient(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_client_t *client = data;
- struct drm_file *pt;
+ struct drm_client *client = data;
+ struct drm_file *pt;
int idx;
int i = 0;
int
drm_getstats(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_stats_t *stats = data;
- int i;
+ struct drm_stats *stats = data;
+ int i;
- memset(stats, 0, sizeof(drm_stats_t));
+ memset(stats, 0, sizeof(struct drm_stats));
DRM_LOCK();
int
drm_setversion(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_set_version_t *sv = data;
- drm_set_version_t ver;
- int if_version;
+ struct drm_set_version ver, *sv = data;
+ int if_version;
/* Save the incoming data, and set the response before continuing
* any further.
int
drm_irq_by_busid(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_irq_busid_t *irq = data;
+ struct drm_irq_busid *irq = data;
if ((irq->busnum >> 8) != dev->pci_domain ||
(irq->busnum & 0xff) != dev->pci_bus ||
int
drm_control(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_control_t *ctl = data;
- int err;
+ struct drm_control *ctl = data;
+ int err;
switch (ctl->func) {
case DRM_INST_HANDLER:
int
drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_wait_vblank_t *vblwait = data;
- int ret, flags, crtc, seq;
+ union drm_wait_vblank *vblwait = data;
+ int ret, flags, crtc, seq;
if (!dev->irq_enabled)
return EINVAL;
int
drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_lock_t *lock = data;
+ struct drm_lock *lock = data;
int ret = 0;
if (lock->context == DRM_KERNEL_CONTEXT) {
int
drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_lock_t *lock = data;
+ struct drm_lock *lock = data;
if (lock->context == DRM_KERNEL_CONTEXT) {
DRM_ERROR("Process %d using kernel context %d\n",
}
int
-drm_sg_alloc(struct drm_device * dev, drm_scatter_gather_t * request)
+drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather *request)
{
- drm_sg_mem_t *entry;
- unsigned long pages;
- int i;
+ drm_sg_mem_t *entry;
+ unsigned long pages;
+ int i;
if (dev->sg != NULL)
return EINVAL;
drm_sg_alloc_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_scatter_gather_t *request = data;
- int ret;
+ struct drm_scatter_gather *request = data;
+ int ret;
DRM_DEBUG("\n");
int
drm_sg_free(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_scatter_gather_t *request = data;
- drm_sg_mem_t *entry;
+ struct drm_scatter_gather *request = data;
+ drm_sg_mem_t *entry;
DRM_LOCK();
entry = dev->sg;
paddr_t
drmmmap(dev_t kdev, off_t offset, int prot)
{
- struct drm_device *dev = drm_get_device_from_kdev(kdev);
- drm_local_map_t *map;
- struct drm_file *priv;
- drm_map_type_t type;
- paddr_t phys;
+ struct drm_device *dev = drm_get_device_from_kdev(kdev);
+ drm_local_map_t *map;
+ struct drm_file *priv;
+ enum drm_map_type type;
+ paddr_t phys;
DRM_LOCK();
priv = drm_find_file_by_minor(dev, minor(kdev));