On Tuesday, December 04, 2007 12:30 pm Jesse Barnes wrote:
> The map removal code was blithely freeing the lock structure, even if it
> was part of a _DRM_DRIVER mapping. This caused X to crash at startup if
> you used a DRI aware driver.
>
> Look good? There may be a nicer way to do it...
Dave suggested a much better way that's actually partially done already. Move
the lock freeing to drm_rmmap_locked instead. So really all the patch has to
do is remove the stuff from lastclose and add a few more bits to rmmap...
Seems to work ok here.
Jesse
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index bfd3dd3..967e9a2 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -413,6 +413,8 @@ int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map)
case _DRM_SHM:
vfree(map->handle);
dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */
+ dev->lock.file_priv = NULL;
+ wake_up_interruptible(&dev->lock.lock_queue);
break;
case _DRM_AGP:
case _DRM_SCATTER_GATHER:
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 6a3e704..a88ae8b 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -276,11 +276,6 @@ int drm_lastclose(struct drm_device * dev)
if (drm_core_check_feature(dev, DRIVER_HAVE_DMA))
drm_dma_takedown(dev);
- if (dev->lock.hw_lock) {
- dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */
- dev->lock.file_priv = NULL;
- wake_up_interruptible(&dev->lock.lock_queue);
- }
dev->dev_mapping = NULL;
mutex_unlock(&dev->struct_mutex);
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel