diff options
author | =?utf-8?q?Michel_D=C3=A4nzer?= <michel@tungstengraphics.com> | 2006-10-24 23:08:16 +1000 |
---|---|---|
committer | airlied <airlied@linux.ie> | 2006-12-07 15:53:28 +1100 |
commit | 2e54a007622ac75d63bdc1dd71d435446293f4a9 (patch) | |
tree | 864427aba8fbf2bb8c342d739b2acdec45e43f19 /drivers/char/drm/drm_lock.c | |
parent | bea5679f9cb97b7e41786c8500df56665cd21e56 (diff) | |
download | talos-op-linux-2e54a007622ac75d63bdc1dd71d435446293f4a9.tar.gz talos-op-linux-2e54a007622ac75d63bdc1dd71d435446293f4a9.zip |
drm: Add support for interrupt triggered driver callback with lock held to DRM core.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_lock.c')
-rw-r--r-- | drivers/char/drm/drm_lock.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/char/drm/drm_lock.c b/drivers/char/drm/drm_lock.c index f9e45303498d..e0abe5c68423 100644 --- a/drivers/char/drm/drm_lock.c +++ b/drivers/char/drm/drm_lock.c @@ -155,6 +155,7 @@ int drm_unlock(struct inode *inode, struct file *filp, drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->head->dev; drm_lock_t lock; + unsigned int irqflags; if (copy_from_user(&lock, (drm_lock_t __user *) arg, sizeof(lock))) return -EFAULT; @@ -165,6 +166,16 @@ int drm_unlock(struct inode *inode, struct file *filp, return -EINVAL; } + spin_lock_irqsave(&dev->tasklet_lock, irqflags); + + if (dev->locked_tasklet_func) { + dev->locked_tasklet_func(dev); + + dev->locked_tasklet_func = NULL; + } + + spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); + atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]); /* kernel_context_switch isn't used by any of the x86 drm |