drm: allow for more generic drm ioctls
Signed-off-by: Dave Airlie <airlied@linux.ie>
This commit is contained in:
parent
6244270ef6
commit
99da6d861c
2 changed files with 9 additions and 4 deletions
|
@ -654,11 +654,13 @@ typedef struct drm_set_version {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Device specific ioctls should only be in their respective headers
|
* 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
|
* \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and
|
||||||
* drmCommandReadWrite().
|
* drmCommandReadWrite().
|
||||||
*/
|
*/
|
||||||
#define DRM_COMMAND_BASE 0x40
|
#define DRM_COMMAND_BASE 0x40
|
||||||
|
#define DRM_COMMAND_END 0xA0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -496,11 +496,14 @@ int drm_ioctl(struct inode *inode, struct file *filp,
|
||||||
(long)old_encode_dev(priv->head->device),
|
(long)old_encode_dev(priv->head->device),
|
||||||
priv->authenticated);
|
priv->authenticated);
|
||||||
|
|
||||||
if (nr < DRIVER_IOCTL_COUNT)
|
if ((nr >= DRIVER_IOCTL_COUNT) &&
|
||||||
ioctl = &drm_ioctls[nr];
|
((nr < DRM_COMMAND_BASE) || (nr >= DRM_COMMAND_END)))
|
||||||
else if ((nr >= DRM_COMMAND_BASE)
|
goto err_i1;
|
||||||
|
if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END)
|
||||||
&& (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls))
|
&& (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls))
|
||||||
ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE];
|
ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE];
|
||||||
|
else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE))
|
||||||
|
ioctl = &drm_ioctls[nr];
|
||||||
else
|
else
|
||||||
goto err_i1;
|
goto err_i1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue