]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/i915: Rewrite some some of the FDI lane checks
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 11 Mar 2015 16:52:30 +0000 (18:52 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 17 Mar 2015 21:30:28 +0000 (22:30 +0100)
The logic in the FDI lane checks is very hard for my poor brain to
grasp. Rewrite it in a more straightforward way.

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>
drivers/gpu/drm/i915/intel_display.c

index 7580d3fe845a0386738da318e46122adf874e0a8..b7de04c96f889f71d2967990d78452f20a0bd60e 100644 (file)
@@ -5580,14 +5580,13 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,
                }
                return true;
        case PIPE_C:
-               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 %c: %i lanes\n",
-                                             pipe_name(pipe), pipe_config->fdi_lanes);
-                               return false;
-                       }
-               } else {
+               if (pipe_config->fdi_lanes > 2) {
+                       DRM_DEBUG_KMS("only 2 lanes on pipe %c: required %i lanes\n",
+                                     pipe_name(pipe), pipe_config->fdi_lanes);
+                       return false;
+               }
+               if (pipe_has_enabled_pch(pipe_B_crtc) &&
+                   pipe_B_crtc->config->fdi_lanes > 2) {
                        DRM_DEBUG_KMS("fdi link B uses too many lanes to enable link C\n");
                        return false;
                }