summaryrefslogtreecommitdiff
path: root/linux-core/drm_fops.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-07-24 10:51:27 +1000
committerDave Airlie <airlied@linux.ie>2006-07-24 10:51:27 +1000
commit5cfbd5dbab4fe9668771377cb22da04c6103459e (patch)
tree375d460ab42628fbe57bb669d6e0710bf2fc3078 /linux-core/drm_fops.c
parent6677e2a10b820a5ccfd375cc627b8e41453a71da (diff)
switch drm to use Linux mutexes instead of semaphore.
I hope the fallback compat code works if not shout at me.
Diffstat (limited to 'linux-core/drm_fops.c')
-rw-r--r--linux-core/drm_fops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index 632108db..a58f3ae8 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -260,7 +260,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
goto out_free;
}
- down(&dev->struct_sem);
+ mutex_lock(&dev->struct_mutex);
if (!dev->file_last) {
priv->next = NULL;
priv->prev = NULL;
@@ -274,7 +274,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
dev->file_last->next = priv;
dev->file_last = priv;
}
- up(&dev->struct_sem);
+ mutex_unlock(&dev->struct_mutex);
#ifdef __alpha__
/*
@@ -411,7 +411,7 @@ int drm_release(struct inode *inode, struct file *filp)
drm_fasync(-1, filp, 0);
- down(&dev->ctxlist_sem);
+ mutex_lock(&dev->ctxlist_mutex);
if (dev->ctxlist && (!list_empty(&dev->ctxlist->head))) {
drm_ctx_list_t *pos, *n;
@@ -430,9 +430,9 @@ int drm_release(struct inode *inode, struct file *filp)
}
}
}
- up(&dev->ctxlist_sem);
+ mutex_unlock(&dev->ctxlist_mutex);
- down(&dev->struct_sem);
+ mutex_lock(&dev->struct_mutex);
if (priv->remove_auth_on_close == 1) {
drm_file_t *temp = dev->file_first;
while (temp) {
@@ -450,7 +450,7 @@ int drm_release(struct inode *inode, struct file *filp)
} else {
dev->file_last = priv->prev;
}
- up(&dev->struct_sem);
+ mutex_unlock(&dev->struct_mutex);
if (dev->driver->postclose)
dev->driver->postclose(dev, priv);