aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2011-01-05 13:31:48 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-19 07:38:11 -0500
commitf67a559daaa0e2ba616bfe9438f202bc57bc8c72 (patch)
tree197097fe78b5e356b5618f922e4ce9dbff2e5982 /drivers/gpu/drm/i915/intel_display.c
parent6f06ce184c765fd8d50669a8d12fdd566c920859 (diff)
drm/i915: skip FDI & PCH enabling for DP_A
eDP on the CPU doesn't need the PCH set up at all, it can in fact cause problems. So avoid FDI training and PCH PLL enabling in that case. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Tested-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c97
1 files changed, 60 insertions, 37 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2842dbe3ec0d..36f9e97f05c4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2611,49 +2611,21 @@ static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
2611 return true; 2611 return true;
2612} 2612}
2613 2613
2614static void ironlake_crtc_enable(struct drm_crtc *crtc) 2614/*
2615 * Enable PCH resources required for PCH ports:
2616 * - PCH PLLs
2617 * - FDI training & RX/TX
2618 * - update transcoder timings
2619 * - DP transcoding bits
2620 * - transcoder
2621 */
2622static void ironlake_pch_enable(struct drm_crtc *crtc)
2615{ 2623{
2616 struct drm_device *dev = crtc->dev; 2624 struct drm_device *dev = crtc->dev;
2617 struct drm_i915_private *dev_priv = dev->dev_private; 2625 struct drm_i915_private *dev_priv = dev->dev_private;
2618 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 2626 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
2619 int pipe = intel_crtc->pipe; 2627 int pipe = intel_crtc->pipe;
2620 int plane = intel_crtc->plane;
2621 u32 reg, temp; 2628 u32 reg, temp;
2622 bool is_pch_port;
2623
2624 if (intel_crtc->active)
2625 return;
2626
2627 intel_crtc->active = true;
2628 intel_update_watermarks(dev);
2629
2630 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
2631 temp = I915_READ(PCH_LVDS);
2632 if ((temp & LVDS_PORT_EN) == 0)
2633 I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN);
2634 }
2635
2636 ironlake_fdi_enable(crtc);
2637
2638 /* Enable panel fitting for LVDS */
2639 if (dev_priv->pch_pf_size &&
2640 (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) || HAS_eDP)) {
2641 /* Force use of hard-coded filter coefficients
2642 * as some pre-programmed values are broken,
2643 * e.g. x201.
2644 */
2645 I915_WRITE(pipe ? PFB_CTL_1 : PFA_CTL_1,
2646 PF_ENABLE | PF_FILTER_MED_3x3);
2647 I915_WRITE(pipe ? PFB_WIN_POS : PFA_WIN_POS,
2648 dev_priv->pch_pf_pos);
2649 I915_WRITE(pipe ? PFB_WIN_SZ : PFA_WIN_SZ,
2650 dev_priv->pch_pf_size);
2651 }
2652
2653 is_pch_port = intel_crtc_driving_pch(crtc);
2654
2655 intel_enable_pipe(dev_priv, pipe, is_pch_port);
2656 intel_enable_plane(dev_priv, plane, pipe);
2657 2629
2658 /* For PCH output, training FDI link */ 2630 /* For PCH output, training FDI link */
2659 if (IS_GEN6(dev)) 2631 if (IS_GEN6(dev))
@@ -2722,6 +2694,57 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
2722 } 2694 }
2723 2695
2724 intel_enable_transcoder(dev_priv, pipe); 2696 intel_enable_transcoder(dev_priv, pipe);
2697}
2698
2699static void ironlake_crtc_enable(struct drm_crtc *crtc)
2700{
2701 struct drm_device *dev = crtc->dev;
2702 struct drm_i915_private *dev_priv = dev->dev_private;
2703 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
2704 int pipe = intel_crtc->pipe;
2705 int plane = intel_crtc->plane;
2706 u32 temp;
2707 bool is_pch_port;
2708
2709 if (intel_crtc->active)
2710 return;
2711
2712 intel_crtc->active = true;
2713 intel_update_watermarks(dev);
2714
2715 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
2716 temp = I915_READ(PCH_LVDS);
2717 if ((temp & LVDS_PORT_EN) == 0)
2718 I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN);
2719 }
2720
2721 is_pch_port = intel_crtc_driving_pch(crtc);
2722
2723 if (is_pch_port)
2724 ironlake_fdi_enable(crtc);
2725 else
2726 ironlake_fdi_disable(crtc);
2727
2728 /* Enable panel fitting for LVDS */
2729 if (dev_priv->pch_pf_size &&
2730 (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) || HAS_eDP)) {
2731 /* Force use of hard-coded filter coefficients
2732 * as some pre-programmed values are broken,
2733 * e.g. x201.
2734 */
2735 I915_WRITE(pipe ? PFB_CTL_1 : PFA_CTL_1,
2736 PF_ENABLE | PF_FILTER_MED_3x3);
2737 I915_WRITE(pipe ? PFB_WIN_POS : PFA_WIN_POS,
2738 dev_priv->pch_pf_pos);
2739 I915_WRITE(pipe ? PFB_WIN_SZ : PFA_WIN_SZ,
2740 dev_priv->pch_pf_size);
2741 }
2742
2743 intel_enable_pipe(dev_priv, pipe, is_pch_port);
2744 intel_enable_plane(dev_priv, plane, pipe);
2745
2746 if (is_pch_port)
2747 ironlake_pch_enable(crtc);
2725 2748
2726 intel_crtc_load_lut(crtc); 2749 intel_crtc_load_lut(crtc);
2727 intel_update_fbc(dev); 2750 intel_update_fbc(dev);