diff options
author | Daniel Vetter <[email protected]> | 2017-04-06 21:06:54 +0200 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2017-04-06 22:49:50 +0200 |
commit | 53552d5df6694f68f276b2e86f8162d0ef7cad93 (patch) | |
tree | 459b5eb0368bb49b383460be5535117afe32978f | |
parent | 6c5ed5ae353cdf156f9ac4db17e15db56b4de880 (diff) |
drm: Take mode_config.mutex in setcrtc ioctl
Legacy drivers insist that we really take all the locks in this path,
and the harm in doing so is minimal.
v2: Like git add, it exists :(
Fixes: 2ceb585a956c ("drm: Add explicit acquire ctx handling around ->set_config")
Cc: Harry Wentland <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: [email protected]
Cc: Alex Deucher <[email protected]>
Reported-by: Alex Deucher <[email protected]>
Acked-and-tested-by: Alex Deucher <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index d69e180fc563..5af25ce5bf7c 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -576,6 +576,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, } DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); + mutex_lock(&crtc->dev->mode_config.mutex); drm_modeset_acquire_init(&ctx, 0); retry: ret = drm_modeset_lock_all_ctx(crtc->dev, &ctx); @@ -721,6 +722,7 @@ out: } drm_modeset_drop_locks(&ctx); drm_modeset_acquire_fini(&ctx); + mutex_unlock(&crtc->dev->mode_config.mutex); return ret; } |