[yocto] [PATCH 13/17][KERNEL] drm-psb: add DRM_UNLOCKED flag
tom.zanussi at intel.com
tom.zanussi at intel.com
Tue Mar 13 20:57:39 PDT 2012
From: Tom Zanussi <tom.zanussi at intel.com>
Add DRM_UNLOCKED to allow us to call handlers that do their own
locking without the global lock.
Signed-off-by: Tom Zanussi <tom.zanussi at intel.com>
---
drivers/gpu/drm-psb/drmP.h | 1 +
drivers/gpu/drm-psb/drm_drv.c | 10 +++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm-psb/drmP.h b/drivers/gpu/drm-psb/drmP.h
index 3cca5fe..9d5bb5c 100644
--- a/drivers/gpu/drm-psb/drmP.h
+++ b/drivers/gpu/drm-psb/drmP.h
@@ -309,6 +309,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
#define DRM_AUTH 0x1
#define DRM_MASTER 0x2
#define DRM_ROOT_ONLY 0x4
+#define DRM_UNLOCKED 0x8
struct drm_ioctl_desc {
unsigned int cmd;
diff --git a/drivers/gpu/drm-psb/drm_drv.c b/drivers/gpu/drm-psb/drm_drv.c
index 472859b..396dcda 100644
--- a/drivers/gpu/drm-psb/drm_drv.c
+++ b/drivers/gpu/drm-psb/drm_drv.c
@@ -663,9 +663,13 @@ long drm_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
((ioctl->flags & DRM_MASTER) && !file_priv->master)) {
retcode = -EACCES;
} else {
- mutex_lock(&drm_global_mutex);
- retcode = func(dev, kdata, file_priv);
- mutex_unlock(&drm_global_mutex);
+ if (ioctl->flags & DRM_UNLOCKED)
+ retcode = func(dev, kdata, file_priv);
+ else {
+ mutex_lock(&drm_global_mutex);
+ retcode = func(dev, kdata, file_priv);
+ mutex_unlock(&drm_global_mutex);
+ }
}
if ((retcode == 0) && (cmd & IOC_OUT)) {
--
1.7.0.4
More information about the yocto
mailing list