drm/fb-helper: Add top-level lock
authorThierry Reding <treding@nvidia.com>
Tue, 4 Jul 2017 15:18:23 +0000 (17:18 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Jul 2017 08:00:42 +0000 (10:00 +0200)
commite9827d8ea2142d49a6622c72a3371a1d1e929c1d
treec8785e963c8a6edfd313fb67b3473394ad05a2b0
parent666b7cdc69b03cb55266a14aa5874af0d27bfb0f
drm/fb-helper: Add top-level lock

Introduce a new top-level lock for the FB helper code. This will allow
better locking granularity and avoid the need to abuse modeset locking
for this purpose instead.

This patch just adds the new lock everywhere we currently grab
mode_config->mutex (explicitly, or through drm_modeset_lock_all).
Follow-up patches will push the kms locking down into only the places
that need it.

v2:
- use lockdep_assert_held
- use drm_fb_helper_for_each_connector where possible
- use the new top-level lock consistently, i.e. in all the places
  we're currently acquiring mode_config.mutex.
- small polish to the kerneldoc

Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com> (v1)
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170704151833.17304-4-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_fb_helper.c
include/drm/drm_fb_helper.h