summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-04-06 14:19:02 +0300
committerSean Paul <seanpaul@chromium.org>2017-04-07 00:00:27 +0300
commit970ece83fdd46cb4fa834a4d5adfdf746e4174b2 (patch)
treed31a86cf70703f548c0727395c76f735ea4fb4fd /drivers
parent24d6652c1508ccb530726ad8065de92ac31f2449 (diff)
downloadlinux-970ece83fdd46cb4fa834a4d5adfdf746e4174b2.tar.xz
drm/atomic: Move enable/connector check up in check_modeset()
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> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1491477543-31257-4-git-send-email-maarten.lankhorst@linux.intel.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 2d506820285f..ff3c6eb5b6bd 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);