summaryrefslogtreecommitdiff
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
parentf96e00595dff85e18697205686f568042e0b083b (diff)
merge back bunch of whitespace and misc changes from kernel
-rw-r--r--linux-core/drmP.h18
-rw-r--r--linux-core/drm_context.c3
-rw-r--r--linux-core/drm_dma.c4
-rw-r--r--linux-core/drm_drv.c9
-rw-r--r--linux-core/drm_fops.c12
-rw-r--r--linux-core/drm_ioctl.c4
-rw-r--r--linux-core/drm_irq.c6
-rw-r--r--linux-core/drm_memory.h4
-rw-r--r--linux-core/drm_scatter.c4
-rw-r--r--linux-core/drm_vm.c6
-rw-r--r--linux-core/ffb_context.c21
-rw-r--r--linux-core/i810_dma.c2
-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
-rw-r--r--shared-core/i915_dma.c6
-rw-r--r--shared-core/i915_drv.h6
-rw-r--r--shared-core/radeon_state.c4
-rw-r--r--shared/i915.h1
-rw-r--r--shared/i915_dma.c6
-rw-r--r--shared/i915_drv.h6
-rw-r--r--shared/r128.h2
-rw-r--r--shared/radeon_state.c4
32 files changed, 102 insertions, 119 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 1488544a..aa62e4c3 100644
--- a/linux-core/drmP.h
+++ b/linux-core/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-core/drm_context.c b/linux-core/drm_context.c
index e1cb95c6..b99c9947 100644
--- a/linux-core/drm_context.c
+++ b/linux-core/drm_context.c
@@ -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-core/drm_dma.c b/linux-core/drm_dma.c
index 05a5936a..5cbdc931 100644
--- a/linux-core/drm_dma.c
+++ b/linux-core/drm_dma.c
@@ -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-core/drm_drv.c b/linux-core/drm_drv.c
index 2c1719da..af372b2e 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -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-core/drm_fops.c b/linux-core/drm_fops.c
index 21935b7a..0e91190a 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -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-core/drm_ioctl.c b/linux-core/drm_ioctl.c
index c3725668..33695440 100644
--- a/linux-core/drm_ioctl.c
+++ b/linux-core/drm_ioctl.c
@@ -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-core/drm_irq.c b/linux-core/drm_irq.c
index a1622c0e..593c9e5b 100644
--- a/linux-core/drm_irq.c
+++ b/linux-core/drm_irq.c
@@ -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-core/drm_memory.h b/linux-core/drm_memory.h
index 2cdccb13..9674cef0 100644
--- a/linux-core/drm_memory.h
+++ b/linux-core/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-core/drm_scatter.c b/linux-core/drm_scatter.c
index 888e6296..dd5bea82 100644
--- a/linux-core/drm_scatter.c
+++ b/linux-core/drm_scatter.c
@@ -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-core/drm_vm.c b/linux-core/drm_vm.c
index 965b7dd1..277aae0a 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -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-core/ffb_context.c b/linux-core/ffb_context.c
index 0fccddb8..718ae93f 100644
--- a/linux-core/ffb_context.c
+++ b/linux-core/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-core/i810_dma.c b/linux-core/i810_dma.c
index fe8f5c1d..43c044c0 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/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) {
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) {
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index f99a69f4..34552008 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -733,7 +733,7 @@ int i915_setparam(DRM_IOCTL_ARGS)
return 0;
}
-static void i915_driver_pretakedown(drm_device_t * dev)
+static void i915_driver_pretakedown(drm_device_t *dev)
{
if (dev->dev_private) {
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -742,7 +742,7 @@ static void i915_driver_pretakedown(drm_device_t * dev)
i915_dma_cleanup(dev);
}
-static void i915_driver_prerelease(drm_device_t * dev, DRMFILE filp)
+static void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp)
{
if (dev->dev_private) {
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -750,7 +750,7 @@ static void i915_driver_prerelease(drm_device_t * dev, DRMFILE filp)
}
}
-void i915_driver_register_fns(drm_device_t * dev)
+void i915_driver_register_fns(drm_device_t *dev)
{
dev->driver_features =
DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR |
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index 828c2371..7564cd09 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -74,9 +74,9 @@ extern int i915_wait_irq(drm_device_t * dev, int irq_nr);
extern int i915_emit_irq(drm_device_t * dev);
extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS);
-extern void i915_driver_irq_preinstall(drm_device_t * dev);
-extern void i915_driver_irq_postinstall(drm_device_t * dev);
-extern void i915_driver_irq_uninstall(drm_device_t * dev);
+extern void i915_driver_irq_preinstall(drm_device_t *dev);
+extern void i915_driver_irq_postinstall(drm_device_t *dev);
+extern void i915_driver_irq_uninstall(drm_device_t *dev);
/* i915_mem.c */
extern int i915_mem_alloc(DRM_IOCTL_ARGS);
diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c
index e67bdc0f..9675da92 100644
--- a/shared-core/radeon_state.c
+++ b/shared-core/radeon_state.c
@@ -2596,7 +2596,7 @@ static int radeon_driver_open_helper(drm_device_t *dev, drm_file_t *filp_priv)
return 0;
}
-static void radeon_driver_free_filp_private(drm_device_t *dev, drm_file_t *filp_priv)
+static void radeon_driver_free_filp_priv(drm_device_t *dev, drm_file_t *filp_priv)
{
struct drm_radeon_driver_file_fields *radeon_priv = filp_priv->driver_priv;
@@ -2618,5 +2618,5 @@ void radeon_driver_register_fns(struct drm_device *dev)
dev->fn_tbl.irq_postinstall = radeon_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = radeon_driver_irq_uninstall;
dev->fn_tbl.irq_handler = radeon_driver_irq_handler;
- dev->fn_tbl.free_filp_private = radeon_driver_free_filp_private;
+ dev->fn_tbl.free_filp_priv = radeon_driver_free_filp_priv;
}
diff --git a/shared/i915.h b/shared/i915.h
index d3ecbb76..ed4e13d7 100644
--- a/shared/i915.h
+++ b/shared/i915.h
@@ -54,7 +54,6 @@
/* We use our own dma mechanisms, not the drm template code. However,
* the shared IRQ code is useful to us:
*/
-
#define __HAVE_PM 1
#endif
diff --git a/shared/i915_dma.c b/shared/i915_dma.c
index f99a69f4..34552008 100644
--- a/shared/i915_dma.c
+++ b/shared/i915_dma.c
@@ -733,7 +733,7 @@ int i915_setparam(DRM_IOCTL_ARGS)
return 0;
}
-static void i915_driver_pretakedown(drm_device_t * dev)
+static void i915_driver_pretakedown(drm_device_t *dev)
{
if (dev->dev_private) {
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -742,7 +742,7 @@ static void i915_driver_pretakedown(drm_device_t * dev)
i915_dma_cleanup(dev);
}
-static void i915_driver_prerelease(drm_device_t * dev, DRMFILE filp)
+static void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp)
{
if (dev->dev_private) {
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -750,7 +750,7 @@ static void i915_driver_prerelease(drm_device_t * dev, DRMFILE filp)
}
}
-void i915_driver_register_fns(drm_device_t * dev)
+void i915_driver_register_fns(drm_device_t *dev)
{
dev->driver_features =
DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR |
diff --git a/shared/i915_drv.h b/shared/i915_drv.h
index 828c2371..7564cd09 100644
--- a/shared/i915_drv.h
+++ b/shared/i915_drv.h
@@ -74,9 +74,9 @@ extern int i915_wait_irq(drm_device_t * dev, int irq_nr);
extern int i915_emit_irq(drm_device_t * dev);
extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS);
-extern void i915_driver_irq_preinstall(drm_device_t * dev);
-extern void i915_driver_irq_postinstall(drm_device_t * dev);
-extern void i915_driver_irq_uninstall(drm_device_t * dev);
+extern void i915_driver_irq_preinstall(drm_device_t *dev);
+extern void i915_driver_irq_postinstall(drm_device_t *dev);
+extern void i915_driver_irq_uninstall(drm_device_t *dev);
/* i915_mem.c */
extern int i915_mem_alloc(DRM_IOCTL_ARGS);
diff --git a/shared/r128.h b/shared/r128.h
index bcee91b5..1df7042a 100644
--- a/shared/r128.h
+++ b/shared/r128.h
@@ -36,7 +36,6 @@
/* General customization:
*/
-
#define DRIVER_AUTHOR "Gareth Hughes, VA Linux Systems Inc."
#define DRIVER_NAME "r128"
@@ -73,5 +72,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_R128_INDIRECT)] = { r128_cce_indirect, 1, 1 }, \
[DRM_IOCTL_NR(DRM_IOCTL_R128_GETPARAM)] = { r128_getparam, 1, 0 },
-
#endif
diff --git a/shared/radeon_state.c b/shared/radeon_state.c
index e67bdc0f..9675da92 100644
--- a/shared/radeon_state.c
+++ b/shared/radeon_state.c
@@ -2596,7 +2596,7 @@ static int radeon_driver_open_helper(drm_device_t *dev, drm_file_t *filp_priv)
return 0;
}
-static void radeon_driver_free_filp_private(drm_device_t *dev, drm_file_t *filp_priv)
+static void radeon_driver_free_filp_priv(drm_device_t *dev, drm_file_t *filp_priv)
{
struct drm_radeon_driver_file_fields *radeon_priv = filp_priv->driver_priv;
@@ -2618,5 +2618,5 @@ void radeon_driver_register_fns(struct drm_device *dev)
dev->fn_tbl.irq_postinstall = radeon_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = radeon_driver_irq_uninstall;
dev->fn_tbl.irq_handler = radeon_driver_irq_handler;
- dev->fn_tbl.free_filp_private = radeon_driver_free_filp_private;
+ dev->fn_tbl.free_filp_priv = radeon_driver_free_filp_priv;
}