drm/i915: move border color writes to pfit_enable
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 25 Apr 2013 20:52:18 +0000 (22:52 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 30 Apr 2013 14:16:47 +0000 (16:16 +0200)
Writing hw registers from compute_config?
Just say no!

In this case not too horrible since we write a constant 0, and only
debugging would put something else in there. But while checking that
code I've noticed that this register disappeared on pch platforms, so
fix that up, too.

And adjust the comment a bit, it's outdated.

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

index 9b0d6b03aa1c5eb46ed0a9027106bfdc00a4f2c1..650433790813883858e7ca8ad8d946dc7cbbae65 100644 (file)
@@ -3632,6 +3632,10 @@ static void i9xx_pfit_enable(struct intel_crtc *crtc)
 
        I915_WRITE(PFIT_PGM_RATIOS, pipe_config->gmch_pfit.pgm_ratios);
        I915_WRITE(PFIT_CONTROL, pipe_config->gmch_pfit.control);
+
+       /* Border color in case we don't scale up to the full screen. Black by
+        * default, change to something else for debugging. */
+       I915_WRITE(BCLRPAT(crtc->pipe), 0);
 }
 
 static void valleyview_crtc_enable(struct drm_crtc *crtc)
index 47f47ea64f59462f5ea902516fcbc00b09c1c773..d256fe454a9d37962fe132ff857ee4037efa0768 100644 (file)
@@ -231,7 +231,6 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder,
        struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;
        struct intel_crtc *intel_crtc = lvds_encoder->base.new_crtc;
        unsigned int lvds_bpp;
-       int pipe;
 
        /* Should never happen!! */
        if (INTEL_INFO(dev)->gen < 4 && intel_crtc->pipe == 0) {
@@ -274,15 +273,6 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder,
                                         intel_connector->panel.fitting_mode);
        }
 
-       /*
-        * Enable automatic panel scaling for non-native modes so that they fill
-        * the screen.  Should be enabled before the pipe is enabled, according
-        * to register description and PRM.
-        * Change the value here to see the borders for debugging
-        */
-       for_each_pipe(pipe)
-               I915_WRITE(BCLRPAT(pipe), 0);
-
        drm_mode_set_crtcinfo(adjusted_mode, 0);
        pipe_config->timings_set = true;