drm: don't associate _DRM_DRIVER maps with a master
authorBen Skeggs <bskeggs@redhat.com>
Tue, 26 May 2009 00:35:52 +0000 (10:35 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 3 Jun 2009 23:47:49 +0000 (09:47 +1000)
A driver will use the _DRM_DRIVER map flag to indicate that it wants
to be responsible for removing the map itself, bypassing the DRM's
automagic cleanup code.

Since the multi-master changes this has been broken, resulting in some
drivers having their registers unmapped before it's finished with them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_bufs.c

index 0411d912d82abb9a82b812eb5e1639029659c60a..80a257554b307a4bc0346e5f38e3c154ec22f4c5 100644 (file)
@@ -371,7 +371,8 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
        list->user_token = list->hash.key << PAGE_SHIFT;
        mutex_unlock(&dev->struct_mutex);
 
-       list->master = dev->primary->master;
+       if (!(map->flags & _DRM_DRIVER))
+               list->master = dev->primary->master;
        *maplist = list;
        return 0;
        }