summaryrefslogtreecommitdiff
path: root/linux-core/drm_lock.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-02-18 02:53:36 +0000
committerDave Airlie <airlied@linux.ie>2006-02-18 02:53:36 +0000
commit4791dc885619b1a6460c1fcf48f648945feea4d3 (patch)
treec8836b6b99a1bc7f2c455d2ad4089939f5098118 /linux-core/drm_lock.c
parent585f34c3e533cafd687beba161d6d0379b52bb47 (diff)
major realigment of DRM CVS with kernel code, makes integration much easier
Diffstat (limited to 'linux-core/drm_lock.c')
-rw-r--r--linux-core/drm_lock.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/linux-core/drm_lock.c b/linux-core/drm_lock.c
index b8431698..b909a6fb 100644
--- a/linux-core/drm_lock.c
+++ b/linux-core/drm_lock.c
@@ -36,7 +36,8 @@
#include "drmP.h"
static int drm_lock_transfer(drm_device_t * dev,
- __volatile__ unsigned int *lock, unsigned int context);
+ __volatile__ unsigned int *lock,
+ unsigned int context);
static int drm_notifier(void *priv);
/**
@@ -125,8 +126,8 @@ int drm_lock(struct inode *inode, struct file *filp,
}
}
- if (dev->driver->kernel_context_switch
- && dev->last_context != lock.context) {
+ if (dev->driver->kernel_context_switch &&
+ dev->last_context != lock.context) {
dev->driver->kernel_context_switch(dev, dev->last_context,
lock.context);
}
@@ -163,8 +164,11 @@ int drm_unlock(struct inode *inode, struct file *filp,
atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]);
+ /* kernel_context_switch isn't used by any of the x86 drm
+ * modules but is required by the Sparc driver.
+ */
if (dev->driver->kernel_context_switch_unlock)
- dev->driver->kernel_context_switch_unlock(dev);
+ dev->driver->kernel_context_switch_unlock(dev, &lock);
else {
drm_lock_transfer(dev, &dev->lock.hw_lock->lock,
DRM_KERNEL_CONTEXT);
@@ -229,7 +233,8 @@ int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context)
* Marks the lock as held by the given context, via the \p cmpxchg instruction.
*/
static int drm_lock_transfer(drm_device_t * dev,
- __volatile__ unsigned int *lock, unsigned int context)
+ __volatile__ unsigned int *lock,
+ unsigned int context)
{
unsigned int old, new, prev;