[Intel-gfx] [PATCH 09/11] drm: Amend connector/encoder list locking rules

Daniel Vetter daniel.vetter at ffwll.ch
Tue Jun 23 13:46:00 PDT 2015


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.

Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 include/drm/drm_crtc.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 3646c47b43de..c1c4f16f01ca 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1588,14 +1588,16 @@ static inline struct drm_property *drm_property_find(struct drm_device *dev,
 	list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head)
 
 #define drm_for_each_connector(connector, dev) \
-	for (WARN_ON(!mutex_is_locked(&(dev)->mode_config.mutex)),		\
+	for (WARN_ON(!mutex_is_locked(&(dev)->mode_config.mutex) &&		\
+		     !drm_modeset_is_locked(&(dev)->mode_config.connection_mutex)), \
 	     connector = list_first_entry(&(dev)->mode_config.connector_list,	\
 					  struct drm_connector, head);		\
 	     &connector->head != (&(dev)->mode_config.connector_list);		\
 	     connector = list_next_entry(connector, head))
 
 #define drm_for_each_encoder(encoder, dev) \
-	for (WARN_ON(!mutex_is_locked(&(dev)->mode_config.mutex)),		\
+	for (WARN_ON(!mutex_is_locked(&(dev)->mode_config.mutex) &&		\
+		     !drm_modeset_is_locked(&(dev)->mode_config.connection_mutex)), \
 	     encoder = list_first_entry(&(dev)->mode_config.encoder_list,	\
 					  struct drm_encoder, head);		\
 	     &encoder->head != (&(dev)->mode_config.encoder_list);		\
-- 
2.1.4



More information about the Intel-gfx mailing list