diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-25 16:48:48 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-25 16:48:48 -0800 |
commit | 42aacfba6c2d1ee773615cfcfce0fe973d1d0f37 (patch) | |
tree | 1f3b06d516dac26c976cedfc59cd48781b96f86d /drivers | |
parent | b3eb67a2ab4e14fc6cc035907400b86462d174db (diff) | |
parent | cf65f1623dd005ddfb1cbba20af3423a6c638dbe (diff) |
Merge branch 'drm-linus' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/drm/drm_lock.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/char/drm/drm_lock.c b/drivers/char/drm/drm_lock.c index b276ae8a6633..b48a595d54ec 100644 --- a/drivers/char/drm/drm_lock.c +++ b/drivers/char/drm/drm_lock.c @@ -104,6 +104,10 @@ int drm_lock(struct inode *inode, struct file *filp, __set_current_state(TASK_RUNNING); remove_wait_queue(&dev->lock.lock_queue, &entry); + DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock"); + if (ret) + return ret; + sigemptyset(&dev->sigmask); sigaddset(&dev->sigmask, SIGSTOP); sigaddset(&dev->sigmask, SIGTSTP); @@ -116,8 +120,12 @@ int drm_lock(struct inode *inode, struct file *filp, if (dev->driver->dma_ready && (lock.flags & _DRM_LOCK_READY)) dev->driver->dma_ready(dev); - if (dev->driver->dma_quiescent && (lock.flags & _DRM_LOCK_QUIESCENT)) - return dev->driver->dma_quiescent(dev); + if (dev->driver->dma_quiescent && (lock.flags & _DRM_LOCK_QUIESCENT)) { + if (dev->driver->dma_quiescent(dev)) { + DRM_DEBUG("%d waiting for DMA quiescent\n", lock.context); + return DRM_ERR(EBUSY); + } + } /* dev->driver->kernel_context_switch isn't used by any of the x86 * drivers but is used by the Sparc driver. @@ -128,9 +136,7 @@ int drm_lock(struct inode *inode, struct file *filp, dev->driver->kernel_context_switch(dev, dev->last_context, lock.context); } - DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock"); - - return ret; + return 0; } /** |