diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2014-02-26 09:51:57 -0500 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2014-03-28 09:19:02 -0400 |
commit | 4beb6d9fa6a74c189884be4913cfdd24fc8758ac (patch) | |
tree | 8398718ddaaa97ac5d247088b9cffe741434e672 /drivers | |
parent | c996fd0b956450563454e7ccc97a82ca31f9d043 (diff) |
drm: Add a function to get the ioctl flags
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index cf2dfb790bf1..03711d00aaae 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -450,3 +450,21 @@ long drm_ioctl(struct file *filp, | |||
450 | return retcode; | 450 | return retcode; |
451 | } | 451 | } |
452 | EXPORT_SYMBOL(drm_ioctl); | 452 | EXPORT_SYMBOL(drm_ioctl); |
453 | |||
454 | /** | ||
455 | * drm_ioctl_flags - Check for core ioctl and return ioctl permission flags | ||
456 | * | ||
457 | * @nr: Ioctl number. | ||
458 | * @flags: Where to return the ioctl permission flags | ||
459 | */ | ||
460 | bool drm_ioctl_flags(unsigned int nr, unsigned int *flags) | ||
461 | { | ||
462 | if ((nr >= DRM_COMMAND_END && nr < DRM_CORE_IOCTL_COUNT) || | ||
463 | (nr < DRM_COMMAND_BASE)) { | ||
464 | *flags = drm_ioctls[nr].flags; | ||
465 | return true; | ||
466 | } | ||
467 | |||
468 | return false; | ||
469 | } | ||
470 | EXPORT_SYMBOL(drm_ioctl_flags); | ||