All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: dri-devel@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Subject: [PATCH v2] drm/vc4: use drm_for_each_connector_iter()
Date: Fri, 12 May 2017 13:41:00 -0300	[thread overview]
Message-ID: <20170512164100.7649-1-gustavo@padovan.org> (raw)
In-Reply-To: <20170511191049.28944-7-gustavo@padovan.org>

From: Gustavo Padovan <gustavo.padovan@collabora.com>

Drop legacy drm_for_each_connector() in favor of the race-free
drm_for_each_connector_iter().

v2: add missing drm_connector_list_iter_end(Daniel Vetter)

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

---
only built-tested!
---
 drivers/gpu/drm/vc4/vc4_crtc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index d86c8cc..d66345f 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -359,12 +359,16 @@ static u32 vc4_get_fifo_full_level(u32 format)
 static struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc)
 {
 	struct drm_connector *connector;
+	struct drm_connector_list_iter conn_iter;
 
-	drm_for_each_connector(connector, crtc->dev) {
+	drm_connector_list_iter_begin(crtc->dev, &conn_iter);
+	drm_for_each_connector_iter(connector, &conn_iter) {
 		if (connector->state->crtc == crtc) {
+			drm_connector_list_iter_end(&conn_iter);
 			return connector->encoder;
 		}
 	}
+	drm_connector_list_iter_end(&conn_iter);
 
 	return NULL;
 }
-- 
2.9.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-05-12 16:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 19:10 [PATCH 0/8] remove unsafe drm_for_each_connector() Gustavo Padovan
2017-05-11 19:10 ` [PATCH 1/8] drm/exynos: use drm_for_each_connector_iter() Gustavo Padovan
2017-05-12  7:38   ` Daniel Vetter
2017-05-30  0:22   ` Inki Dae
2017-05-11 19:10 ` [PATCH 2/8] drm/rockchip: " Gustavo Padovan
2017-05-12  7:38   ` Daniel Vetter
2017-05-12 21:59   ` Sean Paul
2017-05-15 13:43   ` [PATCH v2] " Gustavo Padovan
2017-05-11 19:10 ` [PATCH 3/8] drm/i915: " Gustavo Padovan
2017-05-12  7:42   ` Daniel Vetter
2017-05-12 17:05     ` Ville Syrjälä
2017-05-11 19:10 ` [PATCH 4/8] drm/mediatek: " Gustavo Padovan
2017-05-12  7:44   ` Daniel Vetter
2017-05-11 19:10 ` [PATCH 5/8] drm/nouveau: " Gustavo Padovan
2017-05-12  7:45   ` Daniel Vetter
2017-05-11 19:10 ` [PATCH 6/8] drm/vc4: " Gustavo Padovan
2017-05-12  7:49   ` Daniel Vetter
2017-05-12 16:41   ` Gustavo Padovan [this message]
2017-05-12 21:06     ` [PATCH v2] " Eric Anholt
2017-05-11 19:10 ` [PATCH 7/8] drm: remove unsafe drm_for_each_connector() Gustavo Padovan
2017-05-12  7:51   ` Daniel Vetter
2017-05-11 19:10 ` [PATCH 8/8] drm: todo: remove task about switch to drm_connector_list_iter Gustavo Padovan
2017-05-12  7:51   ` Daniel Vetter
2017-05-26 23:17   ` Gustavo Padovan
2017-05-12  7:52 ` [PATCH 0/8] remove unsafe drm_for_each_connector() Daniel Vetter
2017-05-12 22:05 ` Sean Paul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170512164100.7649-1-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo.padovan@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.