Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=99da6d861c659bb1a961b70f50fad268b9ed5a5f
Commit:     99da6d861c659bb1a961b70f50fad268b9ed5a5f
Parent:     6244270ef62203e057191bf85489e2ff91cc0e60
Author:     Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
AuthorDate: Mon Mar 19 08:52:17 2007 +1100
Committer:  Dave Airlie <[EMAIL PROTECTED]>
CommitDate: Mon Mar 19 08:52:17 2007 +1100

    drm: allow for more generic drm ioctls
    
    Signed-off-by: Dave Airlie <[EMAIL PROTECTED]>
---
 drivers/char/drm/drm.h     |    4 +++-
 drivers/char/drm/drm_drv.c |    9 ++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h
index 8db9041..0891984 100644
--- a/drivers/char/drm/drm.h
+++ b/drivers/char/drm/drm.h
@@ -654,11 +654,13 @@ typedef struct drm_set_version {
 
 /**
  * Device specific ioctls should only be in their respective headers
- * The device specific ioctl range is from 0x40 to 0x79.
+ * The device specific ioctl range is from 0x40 to 0x99.
+ * Generic IOCTLS restart at 0xA0.
  *
  * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and
  * drmCommandReadWrite().
  */
 #define DRM_COMMAND_BASE                0x40
+#define DRM_COMMAND_END                        0xA0
 
 #endif
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c
index f5b9b24..26bec30 100644
--- a/drivers/char/drm/drm_drv.c
+++ b/drivers/char/drm/drm_drv.c
@@ -496,11 +496,14 @@ int drm_ioctl(struct inode *inode, struct file *filp,
                  (long)old_encode_dev(priv->head->device),
                  priv->authenticated);
 
-       if (nr < DRIVER_IOCTL_COUNT)
-               ioctl = &drm_ioctls[nr];
-       else if ((nr >= DRM_COMMAND_BASE)
+       if ((nr >= DRIVER_IOCTL_COUNT) &&
+           ((nr < DRM_COMMAND_BASE) || (nr >= DRM_COMMAND_END)))
+               goto err_i1;
+       if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END)
                 && (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls))
                ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE];
+       else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE))
+               ioctl = &drm_ioctls[nr];
        else
                goto err_i1;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to