git: drm: Fix ww mutex crtc locking

Francois Tigeot ftigeot at crater.dragonflybsd.org
Thu Dec 24 00:58:01 PST 2015


commit 4a1f0d757dc89c9bbe3a5b0e16c28eb180939912
Author: François Tigeot <ftigeot at wolfpond.org>
Date:   Thu Dec 24 09:56:57 2015 +0100

    drm: Fix ww mutex crtc locking
    
    * The original code had many problems:
      - the ctx wasn't available to drm_modeset_unlock().
      - 'struct list_head' was used for both the list head AND the list entry
      It's like it was coded to create maximum confusion on top of maximum pain
    
    * drm_modeset_acquire_ctx structure needs a second list which we add
      kmalloc()'d entries to to track the extra locks in the EALREADY case
    
    * Replace the reference from the modeset_lock structure with a pointer
      to an intermediate (kmalloc'd) structure that references both and turn
      the list entry in the lock into a list head
    
    Submitted-by: Matthew Dillon <dillon at apollo.backplane.com>

Summary of changes:
 sys/dev/drm/drm_modeset_lock.c             | 36 ++++++++++++++++++++++--------
 sys/dev/drm/include/drm/drm_modeset_lock.h | 18 +++++++++++----
 2 files changed, 41 insertions(+), 13 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4a1f0d757dc89c9bbe3a5b0e16c28eb180939912


-- 
DragonFly BSD source repository


More information about the Commits mailing list