linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org,
	Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: [PATCH 1/2] drm: rcar-du: Iterate over connectors in rcar_du_crtc_atomic_check()
Date: Thu, 14 May 2020 18:06:56 +0300	[thread overview]
Message-ID: <20200514150657.25431-1-laurent.pinchart+renesas@ideasonboard.com> (raw)

Replace iteration over encoders with iteration over connectors. This is
a bit more aligned with the atomic framework, but more importantly, the
change prepares for code that will need to access the connector.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index d73e88ddecd0..fbe927278634 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -685,7 +685,9 @@ static int rcar_du_crtc_atomic_check(struct drm_crtc *crtc,
 				     struct drm_crtc_state *state)
 {
 	struct rcar_du_crtc_state *rstate = to_rcar_crtc_state(state);
-	struct drm_encoder *encoder;
+	struct drm_connector_state *conn_state;
+	struct drm_connector *connector;
+	unsigned int i;
 	int ret;
 
 	ret = rcar_du_cmm_check(crtc, state);
@@ -695,15 +697,17 @@ static int rcar_du_crtc_atomic_check(struct drm_crtc *crtc,
 	/* Store the routes from the CRTC output to the DU outputs. */
 	rstate->outputs = 0;
 
-	drm_for_each_encoder_mask(encoder, crtc->dev, state->encoder_mask) {
-		struct rcar_du_encoder *renc;
+	for_each_new_connector_in_state(state->state, connector, conn_state, i) {
+		struct drm_encoder *encoder = conn_state->best_encoder;
+
+		if (!encoder)
+			continue;
 
 		/* Skip the writeback encoder. */
 		if (encoder->encoder_type == DRM_MODE_ENCODER_VIRTUAL)
 			continue;
 
-		renc = to_rcar_encoder(encoder);
-		rstate->outputs |= BIT(renc->output);
+		rstate->outputs |= BIT(to_rcar_encoder(encoder)->output);
 	}
 
 	return 0;
-- 
Regards,

Laurent Pinchart


             reply	other threads:[~2020-05-14 15:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 15:06 Laurent Pinchart [this message]
2020-05-14 15:06 ` [PATCH 2/2] drm: rcar-du: Configure pixel clock polarity Laurent Pinchart

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=20200514150657.25431-1-laurent.pinchart+renesas@ideasonboard.com \
    --to=laurent.pinchart+renesas@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).