]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: Split up ironlake_check_fdi_lanes
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Apr 2013 09:24:44 +0000 (11:24 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 29 Apr 2013 19:51:15 +0000 (21:51 +0200)
Again in preparation to move the configuration checks into the
pipe_config computation stage of the modeset sequence.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index a7674c313e031d1fa0dcc0aaf62e66398f03972e..1a3fdba4e74db12781a665f7c2f32c129c0d8f75 100644 (file)
@@ -5459,11 +5459,6 @@ static bool ironlake_check_fdi_lanes(struct intel_crtc *intel_crtc)
                        return false;
                }
 
-               if (intel_crtc->config.fdi_lanes > 2)
-                       WARN_ON(I915_READ(SOUTH_CHICKEN1) & FDI_BC_BIFURCATION_SELECT);
-               else
-                       cpt_enable_fdi_bc_bifurcation(dev);
-
                return true;
        case PIPE_C:
                if (!pipe_B_crtc->base.enabled || pipe_B_crtc->config.fdi_lanes <= 2) {
@@ -5480,9 +5475,31 @@ static bool ironlake_check_fdi_lanes(struct intel_crtc *intel_crtc)
                        return false;
                }
 
+               return true;
+       default:
+               BUG();
+       }
+}
+
+static void ivybridge_update_fdi_bc_bifurcation(struct intel_crtc *intel_crtc)
+{
+       struct drm_device *dev = intel_crtc->base.dev;
+       struct drm_i915_private *dev_priv = dev->dev_private;
+
+       switch (intel_crtc->pipe) {
+       case PIPE_A:
+               break;
+       case PIPE_B:
+               if (intel_crtc->config.fdi_lanes > 2)
+                       WARN_ON(I915_READ(SOUTH_CHICKEN1) & FDI_BC_BIFURCATION_SELECT);
+               else
+                       cpt_enable_fdi_bc_bifurcation(dev);
+
+               break;
+       case PIPE_C:
                cpt_enable_fdi_bc_bifurcation(dev);
 
-               return true;
+               break;
        default:
                BUG();
        }
@@ -5756,6 +5773,8 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
        }
 
        fdi_config_ok = ironlake_check_fdi_lanes(intel_crtc);
+       if (IS_IVYBRIDGE(dev))
+               ivybridge_update_fdi_bc_bifurcation(intel_crtc);
 
        ironlake_set_pipeconf(crtc);