drm: convert drm_ioctl to unlocked_ioctl
authorArnd Bergmann <arnd@arndb.de>
Wed, 16 Dec 2009 22:17:09 +0000 (22:17 +0000)
committerDave Airlie <airlied@redhat.com>
Fri, 18 Dec 2009 01:22:31 +0000 (11:22 +1000)
commited8b67040965e4fe695db333d5914e18ea5f146f
tree6fd9f50130f7ccaccf8070f7821ea8eb6743854c
parentdcd6dfcfe959bade75fbf49499775985d2cac5d5
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>
21 files changed:
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/drm_ioc32.c
drivers/gpu/drm/i810/i810_dma.c
drivers/gpu/drm/i810/i810_drv.c
drivers/gpu/drm/i830/i830_dma.c
drivers/gpu/drm/i830/i830_drv.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_ioc32.c
drivers/gpu/drm/mga/mga_drv.c
drivers/gpu/drm/mga/mga_ioc32.c
drivers/gpu/drm/nouveau/nouveau_drv.c
drivers/gpu/drm/nouveau/nouveau_ioc32.c
drivers/gpu/drm/r128/r128_drv.c
drivers/gpu/drm/r128/r128_ioc32.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/radeon_ioc32.c
drivers/gpu/drm/savage/savage_drv.c
drivers/gpu/drm/sis/sis_drv.c
drivers/gpu/drm/tdfx/tdfx_drv.c
drivers/gpu/drm/via/via_drv.c
include/drm/drmP.h