mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-01-01 17:40:17 +01:00
merge back bunch of whitespace and misc changes from kernel
This commit is contained in:
parent
f96e00595d
commit
eeae6a0a38
32 changed files with 102 additions and 119 deletions
|
|
@ -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 *);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
18
linux/drmP.h
18
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 *);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 |
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 |
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue