MTRR_TYPE_WRCOMB, 1 );
}
#endif
- map->handle = DRM(ioremap)( map->offset, map->size, dev );
+ if (map->type == _DRM_REGISTERS)
+ map->handle = DRM(ioremap)( map->offset, map->size,
+ dev );
break;
case _DRM_SHM:
}
map->offset = (unsigned long)map->handle;
if ( map->flags & _DRM_CONTAINS_LOCK ) {
+ /* Prevent a 2nd X Server from creating a 2nd lock */
+ if (dev->lock.hw_lock != NULL) {
+ vfree( map->handle );
+ DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
+ return -EBUSY;
+ }
dev->sigdata.lock =
dev->lock.hw_lock = map->handle; /* Pointer to lock */
}
}
#endif /* __HAVE_PCI_DMA */
-#ifdef __HAVE_SG
+#if __HAVE_SG
int DRM(addbufs_sg)( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg )
{