drm/i915: Clean up encoder->crtc_mask setup
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 8 Jul 2019 16:20:44 +0000 (19:20 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 2 Oct 2019 15:18:07 +0000 (18:18 +0300)
Use BIT(pipe) for better legibility when populating the crtc_mask
for encoders.

Also remove the redundant possible_crtcs setup for the TV encoder.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190708162048.4286-11-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_crt.c
drivers/gpu/drm/i915/display/intel_dp.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

index e6e8d4a820446a7fd99f7b7af735a378d8d0918e..ff6126ea793ceba3eed90c0f676ca0f212247097 100644 (file)
@@ -994,9 +994,9 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
        crt->base.type = INTEL_OUTPUT_ANALOG;
        crt->base.cloneable = (1 << INTEL_OUTPUT_DVO) | (1 << INTEL_OUTPUT_HDMI);
        if (IS_I830(dev_priv))
-               crt->base.crtc_mask = (1 << 0);
+               crt->base.crtc_mask = BIT(PIPE_A);
        else
-               crt->base.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
+               crt->base.crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
 
        if (IS_GEN(dev_priv, 2))
                connector->interlace_allowed = 0;
index 14a5c661f7103d41c419841485736e61de0b5df1..b788e332e76a7b6b237d866ef51586498e880078 100644 (file)
@@ -7366,11 +7366,11 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
        intel_encoder->power_domain = intel_port_to_power_domain(port);
        if (IS_CHERRYVIEW(dev_priv)) {
                if (port == PORT_D)
-                       intel_encoder->crtc_mask = 1 << 2;
+                       intel_encoder->crtc_mask = BIT(PIPE_C);
                else
-                       intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
+                       intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
        } else {
-               intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
+               intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
        }
        intel_encoder->cloneable = 0;
        intel_encoder->port = port;
index 34193d04597a8d0399258f6edad0d7194872bb29..9827f99491d18418b33cca5f51b48e6805212fdf 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->crtc_mask = (1 << 0) | (1 << 1);
+               intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
 
                switch (dvo->type) {
                case INTEL_DVO_CHIP_TMDS:
index 5ab73331d35df75b3fbedeef9560f86a2ce5f7c8..03b140980fc45b6378466e2779f02592fa492f57 100644 (file)
@@ -3269,11 +3269,11 @@ void intel_hdmi_init(struct drm_i915_private *dev_priv,
        intel_encoder->port = port;
        if (IS_CHERRYVIEW(dev_priv)) {
                if (port == PORT_D)
-                       intel_encoder->crtc_mask = 1 << 2;
+                       intel_encoder->crtc_mask = BIT(PIPE_C);
                else
-                       intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
+                       intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
        } else {
-               intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
+               intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
        }
        intel_encoder->cloneable = 1 << INTEL_OUTPUT_ANALOG;
        /*
index c786abdc3336c8af66b22c0b723a2096b998d1b1..13841d7c455b36043dd93ca2a763946d8bba9168 100644 (file)
@@ -900,11 +900,11 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
        intel_encoder->port = PORT_NONE;
        intel_encoder->cloneable = 0;
        if (HAS_PCH_SPLIT(dev_priv))
-               intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
+               intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
        else if (IS_GEN(dev_priv, 4))
-               intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
+               intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
        else
-               intel_encoder->crtc_mask = (1 << 1);
+               intel_encoder->crtc_mask = BIT(PIPE_B);
 
        drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs);
        connector->display_info.subpixel_order = SubPixelHorizontalRGB;
index adeb1c840976845739c259de4789e7c0a5edf9ec..47f5d87a938a90cff4a0b0689b74f8953a5d260a 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.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
+       intel_sdvo->base.crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
 
        return true;
 }
index 71c3f7e5df7d26848271d96818ef1a9d7c2c1947..70726b4812444ffdc2a41a67a8ba3276abbe3557 100644 (file)
@@ -1947,9 +1947,8 @@ 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->crtc_mask = (1 << 0) | (1 << 1);
+       intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
        intel_encoder->cloneable = 0;
-       intel_encoder->base.possible_crtcs = ((1 << 0) | (1 << 1));
        intel_tv->type = DRM_MODE_CONNECTOR_Unknown;
 
        /* BIOS margin values */