From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH 14/15] drm/i915: don't count cpu ports for fdi B/C lane sharing Date: Mon, 29 Apr 2013 16:00:38 +0300 Message-ID: <1367240438.6390.58.camel@intelbox> References: <1366363487-15926-1-git-send-email-daniel.vetter@ffwll.ch> <1366363487-15926-15-git-send-email-daniel.vetter@ffwll.ch> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id E991FE6073 for ; Mon, 29 Apr 2013 06:00:41 -0700 (PDT) In-Reply-To: <1366363487-15926-15-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Daniel Vetter Cc: Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Fri, 2013-04-19 at 11:24 +0200, Daniel Vetter wrote: > 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. > > Signed-off-by: Daniel Vetter Reviewed-by: Imre Deak > --- > drivers/gpu/drm/i915/intel_display.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 6bcb196..c25dbdd 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -2381,6 +2381,11 @@ static void intel_fdi_normal_train(struct drm_crtc *crtc) > 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) > { > struct drm_i915_private *dev_priv = dev->dev_private; > @@ -2390,10 +2395,13 @@ static void ivb_modeset_global_resources(struct drm_device *dev) > to_intel_crtc(dev_priv->pipe_to_crtc_mapping[PIPE_C]); > 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 > - * any pch resources and so doesn't need any fdi lanes. */ > - if (!pipe_B_crtc->base.enabled && !pipe_C_crtc->base.enabled) { > + /* > + * When everything is off disable fdi C so that we could enable fdi B > + * with all lanes. Note that we don't care about enabled pipes without > + * 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_C)) & FDI_RX_ENABLE); > > @@ -3996,7 +4004,7 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe, > } > return true; > case PIPE_C: > - if (!pipe_B_crtc->base.enabled || > + if (!pipe_has_enabled_pch(pipe_B_crtc) || > pipe_B_crtc->config.fdi_lanes <= 2) { > if (pipe_config->fdi_lanes > 2) { > DRM_DEBUG_KMS("invalid shared fdi lane config on pipe %i: %i lanes\n",