Commit 0fbae9d2 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Clean up encoder->crtc_mask setup

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: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190708162048.4286-11-ville.syrjala@linux.intel.com
parent ed500bf6
...@@ -994,9 +994,9 @@ void intel_crt_init(struct drm_i915_private *dev_priv) ...@@ -994,9 +994,9 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
crt->base.type = INTEL_OUTPUT_ANALOG; crt->base.type = INTEL_OUTPUT_ANALOG;
crt->base.cloneable = (1 << INTEL_OUTPUT_DVO) | (1 << INTEL_OUTPUT_HDMI); crt->base.cloneable = (1 << INTEL_OUTPUT_DVO) | (1 << INTEL_OUTPUT_HDMI);
if (IS_I830(dev_priv)) if (IS_I830(dev_priv))
crt->base.crtc_mask = (1 << 0); crt->base.crtc_mask = BIT(PIPE_A);
else 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)) if (IS_GEN(dev_priv, 2))
connector->interlace_allowed = 0; connector->interlace_allowed = 0;
......
...@@ -7366,11 +7366,11 @@ bool intel_dp_init(struct drm_i915_private *dev_priv, ...@@ -7366,11 +7366,11 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
intel_encoder->power_domain = intel_port_to_power_domain(port); intel_encoder->power_domain = intel_port_to_power_domain(port);
if (IS_CHERRYVIEW(dev_priv)) { if (IS_CHERRYVIEW(dev_priv)) {
if (port == PORT_D) if (port == PORT_D)
intel_encoder->crtc_mask = 1 << 2; intel_encoder->crtc_mask = BIT(PIPE_C);
else else
intel_encoder->crtc_mask = (1 << 0) | (1 << 1); intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
} else { } 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->cloneable = 0;
intel_encoder->port = port; intel_encoder->port = port;
......
...@@ -505,7 +505,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) ...@@ -505,7 +505,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv)
intel_encoder->type = INTEL_OUTPUT_DVO; intel_encoder->type = INTEL_OUTPUT_DVO;
intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER; intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER;
intel_encoder->port = port; 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) { switch (dvo->type) {
case INTEL_DVO_CHIP_TMDS: case INTEL_DVO_CHIP_TMDS:
......
...@@ -3269,11 +3269,11 @@ void intel_hdmi_init(struct drm_i915_private *dev_priv, ...@@ -3269,11 +3269,11 @@ void intel_hdmi_init(struct drm_i915_private *dev_priv,
intel_encoder->port = port; intel_encoder->port = port;
if (IS_CHERRYVIEW(dev_priv)) { if (IS_CHERRYVIEW(dev_priv)) {
if (port == PORT_D) if (port == PORT_D)
intel_encoder->crtc_mask = 1 << 2; intel_encoder->crtc_mask = BIT(PIPE_C);
else else
intel_encoder->crtc_mask = (1 << 0) | (1 << 1); intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
} else { } 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; intel_encoder->cloneable = 1 << INTEL_OUTPUT_ANALOG;
/* /*
......
...@@ -900,11 +900,11 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) ...@@ -900,11 +900,11 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
intel_encoder->port = PORT_NONE; intel_encoder->port = PORT_NONE;
intel_encoder->cloneable = 0; intel_encoder->cloneable = 0;
if (HAS_PCH_SPLIT(dev_priv)) 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)) 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 else
intel_encoder->crtc_mask = (1 << 1); intel_encoder->crtc_mask = BIT(PIPE_B);
drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs); drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs);
connector->display_info.subpixel_order = SubPixelHorizontalRGB; connector->display_info.subpixel_order = SubPixelHorizontalRGB;
......
...@@ -2921,7 +2921,7 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags) ...@@ -2921,7 +2921,7 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
bytes[0], bytes[1]); bytes[0], bytes[1]);
return false; 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; return true;
} }
......
...@@ -1947,9 +1947,8 @@ intel_tv_init(struct drm_i915_private *dev_priv) ...@@ -1947,9 +1947,8 @@ intel_tv_init(struct drm_i915_private *dev_priv)
intel_encoder->type = INTEL_OUTPUT_TVOUT; intel_encoder->type = INTEL_OUTPUT_TVOUT;
intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER; intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER;
intel_encoder->port = PORT_NONE; 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->cloneable = 0;
intel_encoder->base.possible_crtcs = ((1 << 0) | (1 << 1));
intel_tv->type = DRM_MODE_CONNECTOR_Unknown; intel_tv->type = DRM_MODE_CONNECTOR_Unknown;
/* BIOS margin values */ /* BIOS margin values */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment