summaryrefslogtreecommitdiff
path: root/linux/drm_drv.h
diff options
context:
space:
mode:
authorDavid Dawes <dawes@xfree86.org>2003-04-17 18:41:28 +0000
committerDavid Dawes <dawes@xfree86.org>2003-04-17 18:41:28 +0000
commitc2d7ff1bf98f92add98fb76b63d2bdb190f3cf2c (patch)
tree6afaad9978c0a555d27a441bd982eddbe197858d /linux/drm_drv.h
parentd1b7f551e6d582cd9c44d23883de1f6121907627 (diff)
Bring some drm module changes over from the XFree86 trunk:
- Reset 'bound' flag for an agp entry after undbind succeeded in drm_agpsupport.h (Egbert Eich). - Ignore hw_lock for drm device if lock was set by a different instance (ie Xserver) to prevent second server from spinning in driver release function (currently only relevant for i8xx drm drivers) (David Dawes). - Use the agpgart "key" for the unique handle for bindings rather than the memory address (the key is guaranteed to be unique) (David Dawes).
Diffstat (limited to 'linux/drm_drv.h')
-rw-r--r--linux/drm_drv.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/linux/drm_drv.h b/linux/drm_drv.h
index 0a4f3aeb..b2070d32 100644
--- a/linux/drm_drv.h
+++ b/linux/drm_drv.h
@@ -766,7 +766,7 @@ int DRM(release)( struct inode *inode, struct file *filp )
DRM_DEBUG( "pid = %d, device = 0x%lx, open_count = %d\n",
current->pid, (long)dev->device, dev->open_count );
- if ( dev->lock.hw_lock &&
+ if ( priv->lock_count && dev->lock.hw_lock &&
_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) &&
dev->lock.filp == filp ) {
DRM_DEBUG( "File %p released, freeing lock for context %d\n",
@@ -784,7 +784,7 @@ int DRM(release)( struct inode *inode, struct file *filp )
server. */
}
#if __HAVE_RELEASE
- else if ( dev->lock.hw_lock ) {
+ else if ( priv->lock_count && dev->lock.hw_lock ) {
/* The lock is required to reclaim buffers */
DECLARE_WAITQUEUE( entry, current );
@@ -933,6 +933,8 @@ int DRM(lock)( struct inode *inode, struct file *filp,
dev->lck_start = start = get_cycles();
#endif
+ ++priv->lock_count;
+
if ( copy_from_user( &lock, (drm_lock_t *)arg, sizeof(lock) ) )
return -EFAULT;