]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Simplify pipe_mask setup even further
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 2 Oct 2019 16:25:04 +0000 (19:25 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 31 Oct 2019 14:08:11 +0000 (16:08 +0200)
Just set pipe_mask=~0 for the non-special cases where any pipe
will do. intel_encoder_possible_crtcs() will anyway drop out
anything that doesn't exist.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191002162505.30716-5-ville.syrjala@linux.intel.com
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
drivers/gpu/drm/i915/display/icl_dsi.c
drivers/gpu/drm/i915/display/intel_crt.c
drivers/gpu/drm/i915/display/intel_ddi.c
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dp_mst.c
drivers/gpu/drm/i915/display/intel_dvo.c
drivers/gpu/drm/i915/display/intel_hdmi.c
drivers/gpu/drm/i915/display/intel_lvds.c
drivers/gpu/drm/i915/display/intel_sdvo.c
drivers/gpu/drm/i915/display/intel_tv.c
drivers/gpu/drm/i915/display/vlv_dsi.c

index 99a75c6113871c0fb3cd22e842735991a860ad56..325df29b0447668b7109de3b66d31ce5779313ed 100644 (file)
@@ -1552,7 +1552,6 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
        struct drm_connector *connector;
        struct drm_display_mode *fixed_mode;
        enum port port;
-       enum pipe pipe;
 
        if (!intel_bios_is_dsi_present(dev_priv, &port))
                return;
@@ -1585,8 +1584,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
        encoder->get_hw_state = gen11_dsi_get_hw_state;
        encoder->type = INTEL_OUTPUT_DSI;
        encoder->cloneable = 0;
-       for_each_pipe(dev_priv, pipe)
-               encoder->pipe_mask |= BIT(pipe);
+       encoder->pipe_mask = ~0;
        encoder->power_domain = POWER_DOMAIN_PORT_DSI;
        encoder->get_power_domains = gen11_dsi_get_power_domains;
 
index b704d2f9fae0618b05af0f55ac3ada6d918c24ba..39cc6d79dc85fc4f9492c7fb42b31821e2710a11 100644 (file)
@@ -1003,7 +1003,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
        if (IS_I830(dev_priv))
                crt->base.pipe_mask = BIT(PIPE_A);
        else
-               crt->base.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
+               crt->base.pipe_mask = ~0;
 
        if (IS_GEN(dev_priv, 2))
                connector->interlace_allowed = 0;
index e4f9868a4addb9a09369fb0c373fb392a747aeb9..b51f244ad7a54d0e1398b6f299efbdfc5b41884f 100644 (file)
@@ -4688,7 +4688,6 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
        struct intel_encoder *intel_encoder;
        struct drm_encoder *encoder;
        bool init_hdmi, init_dp, init_lspcon = false;
-       enum pipe pipe;
        enum phy phy = intel_port_to_phy(dev_priv, port);
 
        init_hdmi = port_info->supports_dvi || port_info->supports_hdmi;
@@ -4740,8 +4739,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
        intel_encoder->power_domain = intel_port_to_power_domain(port);
        intel_encoder->port = port;
        intel_encoder->cloneable = 0;
-       for_each_pipe(dev_priv, pipe)
-               intel_encoder->pipe_mask |= BIT(pipe);
+       intel_encoder->pipe_mask = ~0;
 
        if (INTEL_GEN(dev_priv) >= 11)
                intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &
index ec3b37f23894c26a9f688ea279a77f09656e8078..c80621ad138ba7fdf8f00217d379435158fa8abe 100644 (file)
@@ -7575,7 +7575,7 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
                else
                        intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B);
        } else {
-               intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
+               intel_encoder->pipe_mask = ~0;
        }
        intel_encoder->cloneable = 0;
        intel_encoder->port = port;
index 17f3693fae7ee6b08b65eae09024de7d08914f1e..7370c9dfa8a1ce17770399c2dd633e31107bfa52 100644 (file)
@@ -598,8 +598,6 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum
        struct intel_dp_mst_encoder *intel_mst;
        struct intel_encoder *intel_encoder;
        struct drm_device *dev = intel_dig_port->base.base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
-       enum pipe pipe_iter;
 
        intel_mst = kzalloc(sizeof(*intel_mst), GFP_KERNEL);
 
@@ -617,8 +615,7 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum
        intel_encoder->power_domain = intel_dig_port->base.power_domain;
        intel_encoder->port = intel_dig_port->base.port;
        intel_encoder->cloneable = 0;
-       for_each_pipe(dev_priv, pipe_iter)
-               intel_encoder->pipe_mask |= BIT(pipe_iter);
+       intel_encoder->pipe_mask = ~0;
 
        intel_encoder->compute_config = intel_dp_mst_compute_config;
        intel_encoder->disable = intel_mst_disable_dp;
index a6c165d857e0c62cdcea164b557640d9102d06a0..bcfbcb743e7da0a9e5a7a69756636fe1027de936 100644 (file)
@@ -505,7 +505,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv)
                intel_encoder->type = INTEL_OUTPUT_DVO;
                intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER;
                intel_encoder->port = port;
-               intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B);
+               intel_encoder->pipe_mask = ~0;
 
                switch (dvo->type) {
                case INTEL_DVO_CHIP_TMDS:
index 7605337105b90b8d1a67cb42300b3cd5ec9bb98a..f6f5312205c49ede75fed758cab856b696882bab 100644 (file)
@@ -3287,7 +3287,7 @@ void intel_hdmi_init(struct drm_i915_private *dev_priv,
                else
                        intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B);
        } else {
-               intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
+               intel_encoder->pipe_mask = ~0;
        }
        intel_encoder->cloneable = 1 << INTEL_OUTPUT_ANALOG;
        /*
index e358a6da5aaf26297d8794dd2b215307f7ed3ec0..b1bc786236476cb08a401ed9472ad2e55c6f97f5 100644 (file)
@@ -902,7 +902,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
        if (INTEL_GEN(dev_priv) < 4)
                intel_encoder->pipe_mask = BIT(PIPE_B);
        else
-               intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
+               intel_encoder->pipe_mask = ~0;
 
        drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs);
        connector->display_info.subpixel_order = SubPixelHorizontalRGB;
index fed738effbc3ca0edab2eb221dab32db38fecf70..5b7f4baf7348fbbbe650b6b653ce91b2b2fb62f0 100644 (file)
@@ -2921,7 +2921,7 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
                              bytes[0], bytes[1]);
                return false;
        }
-       intel_sdvo->base.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
+       intel_sdvo->base.pipe_mask = ~0;
 
        return true;
 }
index a329cfcb501de219ab165669b0ab63c060c516b6..9983fadf6c2844df617003f8a096e5ddd5c026ea 100644 (file)
@@ -1947,7 +1947,7 @@ intel_tv_init(struct drm_i915_private *dev_priv)
        intel_encoder->type = INTEL_OUTPUT_TVOUT;
        intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER;
        intel_encoder->port = PORT_NONE;
-       intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B);
+       intel_encoder->pipe_mask = ~0;
        intel_encoder->cloneable = 0;
        intel_tv->type = DRM_MODE_CONNECTOR_Unknown;
 
index 11a7c77d64bcd65705790e2271ac8835ae045b8f..0ca49b1604c6a7140159887e320a87d6bb83969b 100644 (file)
@@ -1870,7 +1870,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
         * port C. BXT isn't limited like this.
         */
        if (IS_GEN9_LP(dev_priv))
-               intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
+               intel_encoder->pipe_mask = ~0;
        else if (port == PORT_A)
                intel_encoder->pipe_mask = BIT(PIPE_A);
        else