diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-07-09 23:44:33 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-07-22 16:25:46 +0200 |
commit | cff20ba2758d6b82978be5b1f40536bfc121af88 (patch) | |
tree | 2034923cf774599930a34153cdd3ef9797b7611d /include/drm | |
parent | 2ee6bcdcfa4d8b56b20bc6308cd5f9bced5b5324 (diff) | |
download | blackbird-op-linux-cff20ba2758d6b82978be5b1f40536bfc121af88.tar.gz blackbird-op-linux-cff20ba2758d6b82978be5b1f40536bfc121af88.zip |
drm: Amend connector list locking rules
Now that dp mst hotplug takes all locks we can amend the locking rules
for the iterators. This is needed before we can roll these out in the
atomic code to avoid getting burried in WARNINGs.
v2: Rebase onto the extracted list locking assert and add a comment to
explain the rules.
v3: Fixup German->English translation fail in the comment.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_crtc.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 10547be5684a..fe3100115a41 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -1592,7 +1592,15 @@ static inline struct drm_property *drm_property_find(struct drm_device *dev, static inline void assert_drm_connector_list_read_locked(struct drm_mode_config *mode_config) { - WARN_ON(!mutex_is_locked(&mode_config->mutex)); + /* + * The connector hotadd/remove code currently grabs both locks when + * updating lists. Hence readers need only hold either of them to be + * safe and the check amounts to + * + * WARN_ON(not_holding(A) && not_holding(B)). + */ + WARN_ON(!mutex_is_locked(&mode_config->mutex) && + !drm_modeset_is_locked(&mode_config->connection_mutex)); } #define drm_for_each_connector(connector, dev) \ |