Commit 6c51d1cfa0a370b48a157163340190cf5fd2346b

Authored by Ben Skeggs
Committed by Dave Airlie
1 parent 93c05f2224

drm: don't associate _DRM_DRIVER maps with a master

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>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

drivers/gpu/drm/drm_bufs.c
... ... @@ -371,7 +371,8 @@
371 371 list->user_token = list->hash.key << PAGE_SHIFT;
372 372 mutex_unlock(&dev->struct_mutex);
373 373  
374   - list->master = dev->primary->master;
  374 + if (!(map->flags & _DRM_DRIVER))
  375 + list->master = dev->primary->master;
375 376 *maplist = list;
376 377 return 0;
377 378 }