summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-26 14:40:11 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-26 14:40:11 +0200
commit26528627a6cea7f92a949e89e5db6e17ef9560c2 (patch)
treed69b4a1263b3b726f1c063b6ca5c8fe195a2018b
parent711f077b7423c1a436d703885c6d18a2ad2940aa (diff)
Remove the call to drm_lock_transfer, since it is not used anymore.
Fix up drm_lock_free to retain the last locking context information.
-rw-r--r--linux-core/drm_lock.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/linux-core/drm_lock.c b/linux-core/drm_lock.c
index 8619defb..97417636 100644
--- a/linux-core/drm_lock.c
+++ b/linux-core/drm_lock.c
@@ -170,11 +170,8 @@ int drm_unlock(struct inode *inode, struct file *filp,
if (dev->driver->kernel_context_switch_unlock)
dev->driver->kernel_context_switch_unlock(dev);
else {
- drm_lock_transfer(dev, &dev->lock.hw_lock->lock,
- DRM_KERNEL_CONTEXT);
-
if (drm_lock_free(dev, &dev->lock.hw_lock->lock,
- DRM_KERNEL_CONTEXT)) {
+ lock.context)) {
DRM_ERROR("\n");
}
}
@@ -263,12 +260,12 @@ int drm_lock_free(drm_device_t * dev,
{
unsigned int old, new, prev;
- dev->lock.filp = NULL;
do {
old = *lock;
- new = 0;
+ new = _DRM_LOCKING_CONTEXT(old);
prev = cmpxchg(lock, old, new);
} while (prev != old);
+
if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) {
DRM_DEBUG("%d freed heavyweight lock held by %d\n",
context, _DRM_LOCKING_CONTEXT(old));