Commit 825926d8 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Daniel Vetter

drm/atomic: Make sure lock is held in trylock contexts.

This will make sure we get a lockdep spat in all cases
even if the context is a complete garbage pointer.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 53edb2c6
...@@ -307,6 +307,8 @@ static inline int modeset_lock(struct drm_modeset_lock *lock, ...@@ -307,6 +307,8 @@ static inline int modeset_lock(struct drm_modeset_lock *lock,
WARN_ON(ctx->contended); WARN_ON(ctx->contended);
if (ctx->trylock_only) { if (ctx->trylock_only) {
lockdep_assert_held(&ctx->ww_ctx);
if (!ww_mutex_trylock(&lock->mutex)) if (!ww_mutex_trylock(&lock->mutex))
return -EBUSY; return -EBUSY;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment