drm/i915: move lvds_border_bits to pipe_config
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 25 Apr 2013 20:52:16 +0000 (22:52 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 30 Apr 2013 14:16:14 +0000 (16:16 +0200)
pipe_config is the new dev_priv!

More seriously, this is actually better since a pipe_config can be
thrown away if the modeset compute config stage fails. Whereas any
state stored in dev_prive needs to be painstakingly restored, since
otherwise a dpms off/on will wreak massive havoc. Yes, that even
applies to state only used in ->mode_set callbacks, since we need to
call those even for dpms on when the Haswell power well cleared
everything out.

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_panel.c

index c34103d42c112ba4efad21caf30b55cd82c48dd9..8890b0ba66c3aaada3f7b56b954e2777698084b2 100644 (file)
@@ -1019,8 +1019,6 @@ typedef struct drm_i915_private {
        /* Kernel Modesetting */
 
        struct sdvo_device_mapping sdvo_mappings[2];
-       /* indicate whether the LVDS_BORDER should be enabled or not */
-       unsigned int lvds_border_bits;
 
        struct drm_crtc *plane_to_crtc_mapping[3];
        struct drm_crtc *pipe_to_crtc_mapping[3];
index 766afcf39ee9679f1e88143d62a2a38f4928da8e..dfcf546790bc36dfb07dfd4b4ac18d3d021b3905 100644 (file)
@@ -249,6 +249,7 @@ struct intel_crtc_config {
        struct {
                u32 control;
                u32 pgm_ratios;
+               u32 lvds_border_bits;
        } gmch_pfit;
 
        /* Panel fitter placement and size for Ironlake+ */
index 8d65baf043eaccfd62312873aff6d845fa2a2254..47f47ea64f59462f5ea902516fcbc00b09c1c773 100644 (file)
@@ -116,7 +116,7 @@ static void intel_pre_pll_enable_lvds(struct intel_encoder *encoder)
        }
 
        /* set the corresponsding LVDS_BORDER bit */
-       temp |= dev_priv->lvds_border_bits;
+       temp |= intel_crtc->config.gmch_pfit.lvds_border_bits;
        /* Set the B0-B3 data pairs corresponding to whether we're going to
         * set the DPLLs for dual-channel mode or not.
         */
index 2526326efd818c7e85bf2b02243b315bcc68cd6b..4bf1e18f74ccdfb779eab0ab4163594371805f27 100644 (file)
@@ -183,7 +183,6 @@ void intel_gmch_panel_fitting(struct intel_crtc *intel_crtc,
                              int fitting_mode)
 {
        struct drm_device *dev = intel_crtc->base.dev;
-       struct drm_i915_private *dev_priv = dev->dev_private;
        u32 pfit_control = 0, pfit_pgm_ratios = 0, border = 0;
        struct drm_display_mode *mode, *adjusted_mode;
 
@@ -312,7 +311,7 @@ out:
                pipe_config->gmch_pfit.control = pfit_control;
                pipe_config->gmch_pfit.pgm_ratios = pfit_pgm_ratios;
        }
-       dev_priv->lvds_border_bits = border;
+       pipe_config->gmch_pfit.lvds_border_bits = border;
 }
 
 static int is_backlight_combination_mode(struct drm_device *dev)