]> Pileus Git - ~andy/linux/commitdiff
drm/i915: Fix pipe config warnings when dealing with LVDS fixed mode
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 2 Sep 2013 18:13:39 +0000 (21:13 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 3 Sep 2013 17:18:00 +0000 (19:18 +0200)
intel_fixed_panel_mode() overwrote the adjusted_mode with the fixed mode
only partially. Notably it forgot to copy over the sync flags. The LVDS code however programmed the hardware with the sync flags from fixed mode, and then later the pipe config comparison obviously failed as we
filled out the adjusted_mode in get_config from the real registers.

Just call drm_mode_copy() in intel_fixed_panel_mode() to copy over the
whole thing, and then just use adjusted_mode in the LVDS code to figure
out which sync settings the hardware needs.

Also constify the fixed_mode argument to intel_fixed_panel_mode().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_panel.c

index 176080822a74d1e76d099615cb218c9a93736300..dbfe5f7bb3defa2573373151131940b7f80ba6bc 100644 (file)
@@ -551,7 +551,7 @@ extern int intel_panel_init(struct intel_panel *panel,
                            struct drm_display_mode *fixed_mode);
 extern void intel_panel_fini(struct intel_panel *panel);
 
-extern void intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
+extern void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode,
                                   struct drm_display_mode *adjusted_mode);
 extern void intel_pch_panel_fitting(struct intel_crtc *crtc,
                                    struct intel_crtc_config *pipe_config,
index 4d33278e31fb805dae4430a5ab493f801a1c6ced..831a5c021c4bdefd2495ca0736d8fcb3f78ff57d 100644 (file)
@@ -128,8 +128,8 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder)
        struct drm_device *dev = encoder->base.dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
-       struct drm_display_mode *fixed_mode =
-               lvds_encoder->attached_connector->base.panel.fixed_mode;
+       const struct drm_display_mode *adjusted_mode =
+               &crtc->config.adjusted_mode;
        int pipe = crtc->pipe;
        u32 temp;
 
@@ -183,9 +183,9 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder)
                        temp &= ~LVDS_ENABLE_DITHER;
        }
        temp &= ~(LVDS_HSYNC_POLARITY | LVDS_VSYNC_POLARITY);
-       if (fixed_mode->flags & DRM_MODE_FLAG_NHSYNC)
+       if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC)
                temp |= LVDS_HSYNC_POLARITY;
-       if (fixed_mode->flags & DRM_MODE_FLAG_NVSYNC)
+       if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)
                temp |= LVDS_VSYNC_POLARITY;
 
        I915_WRITE(lvds_encoder->reg, temp);
index 913cb9d7fd32c9fed539c44f3913178e0e3a4687..42114ecbae0e3c4c8dc51b7b02a1f658de857873 100644 (file)
 #define PCI_LBPC 0xf4 /* legacy/combination backlight modes */
 
 void
-intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
+intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode,
                       struct drm_display_mode *adjusted_mode)
 {
-       adjusted_mode->hdisplay = fixed_mode->hdisplay;
-       adjusted_mode->hsync_start = fixed_mode->hsync_start;
-       adjusted_mode->hsync_end = fixed_mode->hsync_end;
-       adjusted_mode->htotal = fixed_mode->htotal;
-
-       adjusted_mode->vdisplay = fixed_mode->vdisplay;
-       adjusted_mode->vsync_start = fixed_mode->vsync_start;
-       adjusted_mode->vsync_end = fixed_mode->vsync_end;
-       adjusted_mode->vtotal = fixed_mode->vtotal;
-
-       adjusted_mode->clock = fixed_mode->clock;
+       drm_mode_copy(adjusted_mode, fixed_mode);
 
        drm_mode_set_crtcinfo(adjusted_mode, 0);
 }