All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/4] drm/atomic: Move enable/connector check up in check_modeset()
Date: Thu,  6 Apr 2017 13:19:02 +0200	[thread overview]
Message-ID: <1491477543-31257-4-git-send-email-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <1491477543-31257-1-git-send-email-maarten.lankhorst@linux.intel.com>

Now that handle_conflicting_encoders no longer touches active state,
so there's no need to do the check quite that late any more.

Doing it with all the other checks makes it a lot more clear what the
below block tries to accomplish, and this feels like a better place to
put the check.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index d267f45d2c9a..543ac330a1ae 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -494,6 +494,9 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
 	int i, ret;
 
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
+		bool has_connectors =
+			!!new_crtc_state->connector_mask;
+
 		if (!drm_mode_equal(&old_crtc_state->mode, &new_crtc_state->mode)) {
 			DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode changed\n",
 					 crtc->base.id, crtc->name);
@@ -521,6 +524,13 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
 					 crtc->base.id, crtc->name);
 			new_crtc_state->active_changed = true;
 		}
+
+		if (new_crtc_state->enable != has_connectors) {
+			DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enabled/connectors mismatch\n",
+					 crtc->base.id, crtc->name);
+
+			return -EINVAL;
+		}
 	}
 
 	ret = handle_conflicting_encoders(state, false);
@@ -554,9 +564,6 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
 	 * crtc only changed its mode but has the same set of connectors.
 	 */
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
-		bool has_connectors =
-			!!new_crtc_state->connector_mask;
-
 		if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
 			continue;
 
@@ -572,13 +579,6 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
 		ret = drm_atomic_add_affected_planes(state, crtc);
 		if (ret != 0)
 			return ret;
-
-		if (new_crtc_state->enable != has_connectors) {
-			DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enabled/connectors mismatch\n",
-					 crtc->base.id, crtc->name);
-
-			return -EINVAL;
-		}
 	}
 
 	return mode_fixup(state);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-04-06 11:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 11:18 [PATCH 0/4] drm/atomic: Cleanups for adding connector atomic check function Maarten Lankhorst
2017-04-06 11:19 ` [PATCH 1/4] drm/atomic: Unify conflicting encoder handling Maarten Lankhorst
2017-04-06 11:19 ` [PATCH 2/4] drm/atomic: Set all the changed flags in one place Maarten Lankhorst
2017-04-06 11:19 ` Maarten Lankhorst [this message]
2017-04-06 11:19 ` [PATCH 4/4] drm/atomic: Add connector atomic_check function, v2 Maarten Lankhorst
2017-04-06 11:36 ` ✓ Fi.CI.BAT: success for drm/atomic: Cleanups for adding connector atomic check function Patchwork
2017-04-06 12:48 ` [PATCH 0/4] " Sean Paul
2017-04-06 21:04   ` 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=1491477543-31257-4-git-send-email-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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 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.