summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2004-09-05 10:54:59 +0000
committerDave Airlie <airlied@linux.ie>2004-09-05 10:54:59 +0000
commiteeae6a0a3885f9af9efba7c1e1bcb1e633635717 (patch)
treeca92f0395e3745cb78c752c93968d175ca0b5e38 /linux
parentf96e00595dff85e18697205686f568042e0b083b (diff)
merge back bunch of whitespace and misc changes from kernel
Diffstat (limited to 'linux')
-rw-r--r--linux/drmP.h18
-rw-r--r--linux/drm_context.h3
-rw-r--r--linux/drm_dma.h4
-rw-r--r--linux/drm_drv.h9
-rw-r--r--linux/drm_fops.h12
-rw-r--r--linux/drm_ioctl.h4
-rw-r--r--linux/drm_irq.h6
-rw-r--r--linux/drm_memory.h4
-rw-r--r--linux/drm_scatter.h4
-rw-r--r--linux/drm_vm.h6
-rw-r--r--linux/ffb_context.c21
-rw-r--r--linux/i810_dma.c2
12 files changed, 43 insertions, 50 deletions
diff --git a/linux/drmP.h b/linux/drmP.h
index 1488544a..aa62e4c3 100644
--- a/linux/drmP.h
+++ b/linux/drmP.h
@@ -98,14 +98,14 @@
/* driver capabilities and requirements mask */
#define DRIVER_USE_AGP 0x1
#define DRIVER_REQUIRE_AGP 0x2
-#define DRIVER_USE_MTRR 0x4
-#define DRIVER_HAVE_DMA 0x10
-#define DRIVER_HAVE_IRQ 0x20
-#define DRIVER_SG 0x40
-#define DRIVER_PCI_DMA 0x80
-#define DRIVER_IRQ_SHARED 0x100
-#define DRIVER_IRQ_VBL 0x200
-#define DRIVER_DMA_QUEUE 0x800
+#define DRIVER_USE_MTRR 0x4
+#define DRIVER_PCI_DMA 0x8
+#define DRIVER_SG 0x10
+#define DRIVER_HAVE_DMA 0x20
+#define DRIVER_HAVE_IRQ 0x40
+#define DRIVER_IRQ_SHARED 0x80
+#define DRIVER_IRQ_VBL 0x100
+#define DRIVER_DMA_QUEUE 0x200
/*@}*/
@@ -520,7 +520,7 @@ struct drm_driver_fn {
/* these are opposites at the moment */
int (*open_helper)(struct drm_device *, drm_file_t *);
- void (*free_filp_private)(struct drm_device *, drm_file_t *);
+ void (*free_filp_priv)(struct drm_device *, drm_file_t *);
void (*release)(struct drm_device *, struct file *filp);
void (*dma_ready)(struct drm_device *);
diff --git a/linux/drm_context.h b/linux/drm_context.h
index e1cb95c6..b99c9947 100644
--- a/linux/drm_context.h
+++ b/linux/drm_context.h
@@ -1,5 +1,5 @@
/**
-* \file drm_context.h
+ * \file drm_context.h
* IOCTLs for generic contexts
*
* \author Rickard E. (Rik) Faith <faith@valinux.com>
@@ -573,5 +573,6 @@ int DRM(rmctx)( struct inode *inode, struct file *filp,
return 0;
}
+
/*@}*/
diff --git a/linux/drm_dma.h b/linux/drm_dma.h
index 05a5936a..5cbdc931 100644
--- a/linux/drm_dma.h
+++ b/linux/drm_dma.h
@@ -35,7 +35,6 @@
#include "drmP.h"
-
/**
* Initialize the DMA data.
*
@@ -107,7 +106,6 @@ void DRM(dma_takedown)(drm_device_t *dev)
dma->bufs[i].buf_count *
sizeof(*dma->bufs[0].buflist),
DRM_MEM_BUFS);
-
}
}
@@ -144,7 +142,7 @@ void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf)
buf->filp = NULL;
buf->used = 0;
- if ( drm_core_check_feature(dev, DRIVER_DMA_QUEUE) && waitqueue_active(&buf->dma_wait)) {
+ if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE) && waitqueue_active(&buf->dma_wait)) {
wake_up_interruptible(&buf->dma_wait);
}
}
diff --git a/linux/drm_drv.h b/linux/drm_drv.h
index 2c1719da..af372b2e 100644
--- a/linux/drm_drv.h
+++ b/linux/drm_drv.h
@@ -52,8 +52,6 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-
-
#ifndef __HAVE_COUNTERS
#define __HAVE_COUNTERS 0
#endif
@@ -348,7 +346,7 @@ static int DRM(takedown)( drm_device_t *dev )
}
/* Clear AGP information */
- if ( drm_core_has_AGP(dev) && dev->agp ) {
+ if (drm_core_has_AGP(dev) && dev->agp) {
drm_agp_mem_t *entry;
drm_agp_mem_t *nexte;
@@ -412,7 +410,7 @@ static int DRM(takedown)( drm_device_t *dev )
}
- if ( drm_core_check_feature(dev, DRIVER_DMA_QUEUE) && dev->queuelist ) {
+ if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE) && dev->queuelist) {
for ( i = 0 ; i < dev->queue_count ; i++ ) {
if ( dev->queuelist[i] ) {
@@ -437,7 +435,6 @@ static int DRM(takedown)( drm_device_t *dev )
dev->lock.filp = NULL;
wake_up_interruptible( &dev->lock.lock_queue );
}
-
up( &dev->struct_sem );
return 0;
@@ -509,7 +506,7 @@ static int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (drm_core_has_AGP(dev)) {
dev->agp = DRM(agp_init)();
- if ( drm_core_check_feature(dev, DRIVER_REQUIRE_AGP) && dev->agp == NULL ) {
+ if (drm_core_check_feature(dev, DRIVER_REQUIRE_AGP) && (dev->agp == NULL)) {
DRM_ERROR( "Cannot initialize the agpgart module.\n" );
retcode = -EINVAL;
goto error_out_unreg;
diff --git a/linux/drm_fops.h b/linux/drm_fops.h
index 21935b7a..0e91190a 100644
--- a/linux/drm_fops.h
+++ b/linux/drm_fops.h
@@ -73,11 +73,10 @@ int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev)
priv->authenticated = capable(CAP_SYS_ADMIN);
priv->lock_count = 0;
- if (dev->fn_tbl.open_helper)
- {
- ret=dev->fn_tbl.open_helper(dev, priv);
- if (ret < 0)
- goto out_free;
+ if (dev->fn_tbl.open_helper) {
+ ret=dev->fn_tbl.open_helper(dev, priv);
+ if (ret < 0)
+ goto out_free;
}
down(&dev->struct_sem);
@@ -110,8 +109,9 @@ int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev)
#endif
return 0;
- out_free:
+out_free:
DRM(free)(priv, sizeof(*priv), DRM_MEM_FILES);
+ filp->private_data=NULL;
return ret;
}
diff --git a/linux/drm_ioctl.h b/linux/drm_ioctl.h
index c3725668..33695440 100644
--- a/linux/drm_ioctl.h
+++ b/linux/drm_ioctl.h
@@ -343,9 +343,7 @@ int DRM(setversion)(DRM_IOCTL_ARGS)
return EINVAL;
if (dev->fn_tbl.set_version)
- dev->fn_tbl.set_version(dev, &sv);
-
+ dev->fn_tbl.set_version(dev, &sv);
}
return 0;
}
-
diff --git a/linux/drm_irq.h b/linux/drm_irq.h
index a1622c0e..593c9e5b 100644
--- a/linux/drm_irq.h
+++ b/linux/drm_irq.h
@@ -94,7 +94,7 @@ int DRM(irq_install)( drm_device_t *dev )
int ret;
unsigned long sh_flags=0;
- if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ ))
+ if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL;
if ( dev->irq == 0 )
@@ -135,7 +135,7 @@ int DRM(irq_install)( drm_device_t *dev )
dev->fn_tbl.irq_preinstall(dev);
/* Install handler */
- if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
+ if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
sh_flags = SA_SHIRQ;
ret = request_irq( dev->irq, dev->fn_tbl.irq_handler,
@@ -164,7 +164,7 @@ int DRM(irq_uninstall)( drm_device_t *dev )
{
int irq_enabled;
- if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ ))
+ if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL;
down( &dev->struct_sem );
diff --git a/linux/drm_memory.h b/linux/drm_memory.h
index 2cdccb13..9674cef0 100644
--- a/linux/drm_memory.h
+++ b/linux/drm_memory.h
@@ -161,7 +161,7 @@ static inline unsigned long drm_follow_page (void *vaddr)
static inline void *drm_ioremap(unsigned long offset, unsigned long size, drm_device_t *dev)
{
#if defined(VMAP_4_ARGS)
- if ( drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
+ if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
drm_map_t *map = drm_lookup_map(offset, size, dev);
if (map && map->type == _DRM_AGP)
@@ -176,7 +176,7 @@ static inline void *drm_ioremap_nocache(unsigned long offset, unsigned long size
drm_device_t *dev)
{
#if defined(VMAP_4_ARGS)
- if ( drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
+ if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
drm_map_t *map = drm_lookup_map(offset, size, dev);
if (map && map->type == _DRM_AGP)
diff --git a/linux/drm_scatter.h b/linux/drm_scatter.h
index 888e6296..dd5bea82 100644
--- a/linux/drm_scatter.h
+++ b/linux/drm_scatter.h
@@ -73,7 +73,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
DRM_DEBUG( "%s\n", __FUNCTION__ );
- if ( drm_core_check_feature(dev, DRIVER_SG ))
+ if (drm_core_check_feature(dev, DRIVER_SG))
return -EINVAL;
if ( dev->sg )
@@ -209,7 +209,7 @@ int DRM(sg_free)( struct inode *inode, struct file *filp,
drm_scatter_gather_t request;
drm_sg_mem_t *entry;
- if ( drm_core_check_feature(dev, DRIVER_SG ))
+ if (drm_core_check_feature(dev, DRIVER_SG))
return -EINVAL;
if ( copy_from_user( &request,
diff --git a/linux/drm_vm.h b/linux/drm_vm.h
index 965b7dd1..277aae0a 100644
--- a/linux/drm_vm.h
+++ b/linux/drm_vm.h
@@ -498,15 +498,15 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
unsigned long DRM(core_get_map_ofs)(drm_map_t *map)
{
- return map->offset;
+ return map->offset;
}
unsigned long DRM(core_get_reg_ofs)(struct drm_device *dev)
{
#ifdef __alpha__
- return dev->hose->dense_mem_base - dev->hose->mem_space->start;
+ return dev->hose->dense_mem_base - dev->hose->mem_space->start;
#else
- return 0;
+ return 0;
#endif
}
diff --git a/linux/ffb_context.c b/linux/ffb_context.c
index 0fccddb8..718ae93f 100644
--- a/linux/ffb_context.c
+++ b/linux/ffb_context.c
@@ -388,7 +388,7 @@ int DRM(resctx)(struct inode *inode, struct file *filp, unsigned int cmd,
int i;
DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
- if (copy_from_user(&res, (drm_ctx_res_t *)arg, sizeof(res)))
+ if (copy_from_user(&res, (drm_ctx_res_t __user *)arg, sizeof(res)))
return -EFAULT;
if (res.count >= DRM_RESERVED_CONTEXTS) {
memset(&ctx, 0, sizeof(ctx));
@@ -401,7 +401,7 @@ int DRM(resctx)(struct inode *inode, struct file *filp, unsigned int cmd,
}
}
res.count = DRM_RESERVED_CONTEXTS;
- if (copy_to_user((drm_ctx_res_t *)arg, &res, sizeof(res)))
+ if (copy_to_user((drm_ctx_res_t __user *)arg, &res, sizeof(res)))
return -EFAULT;
return 0;
}
@@ -415,7 +415,7 @@ int DRM(addctx)(struct inode *inode, struct file *filp, unsigned int cmd,
drm_ctx_t ctx;
int idx;
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+ if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
return -EFAULT;
idx = DRM(alloc_queue)(dev, (ctx.flags & _DRM_CONTEXT_2DONLY));
if (idx < 0)
@@ -423,7 +423,7 @@ int DRM(addctx)(struct inode *inode, struct file *filp, unsigned int cmd,
DRM_DEBUG("%d\n", ctx.handle);
ctx.handle = idx;
- if (copy_to_user((drm_ctx_t *)arg, &ctx, sizeof(ctx)))
+ if (copy_to_user((drm_ctx_t __user *)arg, &ctx, sizeof(ctx)))
return -EFAULT;
return 0;
}
@@ -438,7 +438,7 @@ int DRM(modctx)(struct inode *inode, struct file *filp, unsigned int cmd,
drm_ctx_t ctx;
int idx;
- if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
+ if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
return -EFAULT;
idx = ctx.handle;
@@ -467,7 +467,7 @@ int DRM(getctx)(struct inode *inode, struct file *filp, unsigned int cmd,
drm_ctx_t ctx;
int idx;
- if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
+ if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
return -EFAULT;
idx = ctx.handle;
@@ -483,7 +483,7 @@ int DRM(getctx)(struct inode *inode, struct file *filp, unsigned int cmd,
else
ctx.flags = 0;
- if (copy_to_user((drm_ctx_t*)arg, &ctx, sizeof(ctx)))
+ if (copy_to_user((drm_ctx_t __user *)arg, &ctx, sizeof(ctx)))
return -EFAULT;
return 0;
@@ -496,7 +496,7 @@ int DRM(switchctx)(struct inode *inode, struct file *filp, unsigned int cmd,
drm_device_t *dev = priv->dev;
drm_ctx_t ctx;
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+ if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
return -EFAULT;
DRM_DEBUG("%d\n", ctx.handle);
return DRM(context_switch)(dev, dev->last_context, ctx.handle);
@@ -507,7 +507,7 @@ int DRM(newctx)(struct inode *inode, struct file *filp, unsigned int cmd,
{
drm_ctx_t ctx;
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+ if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
return -EFAULT;
DRM_DEBUG("%d\n", ctx.handle);
@@ -523,7 +523,7 @@ int DRM(rmctx)(struct inode *inode, struct file *filp, unsigned int cmd,
ffb_dev_priv_t *fpriv = (ffb_dev_priv_t *) dev->dev_private;
int idx;
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+ if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
return -EFAULT;
DRM_DEBUG("%d\n", ctx.handle);
@@ -613,5 +613,4 @@ static void ffb_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.kernel_context_switch_unlock = ffb_driver_kernel_context_switch_unlock;
dev->fn_tbl.get_map_ofs = ffb_driver_get_map_ofs;
dev->fn_tbl.get_reg_ofs = ffb_driver_get_reg_ofs;
-
}
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index fe8f5c1d..43c044c0 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -242,7 +242,7 @@ int i810_dma_cleanup(drm_device_t *dev)
* may not have been called from userspace and after dev_private
* is freed, it's too late.
*/
- if ( drm_core_check_feature(dev, DRIVER_HAVE_IRQ) && dev->irq_enabled )
+ if (drm_core_check_feature(dev, DRIVER_HAVE_IRQ) && dev->irq_enabled)
DRM(irq_uninstall)(dev);
if (dev->dev_private) {