diff options
author | Arnd Bergmann <arnd@arndb.de> | 2009-12-16 17:17:09 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-17 20:22:31 -0500 |
commit | ed8b67040965e4fe695db333d5914e18ea5f146f (patch) | |
tree | 6fd9f50130f7ccaccf8070f7821ea8eb6743854c /include/drm | |
parent | dcd6dfcfe959bade75fbf49499775985d2cac5d5 (diff) |
drm: convert drm_ioctl to unlocked_ioctl
drm_ioctl is called with the Big Kernel Lock held,
which shows up very high in statistics on vfs_ioctl.
Moving the lock into the drm_ioctl function itself
makes sure we blame the right subsystem and it gets
us one step closer to eliminating the locked version
of fops->ioctl.
Since drm_ioctl does not require the lock itself,
we only need to hold it while calling the specific
handler. The 32 bit conversion handlers do not
interact with any other code, so they don't need
the BKL here either and can just call drm_ioctl.
As a bonus, this cleans up all the other users
of drm_ioctl which now no longer have to find
the inode or call lock_kernel.
[airlied: squashed the non-driver bits
of the second patch in here, this provides
the flag for drivers to use to select unlocked
ioctls - but doesn't modify any drivers].
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.sourceforge.net
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drmP.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 19ef8ebdc662..71dafb69cfeb 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -296,6 +296,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, | |||
296 | #define DRM_MASTER 0x2 | 296 | #define DRM_MASTER 0x2 |
297 | #define DRM_ROOT_ONLY 0x4 | 297 | #define DRM_ROOT_ONLY 0x4 |
298 | #define DRM_CONTROL_ALLOW 0x8 | 298 | #define DRM_CONTROL_ALLOW 0x8 |
299 | #define DRM_UNLOCKED 0x10 | ||
299 | 300 | ||
300 | struct drm_ioctl_desc { | 301 | struct drm_ioctl_desc { |
301 | unsigned int cmd; | 302 | unsigned int cmd; |
@@ -1128,8 +1129,8 @@ static inline int drm_mtrr_del(int handle, unsigned long offset, | |||
1128 | /* Driver support (drm_drv.h) */ | 1129 | /* Driver support (drm_drv.h) */ |
1129 | extern int drm_init(struct drm_driver *driver); | 1130 | extern int drm_init(struct drm_driver *driver); |
1130 | extern void drm_exit(struct drm_driver *driver); | 1131 | extern void drm_exit(struct drm_driver *driver); |
1131 | extern int drm_ioctl(struct inode *inode, struct file *filp, | 1132 | extern long drm_ioctl(struct file *filp, |
1132 | unsigned int cmd, unsigned long arg); | 1133 | unsigned int cmd, unsigned long arg); |
1133 | extern long drm_compat_ioctl(struct file *filp, | 1134 | extern long drm_compat_ioctl(struct file *filp, |
1134 | unsigned int cmd, unsigned long arg); | 1135 | unsigned int cmd, unsigned long arg); |
1135 | extern int drm_lastclose(struct drm_device *dev); | 1136 | extern int drm_lastclose(struct drm_device *dev); |