drm: Roll out drm_for_each_connector more
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 9 Jul 2015 21:44:34 +0000 (23:44 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 22 Jul 2015 14:25:47 +0000 (16:25 +0200)
Now that we also grab the connection_mutex and so fixed the race with
atomic modeset we can use the iterator there too.

The other special case is drm_connector_unplug_all which would have a
locking inversion with the sysfs store/show functions if we'd grab the
mode_config.mutex around the unplug. We could just grab
connection_mutex instead, but that's a bit too much a dirty trick for
my taste. Also it's only used by udl, which doesn't do any other kind
of connector hotplugging, so should be race-free. Hence just stick
with a comment for now.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_crtc_helper.c
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/drm_plane_helper.c

index f6f2fb5..dfc8aaa 100644 (file)
@@ -1063,7 +1063,7 @@ drm_atomic_add_affected_connectors(struct drm_atomic_state *state,
         * Changed connectors are already in @state, so only need to look at the
         * current configuration.
         */
-       list_for_each_entry(connector, &config->connector_list, head) {
+       drm_for_each_connector(connector, state->dev) {
                if (connector->state->crtc != crtc)
                        continue;
 
index 5b59d5a..4ff334b 100644 (file)
@@ -89,7 +89,7 @@ get_current_crtc_for_encoder(struct drm_device *dev,
 
        WARN_ON(!drm_modeset_is_locked(&config->connection_mutex));
 
-       list_for_each_entry(connector, &config->connector_list, head) {
+       drm_for_each_connector(connector, dev) {
                if (connector->state->best_encoder != encoder)
                        continue;
 
@@ -1986,7 +1986,7 @@ retry:
 
        WARN_ON(!drm_modeset_is_locked(&config->connection_mutex));
 
-       list_for_each_entry(tmp_connector, &config->connector_list, head) {
+       drm_for_each_connector(tmp_connector, connector->dev) {
                if (tmp_connector->state->crtc != crtc)
                        continue;
 
Simple merge
Simple merge
Simple merge
Simple merge