Don't return EINVAL when trying to unlock.

anholt thinks that he added this check as part of some regression testing,
but it is failing at least some of the time.  I don't want to remove it
just yet.  I added a bit of debugging to help identify the issue.

Approved by:	kib
This commit is contained in:
Robert Noland 2008-08-30 01:00:18 +00:00
parent ac165058b7
commit 6f81ba0e97

View File

@ -171,18 +171,23 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
drm_lock_t *lock = data;
DRM_DEBUG("%d (pid %d) requests unlock (0x%08x), flags = 0x%08x\n",
lock->context, DRM_CURRENTPID, dev->lock.hw_lock->lock,
lock->flags);
if (lock->context == DRM_KERNEL_CONTEXT) {
DRM_ERROR("Process %d using kernel context %d\n",
DRM_CURRENTPID, lock->context);
return EINVAL;
}
#if 0
/* Check that the context unlock being requested actually matches
* who currently holds the lock.
*/
if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) ||
_DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock) != lock->context)
return EINVAL;
#endif
DRM_SPINLOCK(&dev->tsk_lock);
if (dev->locked_task_call != NULL) {
dev->locked_task_call(dev);