aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-03-11 12:52:31 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-17 17:30:28 -0400
commitd272ddfa30b088870a925decba3c4a7f1a45badc (patch)
treec43f6f855b1e1b21e88eea97615f05d7f4d3924b
parent251cc67c7a28c216c9d4377ff5bf435c4248679e (diff)
drm/i915: Rewrite IVB FDI bifurcation conflict checks
Ignore the current state of the pipe and just check crtc_state->enable and the number of FDI lanes required. This means we don't accidentally mistake the FDI lanes as being available of one of the pipes just happens to be disabled at the time of the check. Also we no longer consider pipe C to require FDI lanes when it's driving the eDP transcoder. We also take the opportunity to make the code a bit nicer looking by hiding the ugly bits in the new pipe_required_fdi_lanes() function. Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b7de04c96f88..8d1925404383 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3141,12 +3141,6 @@ static void intel_fdi_normal_train(struct drm_crtc *crtc)
3141 FDI_FE_ERRC_ENABLE); 3141 FDI_FE_ERRC_ENABLE);
3142} 3142}
3143 3143
3144static bool pipe_has_enabled_pch(struct intel_crtc *crtc)
3145{
3146 return crtc->base.state->enable && crtc->active &&
3147 crtc->config->has_pch_encoder;
3148}
3149
3150/* The FDI link training functions for ILK/Ibexpeak. */ 3144/* The FDI link training functions for ILK/Ibexpeak. */
3151static void ironlake_fdi_link_train(struct drm_crtc *crtc) 3145static void ironlake_fdi_link_train(struct drm_crtc *crtc)
3152{ 3146{
@@ -5539,13 +5533,21 @@ bool intel_connector_get_hw_state(struct intel_connector *connector)
5539 return encoder->get_hw_state(encoder, &pipe); 5533 return encoder->get_hw_state(encoder, &pipe);
5540} 5534}
5541 5535
5536static int pipe_required_fdi_lanes(struct drm_device *dev, enum pipe pipe)
5537{
5538 struct intel_crtc *crtc =
5539 to_intel_crtc(intel_get_crtc_for_pipe(dev, pipe));
5540
5541 if (crtc->base.state->enable &&
5542 crtc->config->has_pch_encoder)
5543 return crtc->config->fdi_lanes;
5544
5545 return 0;
5546}
5547
5542static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe, 5548static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,
5543 struct intel_crtc_state *pipe_config) 5549 struct intel_crtc_state *pipe_config)
5544{ 5550{
5545 struct drm_i915_private *dev_priv = dev->dev_private;
5546 struct intel_crtc *pipe_B_crtc =
5547 to_intel_crtc(dev_priv->pipe_to_crtc_mapping[PIPE_B]);
5548
5549 DRM_DEBUG_KMS("checking fdi config on pipe %c, lanes %i\n", 5551 DRM_DEBUG_KMS("checking fdi config on pipe %c, lanes %i\n",
5550 pipe_name(pipe), pipe_config->fdi_lanes); 5552 pipe_name(pipe), pipe_config->fdi_lanes);
5551 if (pipe_config->fdi_lanes > 4) { 5553 if (pipe_config->fdi_lanes > 4) {
@@ -5572,8 +5574,8 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,
5572 case PIPE_A: 5574 case PIPE_A:
5573 return true; 5575 return true;
5574 case PIPE_B: 5576 case PIPE_B:
5575 if (dev_priv->pipe_to_crtc_mapping[PIPE_C]->enabled && 5577 if (pipe_config->fdi_lanes > 2 &&
5576 pipe_config->fdi_lanes > 2) { 5578 pipe_required_fdi_lanes(dev, PIPE_C) > 0) {
5577 DRM_DEBUG_KMS("invalid shared fdi lane config on pipe %c: %i lanes\n", 5579 DRM_DEBUG_KMS("invalid shared fdi lane config on pipe %c: %i lanes\n",
5578 pipe_name(pipe), pipe_config->fdi_lanes); 5580 pipe_name(pipe), pipe_config->fdi_lanes);
5579 return false; 5581 return false;
@@ -5585,8 +5587,7 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,
5585 pipe_name(pipe), pipe_config->fdi_lanes); 5587 pipe_name(pipe), pipe_config->fdi_lanes);
5586 return false; 5588 return false;
5587 } 5589 }
5588 if (pipe_has_enabled_pch(pipe_B_crtc) && 5590 if (pipe_required_fdi_lanes(dev, PIPE_B) > 2) {
5589 pipe_B_crtc->config->fdi_lanes > 2) {
5590 DRM_DEBUG_KMS("fdi link B uses too many lanes to enable link C\n"); 5591 DRM_DEBUG_KMS("fdi link B uses too many lanes to enable link C\n");
5591 return false; 5592 return false;
5592 } 5593 }