Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: Add a function to get the ioctl flags

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

+19
+18
drivers/gpu/drm/drm_drv.c
··· 450 450 return retcode; 451 451 } 452 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);
+1
include/drm/drmP.h
··· 1229 1229 extern long drm_compat_ioctl(struct file *filp, 1230 1230 unsigned int cmd, unsigned long arg); 1231 1231 extern int drm_lastclose(struct drm_device *dev); 1232 + extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags); 1232 1233 1233 1234 /* Device support (drm_fops.h) */ 1234 1235 extern struct mutex drm_global_mutex;