aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drmP.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-07-10 17:51:39 -0400
committerDave Airlie <airlied@redhat.com>2010-08-04 21:54:40 -0400
commit58374713c9dfb4d231f8c56cac089f6fbdedc2ec (patch)
tree9ba01c3990b5a8625437d13722595f5063f2d915 /include/drm/drmP.h
parenta1e09b62592eb57e25f8d076ffa5b7bef18be812 (diff)
drm: kill BKL from common code
This restricts the use of the big kernel lock to the i830 and i810 device drivers. The three remaining users in common code (open, ioctl and release) get converted to a new mutex, the drm_global_mutex, making the locking stricter than the big kernel lock. This may have a performance impact, but only in those cases that currently don't use DRM_UNLOCKED flag in the ioctl list and would benefit from that anyway. The reason why i810 and i830 cannot use drm_global_mutex in their mmap functions is a lock-order inversion problem between the current use of the BKL and mmap_sem in these drivers. Since the BKL has release-on-sleep semantics, it's harmless but it would cause trouble if we replace the BKL with a mutex. Instead, these drivers get their own ioctl wrappers that take the BKL around every ioctl call and then set their own handlers as DRM_UNLOCKED. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r--include/drm/drmP.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 53017ba0ab7b..e2a4da7d7fab 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -52,7 +52,6 @@
52#include <linux/platform_device.h> 52#include <linux/platform_device.h>
53#include <linux/pci.h> 53#include <linux/pci.h>
54#include <linux/jiffies.h> 54#include <linux/jiffies.h>
55#include <linux/smp_lock.h> /* For (un)lock_kernel */
56#include <linux/dma-mapping.h> 55#include <linux/dma-mapping.h>
57#include <linux/mm.h> 56#include <linux/mm.h>
58#include <linux/cdev.h> 57#include <linux/cdev.h>
@@ -1152,6 +1151,7 @@ extern long drm_compat_ioctl(struct file *filp,
1152extern int drm_lastclose(struct drm_device *dev); 1151extern int drm_lastclose(struct drm_device *dev);
1153 1152
1154 /* Device support (drm_fops.h) */ 1153 /* Device support (drm_fops.h) */
1154extern struct mutex drm_global_mutex;
1155extern int drm_open(struct inode *inode, struct file *filp); 1155extern int drm_open(struct inode *inode, struct file *filp);
1156extern int drm_stub_open(struct inode *inode, struct file *filp); 1156extern int drm_stub_open(struct inode *inode, struct file *filp);
1157extern int drm_fasync(int fd, struct file *filp, int on); 1157extern int drm_fasync(int fd, struct file *filp, int on);