From: Dave Airlie <airl...@redhat.com>

For some reason these ioctls have no DRM flags, which just seems wrong,
so I guess that needs reviewing also before staging exit.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |   69 ++++++++---------------------------
 1 files changed, 16 insertions(+), 53 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 7b48bb3..8da66d8 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -103,37 +103,37 @@
  */
 
 static struct drm_ioctl_desc vmw_ioctls[] = {
-       VMW_IOCTL_DEF(DRM_IOCTL_VMW_GET_PARAM, vmw_getparam_ioctl, 0),
+       VMW_IOCTL_DEF(DRM_IOCTL_VMW_GET_PARAM, vmw_getparam_ioctl, 
DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_ALLOC_DMABUF, vmw_dmabuf_alloc_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_UNREF_DMABUF, vmw_dmabuf_unref_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_CURSOR_BYPASS,
-                     vmw_kms_cursor_bypass_ioctl, 0),
+                     vmw_kms_cursor_bypass_ioctl, DRM_AUTH|DRM_UNLOCKED),
 
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_CONTROL_STREAM, vmw_overlay_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_CLAIM_STREAM, vmw_stream_claim_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_UNREF_STREAM, vmw_stream_unref_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
 
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_CREATE_CONTEXT, vmw_context_define_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_UNREF_CONTEXT, vmw_context_destroy_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_CREATE_SURFACE, vmw_surface_define_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_UNREF_SURFACE, vmw_surface_destroy_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_REF_SURFACE, vmw_surface_reference_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_EXECBUF, vmw_execbuf_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_FIFO_DEBUG, vmw_fifo_debug_ioctl,
-                     0),
+                     DRM_AUTH|DRM_UNLOCKED),
        VMW_IOCTL_DEF(DRM_IOCTL_VMW_FENCE_WAIT, vmw_fence_wait_ioctl,
-                     0)
+                     DRM_AUTH|DRM_UNLOCKED)
 };
 
 static struct pci_device_id vmw_pci_id_list[] = {
@@ -454,43 +454,6 @@ out_no_tfile:
        return ret;
 }
 
-static long vmw_unlocked_ioctl(struct file *filp, unsigned int cmd,
-                              unsigned long arg)
-{
-       struct drm_file *file_priv = filp->private_data;
-       struct drm_device *dev = file_priv->minor->dev;
-       unsigned int nr = DRM_IOCTL_NR(cmd);
-       long ret;
-
-       /*
-        * The driver private ioctls and TTM ioctls should be
-        * thread-safe.
-        */
-
-       if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END)
-           && (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) {
-               struct drm_ioctl_desc *ioctl =
-                   &vmw_ioctls[nr - DRM_COMMAND_BASE];
-
-               if (unlikely(ioctl->cmd != cmd)) {
-                       DRM_ERROR("Invalid command format, ioctl %d\n",
-                                 nr - DRM_COMMAND_BASE);
-                       return -EINVAL;
-               }
-               return drm_ioctl(filp->f_path.dentry->d_inode,
-                                filp, cmd, arg);
-       }
-
-       /*
-        * Not all old drm ioctls are thread-safe.
-        */
-
-       lock_kernel();
-       ret = drm_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg);
-       unlock_kernel();
-       return ret;
-}
-
 static int vmw_firstopen(struct drm_device *dev)
 {
        struct vmw_private *dev_priv = vmw_priv(dev);
@@ -686,7 +649,7 @@ static struct drm_driver driver = {
                 .owner = THIS_MODULE,
                 .open = drm_open,
                 .release = drm_release,
-                .unlocked_ioctl = vmw_unlocked_ioctl,
+                .unlocked_ioctl = drm_ioctl,
                 .mmap = vmw_mmap,
                 .poll = drm_poll,
                 .fasync = drm_fasync,
-- 
1.6.5.2


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to