]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drm/atomic: Remove drm_atomic_connectors_for_crtc.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tue, 10 May 2016 00:16:48 +0000 (18:16 -0600)
committerKamal Mostafa <kamal@canonical.com>
Mon, 16 May 2016 17:27:31 +0000 (10:27 -0700)
BugLink: http://bugs.launchpad.net/bugs/1542939
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>
(back ported from commit 14de6c44d149c68df1800ded42bbab51485ef67a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Conflicts:
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_atomic_helper.c

Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/vc4/vc4_crtc.c
include/drm/drm_atomic.h

index a2389018c79b14d2e1ddbd46c703d1b0d9126642..dc53965c6e1956f43cdf7acda633e19144752239 100644 (file)
@@ -1158,35 +1158,6 @@ drm_atomic_add_affected_planes(struct drm_atomic_state *state,
 }
 EXPORT_SYMBOL(drm_atomic_add_affected_planes);
 
-/**
- * drm_atomic_connectors_for_crtc - count number of connected outputs
- * @state: atomic state
- * @crtc: DRM crtc
- *
- * This function counts all connectors which will be connected to @crtc
- * according to @state. Useful to recompute the enable state for @crtc.
- */
-int
-drm_atomic_connectors_for_crtc(struct drm_atomic_state *state,
-                              struct drm_crtc *crtc)
-{
-       struct drm_connector *connector;
-       struct drm_connector_state *conn_state;
-
-       int i, num_connected_connectors = 0;
-
-       for_each_connector_in_state(state, connector, conn_state, i) {
-               if (conn_state->crtc == crtc)
-                       num_connected_connectors++;
-       }
-
-       DRM_DEBUG_ATOMIC("State %p has %i connectors for [CRTC:%d]\n",
-                        state, num_connected_connectors, crtc->base.id);
-
-       return num_connected_connectors;
-}
-EXPORT_SYMBOL(drm_atomic_connectors_for_crtc);
-
 /**
  * drm_atomic_legacy_backoff - locking backoff for legacy ioctls
  * @state: atomic state
index 2f3fd5c046ef1a2cf3ef7a8e3e3b6893ddf876f1..c2a3d067fb3c91ec4809802beafd31fe44f9e242 100644 (file)
@@ -471,7 +471,8 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
         * crtc only changed its mode but has the same set of connectors.
         */
        for_each_crtc_in_state(state, crtc, crtc_state, i) {
-               int num_connectors;
+               bool has_connectors =
+                       !!crtc_state->connector_mask;
 
                /*
                 * We must set ->active_changed after walking connectors for
@@ -500,10 +501,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
                if (ret != 0)
                        return ret;
 
-               num_connectors = drm_atomic_connectors_for_crtc(state,
-                                                               crtc);
-
-               if (crtc_state->enable != !!num_connectors) {
+               if (crtc_state->enable != has_connectors) {
                        DRM_DEBUG_ATOMIC("[CRTC:%d] enabled/connectors mismatch\n",
                                         crtc->base.id);
 
@@ -1735,7 +1733,7 @@ static int update_output_state(struct drm_atomic_state *state,
                if (crtc == set->crtc)
                        continue;
 
-               if (!drm_atomic_connectors_for_crtc(state, crtc)) {
+               if (!crtc_state->connector_mask) {
                        ret = drm_atomic_set_mode_prop_for_crtc(crtc_state,
                                                                NULL);
                        if (ret < 0)
index 265064c62d493b54023947d49597852a16328a5f..2d6d45d870aa3bf4cb62f27ef3e7d1b8a86d2ff1 100644 (file)
@@ -327,7 +327,7 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc,
        /* The pixelvalve can only feed one encoder (and encoders are
         * 1:1 with connectors.)
         */
-       if (drm_atomic_connectors_for_crtc(state->state, crtc) > 1)
+       if (hweight32(state->connector_mask) > 1)
                return -EINVAL;
 
        drm_atomic_crtc_state_for_each_plane(plane, state) {
index d8576ac55693da65c73cb7e66f38108e47e46242..d3eaa5df187a49fca6242c86bfb4e3bd1f64b2d0 100644 (file)
@@ -130,10 +130,6 @@ int __must_check
 drm_atomic_add_affected_planes(struct drm_atomic_state *state,
                               struct drm_crtc *crtc);
 
-int
-drm_atomic_connectors_for_crtc(struct drm_atomic_state *state,
-                              struct drm_crtc *crtc);
-
 void drm_atomic_legacy_backoff(struct drm_atomic_state *state);
 
 void