Commit 1e833f40 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: don't count cpu ports for fdi B/C lane sharing

This allows us to use all 4 fdi lanes on fdi B when the cpu eDP is
running on pipe C. Yay!

v2: Encapsulate test into a little helper function, as suggested by
Chris Wilson.
Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 1857e1da
...@@ -2369,6 +2369,11 @@ static void intel_fdi_normal_train(struct drm_crtc *crtc) ...@@ -2369,6 +2369,11 @@ static void intel_fdi_normal_train(struct drm_crtc *crtc)
FDI_FE_ERRC_ENABLE); FDI_FE_ERRC_ENABLE);
} }
static bool pipe_has_enabled_pch(struct intel_crtc *intel_crtc)
{
return intel_crtc->base.enabled && intel_crtc->config.has_pch_encoder;
}
static void ivb_modeset_global_resources(struct drm_device *dev) static void ivb_modeset_global_resources(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -2378,10 +2383,13 @@ static void ivb_modeset_global_resources(struct drm_device *dev) ...@@ -2378,10 +2383,13 @@ static void ivb_modeset_global_resources(struct drm_device *dev)
to_intel_crtc(dev_priv->pipe_to_crtc_mapping[PIPE_C]); to_intel_crtc(dev_priv->pipe_to_crtc_mapping[PIPE_C]);
uint32_t temp; uint32_t temp;
/* When everything is off disable fdi C so that we could enable fdi B /*
* with all lanes. XXX: This misses the case where a pipe is not using * When everything is off disable fdi C so that we could enable fdi B
* any pch resources and so doesn't need any fdi lanes. */ * with all lanes. Note that we don't care about enabled pipes without
if (!pipe_B_crtc->base.enabled && !pipe_C_crtc->base.enabled) { * an enabled pch encoder.
*/
if (!pipe_has_enabled_pch(pipe_B_crtc) &&
!pipe_has_enabled_pch(pipe_C_crtc)) {
WARN_ON(I915_READ(FDI_RX_CTL(PIPE_B)) & FDI_RX_ENABLE); WARN_ON(I915_READ(FDI_RX_CTL(PIPE_B)) & FDI_RX_ENABLE);
WARN_ON(I915_READ(FDI_RX_CTL(PIPE_C)) & FDI_RX_ENABLE); WARN_ON(I915_READ(FDI_RX_CTL(PIPE_C)) & FDI_RX_ENABLE);
...@@ -4015,7 +4023,7 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe, ...@@ -4015,7 +4023,7 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,
} }
return true; return true;
case PIPE_C: case PIPE_C:
if (!pipe_B_crtc->base.enabled || if (!pipe_has_enabled_pch(pipe_B_crtc) ||
pipe_B_crtc->config.fdi_lanes <= 2) { pipe_B_crtc->config.fdi_lanes <= 2) {
if (pipe_config->fdi_lanes > 2) { if (pipe_config->fdi_lanes > 2) {
DRM_DEBUG_KMS("invalid shared fdi lane config on pipe %c: %i lanes\n", DRM_DEBUG_KMS("invalid shared fdi lane config on pipe %c: %i lanes\n",
......
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