summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-04-03 14:59:28 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-04-03 14:59:28 +0000
commitb2ad1bccf2c866d0c964557e2c441e60c45cd58e (patch)
tree49ba4cc901f600b0b75b6becea7c2f796c9f9c6e /sys
parentef58af5804ee39c47be10250b1472ce2a6b33dc7 (diff)
detypedef struct drm_buf from the dma_buffers api. Just because it's
dying as soon as I can make it doesn't mean I shouldn't be able to look at it in the meantime.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/drmP.h12
-rw-r--r--sys/dev/pci/drm/drm_bufs.c90
2 files changed, 36 insertions, 66 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index aa67c20eaf0..54a89e00dde 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -95,8 +95,6 @@
(minor(_kdev) < drm_cd.cd_ndevs) ? drm_cd.cd_devs[minor(_kdev)] : NULL
#endif
-
-
/* DRM_SUSER returns true if the user is superuser */
#define DRM_SUSER(p) (suser(p, p->p_acflag) == 0)
#define DRM_MTRR_WC MDF_WRITECOMBINE
@@ -199,7 +197,7 @@ struct drm_pcidev {
struct drm_file;
struct drm_device;
-typedef struct drm_buf {
+struct drm_buf {
int idx; /* Index into master buflist */
int total; /* Buffer size */
int used; /* Amount of buffer in use (for DMA) */
@@ -209,7 +207,7 @@ typedef struct drm_buf {
__volatile__ int pending; /* On hardware DMA queue */
struct drm_file *file_priv; /* Unique identifier of holding process */
void *dev_private; /* Per-buffer private storage */
-} drm_buf_t;
+};
struct drm_dmamem {
bus_dmamap_t map;
@@ -221,7 +219,7 @@ struct drm_dmamem {
typedef struct drm_buf_entry {
struct drm_dmamem **seglist;
- drm_buf_t *buflist;
+ struct drm_buf *buflist;
int buf_size;
int buf_count;
int page_order;
@@ -256,7 +254,7 @@ struct drm_lock_data {
typedef struct drm_device_dma {
struct rwlock dma_lock;
drm_buf_entry_t bufs[DRM_MAX_ORDER+1];
- drm_buf_t **buflist; /* Vector of pointers info bufs */
+ struct drm_buf **buflist; /* Vector of pointers info bufs */
unsigned long *pagelist;
unsigned long byte_count;
int buf_use; /* Buffers in use -- cannot alloc */
@@ -522,7 +520,7 @@ int drm_dma(struct drm_device *, void *, struct drm_file *);
int drm_dma_setup(struct drm_device *);
void drm_dma_takedown(struct drm_device *);
void drm_cleanup_buf(struct drm_device *, drm_buf_entry_t *);
-void drm_free_buffer(struct drm_device *, drm_buf_t *);
+void drm_free_buffer(struct drm_device *, struct drm_buf *);
void drm_reclaim_buffers(struct drm_device *, struct drm_file *);
/* IRQ support (drm_irq.c) */
diff --git a/sys/dev/pci/drm/drm_bufs.c b/sys/dev/pci/drm/drm_bufs.c
index 519bbdfd4f0..26b1cc0f3fb 100644
--- a/sys/dev/pci/drm/drm_bufs.c
+++ b/sys/dev/pci/drm/drm_bufs.c
@@ -413,7 +413,7 @@ drm_dma_takedown(struct drm_device *dev)
void
-drm_free_buffer(struct drm_device *dev, drm_buf_t *buf)
+drm_free_buffer(struct drm_device *dev, struct drm_buf *buf)
{
if (buf == NULL)
return;
@@ -477,23 +477,15 @@ drm_dma(struct drm_device *dev, void *data, struct drm_file *file_priv)
int
drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *request)
{
- drm_device_dma_t *dma = dev->dma;
- drm_buf_entry_t *entry;
- drm_buf_t *buf;
- unsigned long offset;
- unsigned long agp_offset;
- int count;
- int order;
- int size;
- int alignment;
- int page_order;
- int total;
- int byte_count;
- int i;
- drm_buf_t **temp_buflist;
+ drm_device_dma_t *dma = dev->dma;
+ drm_buf_entry_t *entry;
+ struct drm_buf *buf, **temp_buflist;
+ unsigned long agp_offset, offset;
+ int alignment, count, order, page_order, size;
+ int total, byte_count, i;
#if 0 /* disabled for now */
- struct drm_agp_mem *agp_entry;
- int valid;
+ struct drm_agp_mem *agp_entry;
+ int valid;
#endif
count = request->count;
@@ -609,21 +601,12 @@ drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *request)
int
drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request)
{
- drm_device_dma_t *dma = dev->dma;
- int count;
- int order;
- int size;
- int total;
- int page_order;
- drm_buf_entry_t *entry;
- drm_buf_t *buf;
- int alignment;
- unsigned long offset;
- int i;
- int byte_count;
- int page_count;
- unsigned long *temp_pagelist;
- drm_buf_t **temp_buflist;
+ drm_device_dma_t *dma = dev->dma;
+ struct drm_buf *buf, **temp_buflist;
+ drm_buf_entry_t *entry;
+ int alignment, byte_count, count, i, order;
+ int page_count, page_order, size, total;
+ unsigned long offset, *temp_pagelist;
count = request->count;
order = drm_order(request->size);
@@ -752,20 +735,12 @@ drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request)
int
drm_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *request)
{
- drm_device_dma_t *dma = dev->dma;
- drm_buf_entry_t *entry;
- drm_buf_t *buf;
- unsigned long offset;
- unsigned long agp_offset;
- int count;
- int order;
- int size;
- int alignment;
- int page_order;
- int total;
- int byte_count;
- int i;
- drm_buf_t **temp_buflist;
+ drm_device_dma_t *dma = dev->dma;
+ drm_buf_entry_t *entry;
+ struct drm_buf *buf, **temp_buflist;
+ unsigned long agp_offset, offset;
+ int alignment, byte_count, count, i, order;
+ int page_order, size, total;
count = request->count;
order = drm_order(request->size);
@@ -896,7 +871,7 @@ drm_freebufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
drm_device_dma_t *dma = dev->dma;
struct drm_buf_free *request = data;
- drm_buf_t *buf;
+ struct drm_buf *buf;
int i, idx, retcode = 0;
DRM_DEBUG("%d\n", request->count);
@@ -930,18 +905,15 @@ drm_freebufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
int
drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_device_dma_t *dma = dev->dma;
- struct vmspace *vms;
- struct vnode *vn;
- vaddr_t address;
- voff_t foff;
- vsize_t size;
- vaddr_t vaddr;
- int retcode = 0;
- const int zero = 0;
-
- struct drm_buf_map *request = data;
- int i;
+ struct drm_buf_map *request = data;
+ drm_device_dma_t *dma = dev->dma;
+ struct vmspace *vms;
+ struct vnode *vn;
+ vaddr_t address, vaddr;
+ voff_t foff;
+ vsize_t size;
+ const int zero = 0;
+ int i, retcode = 0;
if (!vfinddev(file_priv->kdev, VCHR, &vn))
return EINVAL;