• Thomas Hellstrom's avatar
    drm/vmwgfx: Fix a destoy-while-held mutex problem. · 73a88250
    Thomas Hellstrom authored
    When validating legacy surfaces, the backup bo might be destroyed at
    surface validate time. However, the kms resource validation code may have
    the bo reserved, so we will destroy a locked mutex. While there shouldn't
    be any other users of that mutex when it is destroyed, it causes a lock
    leak and thus throws a lockdep error.
    
    Fix this by having the kms resource validation code hold a reference to
    the bo while we have it reserved. We do this by introducing a validation
    context which might come in handy when the kms code is extended to validate
    multiple resources or buffers.
    
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
    Reviewed-by: default avatarSinclair Yeh <syeh@vmware.com>
    73a88250
vmwgfx_kms.h 14.2 KB