diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2016-01-04 06:53:20 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-01-06 10:37:39 -0500 |
commit | 14de6c44d149c68df1800ded42bbab51485ef67a (patch) | |
tree | d8d68705c4f108b3f57abfa6ed8940ee43902fd6 | |
parent | 2aa974c92b9d0bb092a8f308d83dfe3c69041b01 (diff) |
drm/atomic: Remove drm_atomic_connectors_for_crtc.
Now that connector_mask is reliable there's no need for this
function any more.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1451908400-25147-6-git-send-email-maarten.lankhorst@linux.intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/drm_atomic.c | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_crtc.c | 2 | ||||
-rw-r--r-- | include/drm/drm_atomic.h | 4 |
4 files changed, 5 insertions, 41 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 6050c80f1dbc..3f74193885f1 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c | |||
@@ -1199,36 +1199,6 @@ drm_atomic_add_affected_planes(struct drm_atomic_state *state, | |||
1199 | EXPORT_SYMBOL(drm_atomic_add_affected_planes); | 1199 | EXPORT_SYMBOL(drm_atomic_add_affected_planes); |
1200 | 1200 | ||
1201 | /** | 1201 | /** |
1202 | * drm_atomic_connectors_for_crtc - count number of connected outputs | ||
1203 | * @state: atomic state | ||
1204 | * @crtc: DRM crtc | ||
1205 | * | ||
1206 | * This function counts all connectors which will be connected to @crtc | ||
1207 | * according to @state. Useful to recompute the enable state for @crtc. | ||
1208 | */ | ||
1209 | int | ||
1210 | drm_atomic_connectors_for_crtc(struct drm_atomic_state *state, | ||
1211 | struct drm_crtc *crtc) | ||
1212 | { | ||
1213 | struct drm_connector *connector; | ||
1214 | struct drm_connector_state *conn_state; | ||
1215 | |||
1216 | int i, num_connected_connectors = 0; | ||
1217 | |||
1218 | for_each_connector_in_state(state, connector, conn_state, i) { | ||
1219 | if (conn_state->crtc == crtc) | ||
1220 | num_connected_connectors++; | ||
1221 | } | ||
1222 | |||
1223 | DRM_DEBUG_ATOMIC("State %p has %i connectors for [CRTC:%d:%s]\n", | ||
1224 | state, num_connected_connectors, | ||
1225 | crtc->base.id, crtc->name); | ||
1226 | |||
1227 | return num_connected_connectors; | ||
1228 | } | ||
1229 | EXPORT_SYMBOL(drm_atomic_connectors_for_crtc); | ||
1230 | |||
1231 | /** | ||
1232 | * drm_atomic_legacy_backoff - locking backoff for legacy ioctls | 1202 | * drm_atomic_legacy_backoff - locking backoff for legacy ioctls |
1233 | * @state: atomic state | 1203 | * @state: atomic state |
1234 | * | 1204 | * |
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 738104b68d26..57cccd68ca52 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -463,7 +463,8 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, | |||
463 | * crtc only changed its mode but has the same set of connectors. | 463 | * crtc only changed its mode but has the same set of connectors. |
464 | */ | 464 | */ |
465 | for_each_crtc_in_state(state, crtc, crtc_state, i) { | 465 | for_each_crtc_in_state(state, crtc, crtc_state, i) { |
466 | int num_connectors; | 466 | bool has_connectors = |
467 | !!crtc_state->connector_mask; | ||
467 | 468 | ||
468 | /* | 469 | /* |
469 | * We must set ->active_changed after walking connectors for | 470 | * We must set ->active_changed after walking connectors for |
@@ -492,10 +493,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, | |||
492 | if (ret != 0) | 493 | if (ret != 0) |
493 | return ret; | 494 | return ret; |
494 | 495 | ||
495 | num_connectors = drm_atomic_connectors_for_crtc(state, | 496 | if (crtc_state->enable != has_connectors) { |
496 | crtc); | ||
497 | |||
498 | if (crtc_state->enable != !!num_connectors) { | ||
499 | DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enabled/connectors mismatch\n", | 497 | DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enabled/connectors mismatch\n", |
500 | crtc->base.id, crtc->name); | 498 | crtc->base.id, crtc->name); |
501 | 499 | ||
@@ -1754,7 +1752,7 @@ static int update_output_state(struct drm_atomic_state *state, | |||
1754 | if (crtc == set->crtc) | 1752 | if (crtc == set->crtc) |
1755 | continue; | 1753 | continue; |
1756 | 1754 | ||
1757 | if (!drm_atomic_connectors_for_crtc(state, crtc)) { | 1755 | if (!crtc_state->connector_mask) { |
1758 | ret = drm_atomic_set_mode_prop_for_crtc(crtc_state, | 1756 | ret = drm_atomic_set_mode_prop_for_crtc(crtc_state, |
1759 | NULL); | 1757 | NULL); |
1760 | if (ret < 0) | 1758 | if (ret < 0) |
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 8d0d70e51ef2..018145e0b87d 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c | |||
@@ -328,7 +328,7 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, | |||
328 | /* The pixelvalve can only feed one encoder (and encoders are | 328 | /* The pixelvalve can only feed one encoder (and encoders are |
329 | * 1:1 with connectors.) | 329 | * 1:1 with connectors.) |
330 | */ | 330 | */ |
331 | if (drm_atomic_connectors_for_crtc(state->state, crtc) > 1) | 331 | if (hweight32(state->connector_mask) > 1) |
332 | return -EINVAL; | 332 | return -EINVAL; |
333 | 333 | ||
334 | drm_atomic_crtc_state_for_each_plane(plane, state) { | 334 | drm_atomic_crtc_state_for_each_plane(plane, state) { |
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index d8576ac55693..d3eaa5df187a 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h | |||
@@ -130,10 +130,6 @@ int __must_check | |||
130 | drm_atomic_add_affected_planes(struct drm_atomic_state *state, | 130 | drm_atomic_add_affected_planes(struct drm_atomic_state *state, |
131 | struct drm_crtc *crtc); | 131 | struct drm_crtc *crtc); |
132 | 132 | ||
133 | int | ||
134 | drm_atomic_connectors_for_crtc(struct drm_atomic_state *state, | ||
135 | struct drm_crtc *crtc); | ||
136 | |||
137 | void drm_atomic_legacy_backoff(struct drm_atomic_state *state); | 133 | void drm_atomic_legacy_backoff(struct drm_atomic_state *state); |
138 | 134 | ||
139 | void | 135 | void |