summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drm_bufs.h
diff options
context:
space:
mode:
authoranholt <anholt@FreeBSD.org>2003-11-12 20:56:30 +0000
committeranholt <anholt@FreeBSD.org>2003-11-12 20:56:30 +0000
commit6a52a51a4490ccf15281df6dbd3ae35c26c166d5 (patch)
tree1255ca85a955cae45fb9e6254d7546e2e94cb09a /sys/dev/drm/drm_bufs.h
parent3f57e25aebf74440eeb330bfd415b42a33d4872d (diff)
downloadFreeBSD-src-6a52a51a4490ccf15281df6dbd3ae35c26c166d5.zip
FreeBSD-src-6a52a51a4490ccf15281df6dbd3ae35c26c166d5.tar.gz
Update from DRI CVS. Includes locking fixes (including PR 59202), changes for
Radeon IGP support (still lacking PCI IDs), and DRM interface 1.2 updates which include finally tying the DRM instances to specific devices rather than relying on the X Server.
Diffstat (limited to 'sys/dev/drm/drm_bufs.h')
-rw-r--r--sys/dev/drm/drm_bufs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/drm/drm_bufs.h b/sys/dev/drm/drm_bufs.h
index efb8ce7..5053d36 100644
--- a/sys/dev/drm/drm_bufs.h
+++ b/sys/dev/drm/drm_bufs.h
@@ -137,7 +137,17 @@ int DRM(addmap)( DRM_IOCTL_ARGS )
}
map->offset = (unsigned long)map->handle;
if ( map->flags & _DRM_CONTAINS_LOCK ) {
+ /* Prevent a 2nd X Server from creating a 2nd lock */
+ DRM_LOCK();
+ if (dev->lock.hw_lock != NULL) {
+ DRM_UNLOCK();
+ DRM(free)(map->handle, map->size,
+ DRM_MEM_SAREA);
+ DRM(free)(map, sizeof(*map), DRM_MEM_MAPS);
+ return DRM_ERR(EBUSY);
+ }
dev->lock.hw_lock = map->handle; /* Pointer to lock */
+ DRM_UNLOCK();
}
break;
#if __REALLY_HAVE_AGP
OpenPOWER on IntegriCloud