Commit ed8b6704 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Dave Airlie

drm: convert drm_ioctl to unlocked_ioctl

drm_ioctl is called with the Big Kernel Lock held,
which shows up very high in statistics on vfs_ioctl.

Moving the lock into the drm_ioctl function itself
makes sure we blame the right subsystem and it gets
us one step closer to eliminating the locked version
of fops->ioctl.

Since drm_ioctl does not require the lock itself,
we only need to hold it while calling the specific
handler. The 32 bit conversion handlers do not
interact with any other code, so they don't need
the BKL here either and can just call drm_ioctl.

As a bonus, this cleans up all the other users
of drm_ioctl which now no longer have to find
the inode or call lock_kernel.

[airlied: squashed the non-driver bits
of the second patch in here, this provides
the flag for drivers to use to select unlocked
ioctls - but doesn't modify any drivers].
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.sourceforge.net
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent dcd6dfcf
...@@ -434,11 +434,11 @@ static int drm_version(struct drm_device *dev, void *data, ...@@ -434,11 +434,11 @@ static int drm_version(struct drm_device *dev, void *data,
* Looks up the ioctl function in the ::ioctls table, checking for root * Looks up the ioctl function in the ::ioctls table, checking for root
* previleges if so required, and dispatches to the respective function. * previleges if so required, and dispatches to the respective function.
*/ */
int drm_ioctl(struct inode *inode, struct file *filp, long drm_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct drm_file *file_priv = filp->private_data; struct drm_file *file_priv = filp->private_data;
struct drm_device *dev = file_priv->minor->dev; struct drm_device *dev;
struct drm_ioctl_desc *ioctl; struct drm_ioctl_desc *ioctl;
drm_ioctl_t *func; drm_ioctl_t *func;
unsigned int nr = DRM_IOCTL_NR(cmd); unsigned int nr = DRM_IOCTL_NR(cmd);
...@@ -446,6 +446,7 @@ int drm_ioctl(struct inode *inode, struct file *filp, ...@@ -446,6 +446,7 @@ int drm_ioctl(struct inode *inode, struct file *filp,
char stack_kdata[128]; char stack_kdata[128];
char *kdata = NULL; char *kdata = NULL;
dev = file_priv->minor->dev;
atomic_inc(&dev->ioctl_count); atomic_inc(&dev->ioctl_count);
atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]); atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]);
++file_priv->ioctl_count; ++file_priv->ioctl_count;
...@@ -501,7 +502,13 @@ int drm_ioctl(struct inode *inode, struct file *filp, ...@@ -501,7 +502,13 @@ int drm_ioctl(struct inode *inode, struct file *filp,
goto err_i1; goto err_i1;
} }
} }
if (ioctl->flags & DRM_UNLOCKED)
retcode = func(dev, kdata, file_priv); retcode = func(dev, kdata, file_priv);
else {
lock_kernel();
retcode = func(dev, kdata, file_priv);
unlock_kernel();
}
if (cmd & IOC_OUT) { if (cmd & IOC_OUT) {
if (copy_to_user((void __user *)arg, kdata, if (copy_to_user((void __user *)arg, kdata,
......
...@@ -104,7 +104,7 @@ static int compat_drm_version(struct file *file, unsigned int cmd, ...@@ -104,7 +104,7 @@ static int compat_drm_version(struct file *file, unsigned int cmd,
&version->desc)) &version->desc))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file,
DRM_IOCTL_VERSION, (unsigned long)version); DRM_IOCTL_VERSION, (unsigned long)version);
if (err) if (err)
return err; return err;
...@@ -145,8 +145,7 @@ static int compat_drm_getunique(struct file *file, unsigned int cmd, ...@@ -145,8 +145,7 @@ static int compat_drm_getunique(struct file *file, unsigned int cmd,
&u->unique)) &u->unique))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_GET_UNIQUE, (unsigned long)u);
DRM_IOCTL_GET_UNIQUE, (unsigned long)u);
if (err) if (err)
return err; return err;
...@@ -174,8 +173,7 @@ static int compat_drm_setunique(struct file *file, unsigned int cmd, ...@@ -174,8 +173,7 @@ static int compat_drm_setunique(struct file *file, unsigned int cmd,
&u->unique)) &u->unique))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_SET_UNIQUE, (unsigned long)u);
DRM_IOCTL_SET_UNIQUE, (unsigned long)u);
} }
typedef struct drm_map32 { typedef struct drm_map32 {
...@@ -205,8 +203,7 @@ static int compat_drm_getmap(struct file *file, unsigned int cmd, ...@@ -205,8 +203,7 @@ static int compat_drm_getmap(struct file *file, unsigned int cmd,
if (__put_user(idx, &map->offset)) if (__put_user(idx, &map->offset))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_GET_MAP, (unsigned long)map);
DRM_IOCTL_GET_MAP, (unsigned long)map);
if (err) if (err)
return err; return err;
...@@ -246,8 +243,7 @@ static int compat_drm_addmap(struct file *file, unsigned int cmd, ...@@ -246,8 +243,7 @@ static int compat_drm_addmap(struct file *file, unsigned int cmd,
|| __put_user(m32.flags, &map->flags)) || __put_user(m32.flags, &map->flags))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_ADD_MAP, (unsigned long)map);
DRM_IOCTL_ADD_MAP, (unsigned long)map);
if (err) if (err)
return err; return err;
...@@ -284,8 +280,7 @@ static int compat_drm_rmmap(struct file *file, unsigned int cmd, ...@@ -284,8 +280,7 @@ static int compat_drm_rmmap(struct file *file, unsigned int cmd,
if (__put_user((void *)(unsigned long)handle, &map->handle)) if (__put_user((void *)(unsigned long)handle, &map->handle))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RM_MAP, (unsigned long)map);
DRM_IOCTL_RM_MAP, (unsigned long)map);
} }
typedef struct drm_client32 { typedef struct drm_client32 {
...@@ -314,8 +309,7 @@ static int compat_drm_getclient(struct file *file, unsigned int cmd, ...@@ -314,8 +309,7 @@ static int compat_drm_getclient(struct file *file, unsigned int cmd,
if (__put_user(idx, &client->idx)) if (__put_user(idx, &client->idx))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_GET_CLIENT, (unsigned long)client);
DRM_IOCTL_GET_CLIENT, (unsigned long)client);
if (err) if (err)
return err; return err;
...@@ -351,8 +345,7 @@ static int compat_drm_getstats(struct file *file, unsigned int cmd, ...@@ -351,8 +345,7 @@ static int compat_drm_getstats(struct file *file, unsigned int cmd,
if (!access_ok(VERIFY_WRITE, stats, sizeof(*stats))) if (!access_ok(VERIFY_WRITE, stats, sizeof(*stats)))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_GET_STATS, (unsigned long)stats);
DRM_IOCTL_GET_STATS, (unsigned long)stats);
if (err) if (err)
return err; return err;
...@@ -395,8 +388,7 @@ static int compat_drm_addbufs(struct file *file, unsigned int cmd, ...@@ -395,8 +388,7 @@ static int compat_drm_addbufs(struct file *file, unsigned int cmd,
|| __put_user(agp_start, &buf->agp_start)) || __put_user(agp_start, &buf->agp_start))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_ADD_BUFS, (unsigned long)buf);
DRM_IOCTL_ADD_BUFS, (unsigned long)buf);
if (err) if (err)
return err; return err;
...@@ -427,8 +419,7 @@ static int compat_drm_markbufs(struct file *file, unsigned int cmd, ...@@ -427,8 +419,7 @@ static int compat_drm_markbufs(struct file *file, unsigned int cmd,
|| __put_user(b32.high_mark, &buf->high_mark)) || __put_user(b32.high_mark, &buf->high_mark))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_MARK_BUFS, (unsigned long)buf);
DRM_IOCTL_MARK_BUFS, (unsigned long)buf);
} }
typedef struct drm_buf_info32 { typedef struct drm_buf_info32 {
...@@ -469,8 +460,7 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd, ...@@ -469,8 +460,7 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd,
|| __put_user(list, &request->list)) || __put_user(list, &request->list))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_INFO_BUFS, (unsigned long)request);
DRM_IOCTL_INFO_BUFS, (unsigned long)request);
if (err) if (err)
return err; return err;
...@@ -531,8 +521,7 @@ static int compat_drm_mapbufs(struct file *file, unsigned int cmd, ...@@ -531,8 +521,7 @@ static int compat_drm_mapbufs(struct file *file, unsigned int cmd,
|| __put_user(list, &request->list)) || __put_user(list, &request->list))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_MAP_BUFS, (unsigned long)request);
DRM_IOCTL_MAP_BUFS, (unsigned long)request);
if (err) if (err)
return err; return err;
...@@ -578,8 +567,7 @@ static int compat_drm_freebufs(struct file *file, unsigned int cmd, ...@@ -578,8 +567,7 @@ static int compat_drm_freebufs(struct file *file, unsigned int cmd,
&request->list)) &request->list))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_FREE_BUFS, (unsigned long)request);
DRM_IOCTL_FREE_BUFS, (unsigned long)request);
} }
typedef struct drm_ctx_priv_map32 { typedef struct drm_ctx_priv_map32 {
...@@ -605,8 +593,7 @@ static int compat_drm_setsareactx(struct file *file, unsigned int cmd, ...@@ -605,8 +593,7 @@ static int compat_drm_setsareactx(struct file *file, unsigned int cmd,
&request->handle)) &request->handle))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_SET_SAREA_CTX, (unsigned long)request);
DRM_IOCTL_SET_SAREA_CTX, (unsigned long)request);
} }
static int compat_drm_getsareactx(struct file *file, unsigned int cmd, static int compat_drm_getsareactx(struct file *file, unsigned int cmd,
...@@ -628,8 +615,7 @@ static int compat_drm_getsareactx(struct file *file, unsigned int cmd, ...@@ -628,8 +615,7 @@ static int compat_drm_getsareactx(struct file *file, unsigned int cmd,
if (__put_user(ctx_id, &request->ctx_id)) if (__put_user(ctx_id, &request->ctx_id))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_GET_SAREA_CTX, (unsigned long)request);
DRM_IOCTL_GET_SAREA_CTX, (unsigned long)request);
if (err) if (err)
return err; return err;
...@@ -664,8 +650,7 @@ static int compat_drm_resctx(struct file *file, unsigned int cmd, ...@@ -664,8 +650,7 @@ static int compat_drm_resctx(struct file *file, unsigned int cmd,
&res->contexts)) &res->contexts))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_RES_CTX, (unsigned long)res);
DRM_IOCTL_RES_CTX, (unsigned long)res);
if (err) if (err)
return err; return err;
...@@ -718,8 +703,7 @@ static int compat_drm_dma(struct file *file, unsigned int cmd, ...@@ -718,8 +703,7 @@ static int compat_drm_dma(struct file *file, unsigned int cmd,
&d->request_sizes)) &d->request_sizes))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_DMA, (unsigned long)d);
DRM_IOCTL_DMA, (unsigned long)d);
if (err) if (err)
return err; return err;
...@@ -751,8 +735,7 @@ static int compat_drm_agp_enable(struct file *file, unsigned int cmd, ...@@ -751,8 +735,7 @@ static int compat_drm_agp_enable(struct file *file, unsigned int cmd,
if (put_user(m32.mode, &mode->mode)) if (put_user(m32.mode, &mode->mode))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_AGP_ENABLE, (unsigned long)mode);
DRM_IOCTL_AGP_ENABLE, (unsigned long)mode);
} }
typedef struct drm_agp_info32 { typedef struct drm_agp_info32 {
...@@ -781,8 +764,7 @@ static int compat_drm_agp_info(struct file *file, unsigned int cmd, ...@@ -781,8 +764,7 @@ static int compat_drm_agp_info(struct file *file, unsigned int cmd,
if (!access_ok(VERIFY_WRITE, info, sizeof(*info))) if (!access_ok(VERIFY_WRITE, info, sizeof(*info)))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_AGP_INFO, (unsigned long)info);
DRM_IOCTL_AGP_INFO, (unsigned long)info);
if (err) if (err)
return err; return err;
...@@ -827,16 +809,14 @@ static int compat_drm_agp_alloc(struct file *file, unsigned int cmd, ...@@ -827,16 +809,14 @@ static int compat_drm_agp_alloc(struct file *file, unsigned int cmd,
|| __put_user(req32.type, &request->type)) || __put_user(req32.type, &request->type))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_AGP_ALLOC, (unsigned long)request);
DRM_IOCTL_AGP_ALLOC, (unsigned long)request);
if (err) if (err)
return err; return err;
if (__get_user(req32.handle, &request->handle) if (__get_user(req32.handle, &request->handle)
|| __get_user(req32.physical, &request->physical) || __get_user(req32.physical, &request->physical)
|| copy_to_user(argp, &req32, sizeof(req32))) { || copy_to_user(argp, &req32, sizeof(req32))) {
drm_ioctl(file->f_path.dentry->d_inode, file, drm_ioctl(file, DRM_IOCTL_AGP_FREE, (unsigned long)request);
DRM_IOCTL_AGP_FREE, (unsigned long)request);
return -EFAULT; return -EFAULT;
} }
...@@ -856,8 +836,7 @@ static int compat_drm_agp_free(struct file *file, unsigned int cmd, ...@@ -856,8 +836,7 @@ static int compat_drm_agp_free(struct file *file, unsigned int cmd,
|| __put_user(handle, &request->handle)) || __put_user(handle, &request->handle))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_AGP_FREE, (unsigned long)request);
DRM_IOCTL_AGP_FREE, (unsigned long)request);
} }
typedef struct drm_agp_binding32 { typedef struct drm_agp_binding32 {
...@@ -881,8 +860,7 @@ static int compat_drm_agp_bind(struct file *file, unsigned int cmd, ...@@ -881,8 +860,7 @@ static int compat_drm_agp_bind(struct file *file, unsigned int cmd,
|| __put_user(req32.offset, &request->offset)) || __put_user(req32.offset, &request->offset))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_AGP_BIND, (unsigned long)request);
DRM_IOCTL_AGP_BIND, (unsigned long)request);
} }
static int compat_drm_agp_unbind(struct file *file, unsigned int cmd, static int compat_drm_agp_unbind(struct file *file, unsigned int cmd,
...@@ -898,8 +876,7 @@ static int compat_drm_agp_unbind(struct file *file, unsigned int cmd, ...@@ -898,8 +876,7 @@ static int compat_drm_agp_unbind(struct file *file, unsigned int cmd,
|| __put_user(handle, &request->handle)) || __put_user(handle, &request->handle))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_AGP_UNBIND, (unsigned long)request);
DRM_IOCTL_AGP_UNBIND, (unsigned long)request);
} }
#endif /* __OS_HAS_AGP */ #endif /* __OS_HAS_AGP */
...@@ -923,8 +900,7 @@ static int compat_drm_sg_alloc(struct file *file, unsigned int cmd, ...@@ -923,8 +900,7 @@ static int compat_drm_sg_alloc(struct file *file, unsigned int cmd,
|| __put_user(x, &request->size)) || __put_user(x, &request->size))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_SG_ALLOC, (unsigned long)request);
DRM_IOCTL_SG_ALLOC, (unsigned long)request);
if (err) if (err)
return err; return err;
...@@ -950,8 +926,7 @@ static int compat_drm_sg_free(struct file *file, unsigned int cmd, ...@@ -950,8 +926,7 @@ static int compat_drm_sg_free(struct file *file, unsigned int cmd,
|| __put_user(x << PAGE_SHIFT, &request->handle)) || __put_user(x << PAGE_SHIFT, &request->handle))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_SG_FREE, (unsigned long)request);
DRM_IOCTL_SG_FREE, (unsigned long)request);
} }
#if defined(CONFIG_X86) || defined(CONFIG_IA64) #if defined(CONFIG_X86) || defined(CONFIG_IA64)
...@@ -981,8 +956,7 @@ static int compat_drm_update_draw(struct file *file, unsigned int cmd, ...@@ -981,8 +956,7 @@ static int compat_drm_update_draw(struct file *file, unsigned int cmd,
__put_user(update32.data, &request->data)) __put_user(update32.data, &request->data))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_UPDATE_DRAW, (unsigned long)request);
DRM_IOCTL_UPDATE_DRAW, (unsigned long)request);
return err; return err;
} }
#endif #endif
...@@ -1023,8 +997,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, ...@@ -1023,8 +997,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd,
|| __put_user(req32.request.signal, &request->request.signal)) || __put_user(req32.request.signal, &request->request.signal))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_WAIT_VBLANK, (unsigned long)request);
DRM_IOCTL_WAIT_VBLANK, (unsigned long)request);
if (err) if (err)
return err; return err;
...@@ -1094,16 +1067,14 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -1094,16 +1067,14 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
* than always failing. * than always failing.
*/ */
if (nr >= ARRAY_SIZE(drm_compat_ioctls)) if (nr >= ARRAY_SIZE(drm_compat_ioctls))
return drm_ioctl(filp->f_dentry->d_inode, filp, cmd, arg); return drm_ioctl(filp, cmd, arg);
fn = drm_compat_ioctls[nr]; fn = drm_compat_ioctls[nr];
lock_kernel(); /* XXX for now */
if (fn != NULL) if (fn != NULL)
ret = (*fn) (filp, cmd, arg); ret = (*fn) (filp, cmd, arg);
else else
ret = drm_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg); ret = drm_ioctl(filp, cmd, arg);
unlock_kernel();
return ret; return ret;
} }
......
...@@ -115,7 +115,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) ...@@ -115,7 +115,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
static const struct file_operations i810_buffer_fops = { static const struct file_operations i810_buffer_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = i810_mmap_buffers, .mmap = i810_mmap_buffers,
.fasync = drm_fasync, .fasync = drm_fasync,
}; };
......
...@@ -59,7 +59,7 @@ static struct drm_driver driver = { ...@@ -59,7 +59,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -117,7 +117,7 @@ static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) ...@@ -117,7 +117,7 @@ static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
static const struct file_operations i830_buffer_fops = { static const struct file_operations i830_buffer_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = i830_mmap_buffers, .mmap = i830_mmap_buffers,
.fasync = drm_fasync, .fasync = drm_fasync,
}; };
......
...@@ -70,7 +70,7 @@ static struct drm_driver driver = { ...@@ -70,7 +70,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -329,7 +329,7 @@ static struct drm_driver driver = { ...@@ -329,7 +329,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_gem_mmap, .mmap = drm_gem_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -66,8 +66,7 @@ static int compat_i915_batchbuffer(struct file *file, unsigned int cmd, ...@@ -66,8 +66,7 @@ static int compat_i915_batchbuffer(struct file *file, unsigned int cmd,
&batchbuffer->cliprects)) &batchbuffer->cliprects))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_I915_BATCHBUFFER,
DRM_IOCTL_I915_BATCHBUFFER,
(unsigned long)batchbuffer); (unsigned long)batchbuffer);
} }
...@@ -102,8 +101,8 @@ static int compat_i915_cmdbuffer(struct file *file, unsigned int cmd, ...@@ -102,8 +101,8 @@ static int compat_i915_cmdbuffer(struct file *file, unsigned int cmd,
&cmdbuffer->cliprects)) &cmdbuffer->cliprects))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_I915_CMDBUFFER,
DRM_IOCTL_I915_CMDBUFFER, (unsigned long)cmdbuffer); (unsigned long)cmdbuffer);
} }
typedef struct drm_i915_irq_emit32 { typedef struct drm_i915_irq_emit32 {
...@@ -125,8 +124,8 @@ static int compat_i915_irq_emit(struct file *file, unsigned int cmd, ...@@ -125,8 +124,8 @@ static int compat_i915_irq_emit(struct file *file, unsigned int cmd,
&request->irq_seq)) &request->irq_seq))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_I915_IRQ_EMIT,
DRM_IOCTL_I915_IRQ_EMIT, (unsigned long)request); (unsigned long)request);
} }
typedef struct drm_i915_getparam32 { typedef struct drm_i915_getparam32 {
int param; int param;
...@@ -149,8 +148,8 @@ static int compat_i915_getparam(struct file *file, unsigned int cmd, ...@@ -149,8 +148,8 @@ static int compat_i915_getparam(struct file *file, unsigned int cmd,
&request->value)) &request->value))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_I915_GETPARAM,
DRM_IOCTL_I915_GETPARAM, (unsigned long)request); (unsigned long)request);
} }
typedef struct drm_i915_mem_alloc32 { typedef struct drm_i915_mem_alloc32 {
...@@ -178,8 +177,8 @@ static int compat_i915_alloc(struct file *file, unsigned int cmd, ...@@ -178,8 +177,8 @@ static int compat_i915_alloc(struct file *file, unsigned int cmd,
&request->region_offset)) &request->region_offset))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_I915_ALLOC,
DRM_IOCTL_I915_ALLOC, (unsigned long)request); (unsigned long)request);
} }
drm_ioctl_compat_t *i915_compat_ioctls[] = { drm_ioctl_compat_t *i915_compat_ioctls[] = {
...@@ -211,12 +210,10 @@ long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -211,12 +210,10 @@ long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(i915_compat_ioctls)) if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(i915_compat_ioctls))
fn = i915_compat_ioctls[nr - DRM_COMMAND_BASE]; fn = i915_compat_ioctls[nr - DRM_COMMAND_BASE];
lock_kernel(); /* XXX for now */
if (fn != NULL) if (fn != NULL)
ret = (*fn) (filp, cmd, arg); ret = (*fn) (filp, cmd, arg);
else else
ret = drm_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg); ret = drm_ioctl(filp, cmd, arg);
unlock_kernel();
return ret; return ret;
} }
...@@ -68,7 +68,7 @@ static struct drm_driver driver = { ...@@ -68,7 +68,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -100,8 +100,7 @@ static int compat_mga_init(struct file *file, unsigned int cmd, ...@@ -100,8 +100,7 @@ static int compat_mga_init(struct file *file, unsigned int cmd,
if (err) if (err)
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_MGA_INIT, (unsigned long)init);
DRM_IOCTL_MGA_INIT, (unsigned long)init);
} }
typedef struct drm_mga_getparam32 { typedef struct drm_mga_getparam32 {
...@@ -125,8 +124,7 @@ static int compat_mga_getparam(struct file *file, unsigned int cmd, ...@@ -125,8 +124,7 @@ static int compat_mga_getparam(struct file *file, unsigned int cmd,
&getparam->value)) &getparam->value))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_MGA_GETPARAM, (unsigned long)getparam);
DRM_IOCTL_MGA_GETPARAM, (unsigned long)getparam);
} }
typedef struct drm_mga_drm_bootstrap32 { typedef struct drm_mga_drm_bootstrap32 {
...@@ -166,8 +164,7 @@ static int compat_mga_dma_bootstrap(struct file *file, unsigned int cmd, ...@@ -166,8 +164,7 @@ static int compat_mga_dma_bootstrap(struct file *file, unsigned int cmd,
|| __put_user(dma_bootstrap32.agp_size, &dma_bootstrap->agp_size)) || __put_user(dma_bootstrap32.agp_size, &dma_bootstrap->agp_size))
return -EFAULT; return -EFAULT;
err = drm_ioctl(file->f_path.dentry->d_inode, file, err = drm_ioctl(file, DRM_IOCTL_MGA_DMA_BOOTSTRAP,
DRM_IOCTL_MGA_DMA_BOOTSTRAP,
(unsigned long)dma_bootstrap); (unsigned long)dma_bootstrap);
if (err) if (err)
return err; return err;
...@@ -220,12 +217,10 @@ long mga_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -220,12 +217,10 @@ long mga_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(mga_compat_ioctls)) if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(mga_compat_ioctls))
fn = mga_compat_ioctls[nr - DRM_COMMAND_BASE]; fn = mga_compat_ioctls[nr - DRM_COMMAND_BASE];
lock_kernel(); /* XXX for now */
if (fn != NULL) if (fn != NULL)
ret = (*fn) (filp, cmd, arg); ret = (*fn) (filp, cmd, arg);
else else
ret = drm_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg); ret = drm_ioctl(filp, cmd, arg);
unlock_kernel();
return ret; return ret;
} }
...@@ -341,7 +341,7 @@ static struct drm_driver driver = { ...@@ -341,7 +341,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = nouveau_ttm_mmap, .mmap = nouveau_ttm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -61,12 +61,10 @@ long nouveau_compat_ioctl(struct file *filp, unsigned int cmd, ...@@ -61,12 +61,10 @@ long nouveau_compat_ioctl(struct file *filp, unsigned int cmd,
if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(mga_compat_ioctls)) if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(mga_compat_ioctls))
fn = nouveau_compat_ioctls[nr - DRM_COMMAND_BASE]; fn = nouveau_compat_ioctls[nr - DRM_COMMAND_BASE];
#endif #endif
lock_kernel(); /* XXX for now */
if (fn != NULL) if (fn != NULL)
ret = (*fn)(filp, cmd, arg); ret = (*fn)(filp, cmd, arg);
else else
ret = drm_ioctl(filp->f_dentry->d_inode, filp, cmd, arg); ret = drm_ioctl(filp, cmd, arg);
unlock_kernel();
return ret; return ret;
} }
...@@ -64,7 +64,7 @@ static struct drm_driver driver = { ...@@ -64,7 +64,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -95,8 +95,7 @@ static int compat_r128_init(struct file *file, unsigned int cmd, ...@@ -95,8 +95,7 @@ static int compat_r128_init(struct file *file, unsigned int cmd,
&init->agp_textures_offset)) &init->agp_textures_offset))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_R128_INIT, (unsigned long)init);
DRM_IOCTL_R128_INIT, (unsigned long)init);
} }
typedef struct drm_r128_depth32 { typedef struct drm_r128_depth32 {
...@@ -129,8 +128,7 @@ static int compat_r128_depth(struct file *file, unsigned int cmd, ...@@ -129,8 +128,7 @@ static int compat_r128_depth(struct file *file, unsigned int cmd,
&depth->mask)) &depth->mask))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_R128_DEPTH, (unsigned long)depth);
DRM_IOCTL_R128_DEPTH, (unsigned long)depth);
} }
...@@ -153,8 +151,7 @@ static int compat_r128_stipple(struct file *file, unsigned int cmd, ...@@ -153,8 +151,7 @@ static int compat_r128_stipple(struct file *file, unsigned int cmd,
&stipple->mask)) &stipple->mask))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_R128_STIPPLE, (unsigned long)stipple);
DRM_IOCTL_R128_STIPPLE, (unsigned long)stipple);
} }
typedef struct drm_r128_getparam32 { typedef struct drm_r128_getparam32 {
...@@ -178,8 +175,7 @@ static int compat_r128_getparam(struct file *file, unsigned int cmd, ...@@ -178,8 +175,7 @@ static int compat_r128_getparam(struct file *file, unsigned int cmd,
&getparam->value)) &getparam->value))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_R128_GETPARAM, (unsigned long)getparam);
DRM_IOCTL_R128_GETPARAM, (unsigned long)getparam);
} }
drm_ioctl_compat_t *r128_compat_ioctls[] = { drm_ioctl_compat_t *r128_compat_ioctls[] = {
...@@ -210,12 +206,10 @@ long r128_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -210,12 +206,10 @@ long r128_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(r128_compat_ioctls)) if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(r128_compat_ioctls))
fn = r128_compat_ioctls[nr - DRM_COMMAND_BASE]; fn = r128_compat_ioctls[nr - DRM_COMMAND_BASE];
lock_kernel(); /* XXX for now */
if (fn != NULL) if (fn != NULL)
ret = (*fn) (filp, cmd, arg); ret = (*fn) (filp, cmd, arg);
else else
ret = drm_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg); ret = drm_ioctl(filp, cmd, arg);
unlock_kernel();
return ret; return ret;
} }
...@@ -196,7 +196,7 @@ static struct drm_driver driver_old = { ...@@ -196,7 +196,7 @@ static struct drm_driver driver_old = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
...@@ -284,7 +284,7 @@ static struct drm_driver kms_driver = { ...@@ -284,7 +284,7 @@ static struct drm_driver kms_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = radeon_mmap, .mmap = radeon_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -92,8 +92,7 @@ static int compat_radeon_cp_init(struct file *file, unsigned int cmd, ...@@ -92,8 +92,7 @@ static int compat_radeon_cp_init(struct file *file, unsigned int cmd,
&init->gart_textures_offset)) &init->gart_textures_offset))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_CP_INIT, (unsigned long)init);
DRM_IOCTL_RADEON_CP_INIT, (unsigned long)init);
} }
typedef struct drm_radeon_clear32 { typedef struct drm_radeon_clear32 {
...@@ -125,8 +124,7 @@ static int compat_radeon_cp_clear(struct file *file, unsigned int cmd, ...@@ -125,8 +124,7 @@ static int compat_radeon_cp_clear(struct file *file, unsigned int cmd,
&clr->depth_boxes)) &clr->depth_boxes))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_CLEAR, (unsigned long)clr);
DRM_IOCTL_RADEON_CLEAR, (unsigned long)clr);
} }
typedef struct drm_radeon_stipple32 { typedef struct drm_radeon_stipple32 {
...@@ -149,8 +147,7 @@ static int compat_radeon_cp_stipple(struct file *file, unsigned int cmd, ...@@ -149,8 +147,7 @@ static int compat_radeon_cp_stipple(struct file *file, unsigned int cmd,
&request->mask)) &request->mask))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_STIPPLE, (unsigned long)request);
DRM_IOCTL_RADEON_STIPPLE, (unsigned long)request);
} }
typedef struct drm_radeon_tex_image32 { typedef struct drm_radeon_tex_image32 {
...@@ -204,8 +201,7 @@ static int compat_radeon_cp_texture(struct file *file, unsigned int cmd, ...@@ -204,8 +201,7 @@ static int compat_radeon_cp_texture(struct file *file, unsigned int cmd,
&image->data)) &image->data))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_TEXTURE, (unsigned long)request);
DRM_IOCTL_RADEON_TEXTURE, (unsigned long)request);
} }
typedef struct drm_radeon_vertex2_32 { typedef struct drm_radeon_vertex2_32 {
...@@ -238,8 +234,7 @@ static int compat_radeon_cp_vertex2(struct file *file, unsigned int cmd, ...@@ -238,8 +234,7 @@ static int compat_radeon_cp_vertex2(struct file *file, unsigned int cmd,
&request->prim)) &request->prim))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_VERTEX2, (unsigned long)request);
DRM_IOCTL_RADEON_VERTEX2, (unsigned long)request);
} }
typedef struct drm_radeon_cmd_buffer32 { typedef struct drm_radeon_cmd_buffer32 {
...@@ -268,8 +263,7 @@ static int compat_radeon_cp_cmdbuf(struct file *file, unsigned int cmd, ...@@ -268,8 +263,7 @@ static int compat_radeon_cp_cmdbuf(struct file *file, unsigned int cmd,
&request->boxes)) &request->boxes))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_CMDBUF, (unsigned long)request);
DRM_IOCTL_RADEON_CMDBUF, (unsigned long)request);
} }
typedef struct drm_radeon_getparam32 { typedef struct drm_radeon_getparam32 {
...@@ -293,8 +287,7 @@ static int compat_radeon_cp_getparam(struct file *file, unsigned int cmd, ...@@ -293,8 +287,7 @@ static int compat_radeon_cp_getparam(struct file *file, unsigned int cmd,
&request->value)) &request->value))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_GETPARAM, (unsigned long)request);
DRM_IOCTL_RADEON_GETPARAM, (unsigned long)request);
} }
typedef struct drm_radeon_mem_alloc32 { typedef struct drm_radeon_mem_alloc32 {
...@@ -322,8 +315,7 @@ static int compat_radeon_mem_alloc(struct file *file, unsigned int cmd, ...@@ -322,8 +315,7 @@ static int compat_radeon_mem_alloc(struct file *file, unsigned int cmd,
&request->region_offset)) &request->region_offset))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_ALLOC, (unsigned long)request);
DRM_IOCTL_RADEON_ALLOC, (unsigned long)request);
} }
typedef struct drm_radeon_irq_emit32 { typedef struct drm_radeon_irq_emit32 {
...@@ -345,8 +337,7 @@ static int compat_radeon_irq_emit(struct file *file, unsigned int cmd, ...@@ -345,8 +337,7 @@ static int compat_radeon_irq_emit(struct file *file, unsigned int cmd,
&request->irq_seq)) &request->irq_seq))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_path.dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_IRQ_EMIT, (unsigned long)request);
DRM_IOCTL_RADEON_IRQ_EMIT, (unsigned long)request);
} }
/* The two 64-bit arches where alignof(u64)==4 in 32-bit code */ /* The two 64-bit arches where alignof(u64)==4 in 32-bit code */
...@@ -372,8 +363,7 @@ static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd, ...@@ -372,8 +363,7 @@ static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd,
&request->value)) &request->value))
return -EFAULT; return -EFAULT;
return drm_ioctl(file->f_dentry->d_inode, file, return drm_ioctl(file, DRM_IOCTL_RADEON_SETPARAM, (unsigned long) request);
DRM_IOCTL_RADEON_SETPARAM, (unsigned long) request);
} }
#else #else
#define compat_radeon_cp_setparam NULL #define compat_radeon_cp_setparam NULL
...@@ -413,12 +403,10 @@ long radeon_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -413,12 +403,10 @@ long radeon_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(radeon_compat_ioctls)) if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(radeon_compat_ioctls))
fn = radeon_compat_ioctls[nr - DRM_COMMAND_BASE]; fn = radeon_compat_ioctls[nr - DRM_COMMAND_BASE];
lock_kernel(); /* XXX for now */
if (fn != NULL) if (fn != NULL)
ret = (*fn) (filp, cmd, arg); ret = (*fn) (filp, cmd, arg);
else else
ret = drm_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg); ret = drm_ioctl(filp, cmd, arg);
unlock_kernel();
return ret; return ret;
} }
...@@ -431,9 +419,7 @@ long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long ...@@ -431,9 +419,7 @@ long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long
if (nr < DRM_COMMAND_BASE) if (nr < DRM_COMMAND_BASE)
return drm_compat_ioctl(filp, cmd, arg); return drm_compat_ioctl(filp, cmd, arg);
lock_kernel(); /* XXX for now */ ret = drm_ioctl(filp, cmd, arg);
ret = drm_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg);
unlock_kernel();
return ret; return ret;
} }
...@@ -50,7 +50,7 @@ static struct drm_driver driver = { ...@@ -50,7 +50,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -80,7 +80,7 @@ static struct drm_driver driver = { ...@@ -80,7 +80,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -48,7 +48,7 @@ static struct drm_driver driver = { ...@@ -48,7 +48,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -58,7 +58,7 @@ static struct drm_driver driver = { ...@@ -58,7 +58,7 @@ static struct drm_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_mmap,
.poll = drm_poll, .poll = drm_poll,
.fasync = drm_fasync, .fasync = drm_fasync,
......
...@@ -296,6 +296,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, ...@@ -296,6 +296,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
#define DRM_MASTER 0x2 #define DRM_MASTER 0x2
#define DRM_ROOT_ONLY 0x4 #define DRM_ROOT_ONLY 0x4
#define DRM_CONTROL_ALLOW 0x8 #define DRM_CONTROL_ALLOW 0x8
#define DRM_UNLOCKED 0x10
struct drm_ioctl_desc { struct drm_ioctl_desc {
unsigned int cmd; unsigned int cmd;
...@@ -1128,7 +1129,7 @@ static inline int drm_mtrr_del(int handle, unsigned long offset, ...@@ -1128,7 +1129,7 @@ static inline int drm_mtrr_del(int handle, unsigned long offset,
/* Driver support (drm_drv.h) */ /* Driver support (drm_drv.h) */
extern int drm_init(struct drm_driver *driver); extern int drm_init(struct drm_driver *driver);
extern void drm_exit(struct drm_driver *driver); extern void drm_exit(struct drm_driver *driver);
extern int drm_ioctl(struct inode *inode, struct file *filp, extern long drm_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
extern long drm_compat_ioctl(struct file *filp, extern long drm_compat_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment