aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b27202d23ebc..4b2458d8bf88 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -232,7 +232,7 @@ struct intel_limit {
232#define G4X_P2_DISPLAY_PORT_FAST 10 232#define G4X_P2_DISPLAY_PORT_FAST 10
233#define G4X_P2_DISPLAY_PORT_LIMIT 0 233#define G4X_P2_DISPLAY_PORT_LIMIT 0
234 234
235/* Ironlake */ 235/* Ironlake / Sandybridge */
236/* as we calculate clock using (register_value + 2) for 236/* as we calculate clock using (register_value + 2) for
237 N/M1/M2, so here the range value for them is (actual_value-2). 237 N/M1/M2, so here the range value for them is (actual_value-2).
238 */ 238 */
@@ -690,7 +690,7 @@ static const intel_limit_t *intel_limit(struct drm_crtc *crtc)
690 struct drm_device *dev = crtc->dev; 690 struct drm_device *dev = crtc->dev;
691 const intel_limit_t *limit; 691 const intel_limit_t *limit;
692 692
693 if (IS_IRONLAKE(dev)) 693 if (HAS_PCH_SPLIT(dev))
694 limit = intel_ironlake_limit(crtc); 694 limit = intel_ironlake_limit(crtc);
695 else if (IS_G4X(dev)) { 695 else if (IS_G4X(dev)) {
696 limit = intel_g4x_limit(crtc); 696 limit = intel_g4x_limit(crtc);
@@ -1366,7 +1366,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
1366 dspcntr &= ~DISPPLANE_TILED; 1366 dspcntr &= ~DISPPLANE_TILED;
1367 } 1367 }
1368 1368
1369 if (IS_IRONLAKE(dev)) 1369 if (HAS_PCH_SPLIT(dev))
1370 /* must disable */ 1370 /* must disable */
1371 dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE; 1371 dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE;
1372 1372
@@ -1427,7 +1427,7 @@ static void i915_disable_vga (struct drm_device *dev)
1427 u8 sr1; 1427 u8 sr1;
1428 u32 vga_reg; 1428 u32 vga_reg;
1429 1429
1430 if (IS_IRONLAKE(dev)) 1430 if (HAS_PCH_SPLIT(dev))
1431 vga_reg = CPU_VGACNTRL; 1431 vga_reg = CPU_VGACNTRL;
1432 else 1432 else
1433 vga_reg = VGACNTRL; 1433 vga_reg = VGACNTRL;
@@ -2111,7 +2111,7 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
2111 struct drm_display_mode *adjusted_mode) 2111 struct drm_display_mode *adjusted_mode)
2112{ 2112{
2113 struct drm_device *dev = crtc->dev; 2113 struct drm_device *dev = crtc->dev;
2114 if (IS_IRONLAKE(dev)) { 2114 if (HAS_PCH_SPLIT(dev)) {
2115 /* FDI link clock is fixed at 2.7G */ 2115 /* FDI link clock is fixed at 2.7G */
2116 if (mode->clock * 3 > 27000 * 4) 2116 if (mode->clock * 3 > 27000 * 4)
2117 return MODE_CLOCK_HIGH; 2117 return MODE_CLOCK_HIGH;
@@ -2967,7 +2967,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
2967 refclk / 1000); 2967 refclk / 1000);
2968 } else if (IS_I9XX(dev)) { 2968 } else if (IS_I9XX(dev)) {
2969 refclk = 96000; 2969 refclk = 96000;
2970 if (IS_IRONLAKE(dev)) 2970 if (HAS_PCH_SPLIT(dev))
2971 refclk = 120000; /* 120Mhz refclk */ 2971 refclk = 120000; /* 120Mhz refclk */
2972 } else { 2972 } else {
2973 refclk = 48000; 2973 refclk = 48000;
@@ -3025,7 +3025,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3025 } 3025 }
3026 3026
3027 /* FDI link */ 3027 /* FDI link */
3028 if (IS_IRONLAKE(dev)) { 3028 if (HAS_PCH_SPLIT(dev)) {
3029 int lane, link_bw, bpp; 3029 int lane, link_bw, bpp;
3030 /* eDP doesn't require FDI link, so just set DP M/N 3030 /* eDP doesn't require FDI link, so just set DP M/N
3031 according to current link config */ 3031 according to current link config */
@@ -3102,7 +3102,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3102 * PCH B stepping, previous chipset stepping should be 3102 * PCH B stepping, previous chipset stepping should be
3103 * ignoring this setting. 3103 * ignoring this setting.
3104 */ 3104 */
3105 if (IS_IRONLAKE(dev)) { 3105 if (HAS_PCH_SPLIT(dev)) {
3106 temp = I915_READ(PCH_DREF_CONTROL); 3106 temp = I915_READ(PCH_DREF_CONTROL);
3107 /* Always enable nonspread source */ 3107 /* Always enable nonspread source */
3108 temp &= ~DREF_NONSPREAD_SOURCE_MASK; 3108 temp &= ~DREF_NONSPREAD_SOURCE_MASK;
@@ -3149,7 +3149,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3149 reduced_clock.m2; 3149 reduced_clock.m2;
3150 } 3150 }
3151 3151
3152 if (!IS_IRONLAKE(dev)) 3152 if (!HAS_PCH_SPLIT(dev))
3153 dpll = DPLL_VGA_MODE_DIS; 3153 dpll = DPLL_VGA_MODE_DIS;
3154 3154
3155 if (IS_I9XX(dev)) { 3155 if (IS_I9XX(dev)) {
@@ -3162,7 +3162,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3162 sdvo_pixel_multiply = adjusted_mode->clock / mode->clock; 3162 sdvo_pixel_multiply = adjusted_mode->clock / mode->clock;
3163 if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) 3163 if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
3164 dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES; 3164 dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES;
3165 else if (IS_IRONLAKE(dev)) 3165 else if (HAS_PCH_SPLIT(dev))
3166 dpll |= (sdvo_pixel_multiply - 1) << PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT; 3166 dpll |= (sdvo_pixel_multiply - 1) << PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT;
3167 } 3167 }
3168 if (is_dp) 3168 if (is_dp)
@@ -3174,7 +3174,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3174 else { 3174 else {
3175 dpll |= (1 << (clock.p1 - 1)) << DPLL_FPA01_P1_POST_DIV_SHIFT; 3175 dpll |= (1 << (clock.p1 - 1)) << DPLL_FPA01_P1_POST_DIV_SHIFT;
3176 /* also FPA1 */ 3176 /* also FPA1 */
3177 if (IS_IRONLAKE(dev)) 3177 if (HAS_PCH_SPLIT(dev))
3178 dpll |= (1 << (clock.p1 - 1)) << DPLL_FPA1_P1_POST_DIV_SHIFT; 3178 dpll |= (1 << (clock.p1 - 1)) << DPLL_FPA1_P1_POST_DIV_SHIFT;
3179 if (IS_G4X(dev) && has_reduced_clock) 3179 if (IS_G4X(dev) && has_reduced_clock)
3180 dpll |= (1 << (reduced_clock.p1 - 1)) << DPLL_FPA1_P1_POST_DIV_SHIFT; 3180 dpll |= (1 << (reduced_clock.p1 - 1)) << DPLL_FPA1_P1_POST_DIV_SHIFT;
@@ -3193,7 +3193,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3193 dpll |= DPLLB_LVDS_P2_CLOCK_DIV_14; 3193 dpll |= DPLLB_LVDS_P2_CLOCK_DIV_14;
3194 break; 3194 break;
3195 } 3195 }
3196 if (IS_I965G(dev) && !IS_IRONLAKE(dev)) 3196 if (IS_I965G(dev) && !HAS_PCH_SPLIT(dev))
3197 dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT); 3197 dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT);
3198 } else { 3198 } else {
3199 if (is_lvds) { 3199 if (is_lvds) {
@@ -3227,7 +3227,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3227 3227
3228 /* Ironlake's plane is forced to pipe, bit 24 is to 3228 /* Ironlake's plane is forced to pipe, bit 24 is to
3229 enable color space conversion */ 3229 enable color space conversion */
3230 if (!IS_IRONLAKE(dev)) { 3230 if (!HAS_PCH_SPLIT(dev)) {
3231 if (pipe == 0) 3231 if (pipe == 0)
3232 dspcntr &= ~DISPPLANE_SEL_PIPE_MASK; 3232 dspcntr &= ~DISPPLANE_SEL_PIPE_MASK;
3233 else 3233 else
@@ -3254,14 +3254,14 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3254 3254
3255 3255
3256 /* Disable the panel fitter if it was on our pipe */ 3256 /* Disable the panel fitter if it was on our pipe */
3257 if (!IS_IRONLAKE(dev) && intel_panel_fitter_pipe(dev) == pipe) 3257 if (!HAS_PCH_SPLIT(dev) && intel_panel_fitter_pipe(dev) == pipe)
3258 I915_WRITE(PFIT_CONTROL, 0); 3258 I915_WRITE(PFIT_CONTROL, 0);
3259 3259
3260 DRM_DEBUG_KMS("Mode for pipe %c:\n", pipe == 0 ? 'A' : 'B'); 3260 DRM_DEBUG_KMS("Mode for pipe %c:\n", pipe == 0 ? 'A' : 'B');
3261 drm_mode_debug_printmodeline(mode); 3261 drm_mode_debug_printmodeline(mode);
3262 3262
3263 /* assign to Ironlake registers */ 3263 /* assign to Ironlake registers */
3264 if (IS_IRONLAKE(dev)) { 3264 if (HAS_PCH_SPLIT(dev)) {
3265 fp_reg = pch_fp_reg; 3265 fp_reg = pch_fp_reg;
3266 dpll_reg = pch_dpll_reg; 3266 dpll_reg = pch_dpll_reg;
3267 } 3267 }
@@ -3282,7 +3282,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3282 if (is_lvds) { 3282 if (is_lvds) {
3283 u32 lvds; 3283 u32 lvds;
3284 3284
3285 if (IS_IRONLAKE(dev)) 3285 if (HAS_PCH_SPLIT(dev))
3286 lvds_reg = PCH_LVDS; 3286 lvds_reg = PCH_LVDS;
3287 3287
3288 lvds = I915_READ(lvds_reg); 3288 lvds = I915_READ(lvds_reg);
@@ -3328,7 +3328,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3328 /* Wait for the clocks to stabilize. */ 3328 /* Wait for the clocks to stabilize. */
3329 udelay(150); 3329 udelay(150);
3330 3330
3331 if (IS_I965G(dev) && !IS_IRONLAKE(dev)) { 3331 if (IS_I965G(dev) && !HAS_PCH_SPLIT(dev)) {
3332 if (is_sdvo) { 3332 if (is_sdvo) {
3333 sdvo_pixel_multiply = adjusted_mode->clock / mode->clock; 3333 sdvo_pixel_multiply = adjusted_mode->clock / mode->clock;
3334 I915_WRITE(dpll_md_reg, (0 << DPLL_MD_UDI_DIVIDER_SHIFT) | 3334 I915_WRITE(dpll_md_reg, (0 << DPLL_MD_UDI_DIVIDER_SHIFT) |
@@ -3375,14 +3375,14 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3375 /* pipesrc and dspsize control the size that is scaled from, which should 3375 /* pipesrc and dspsize control the size that is scaled from, which should
3376 * always be the user's requested size. 3376 * always be the user's requested size.
3377 */ 3377 */
3378 if (!IS_IRONLAKE(dev)) { 3378 if (!HAS_PCH_SPLIT(dev)) {
3379 I915_WRITE(dspsize_reg, ((mode->vdisplay - 1) << 16) | 3379 I915_WRITE(dspsize_reg, ((mode->vdisplay - 1) << 16) |
3380 (mode->hdisplay - 1)); 3380 (mode->hdisplay - 1));
3381 I915_WRITE(dsppos_reg, 0); 3381 I915_WRITE(dsppos_reg, 0);
3382 } 3382 }
3383 I915_WRITE(pipesrc_reg, ((mode->hdisplay - 1) << 16) | (mode->vdisplay - 1)); 3383 I915_WRITE(pipesrc_reg, ((mode->hdisplay - 1) << 16) | (mode->vdisplay - 1));
3384 3384
3385 if (IS_IRONLAKE(dev)) { 3385 if (HAS_PCH_SPLIT(dev)) {
3386 I915_WRITE(data_m1_reg, TU_SIZE(m_n.tu) | m_n.gmch_m); 3386 I915_WRITE(data_m1_reg, TU_SIZE(m_n.tu) | m_n.gmch_m);
3387 I915_WRITE(data_n1_reg, TU_SIZE(m_n.tu) | m_n.gmch_n); 3387 I915_WRITE(data_n1_reg, TU_SIZE(m_n.tu) | m_n.gmch_n);
3388 I915_WRITE(link_m1_reg, m_n.link_m); 3388 I915_WRITE(link_m1_reg, m_n.link_m);
@@ -3403,7 +3403,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3403 3403
3404 intel_wait_for_vblank(dev); 3404 intel_wait_for_vblank(dev);
3405 3405
3406 if (IS_IRONLAKE(dev)) { 3406 if (HAS_PCH_SPLIT(dev)) {
3407 /* enable address swizzle for tiling buffer */ 3407 /* enable address swizzle for tiling buffer */
3408 temp = I915_READ(DISP_ARB_CTL); 3408 temp = I915_READ(DISP_ARB_CTL);
3409 I915_WRITE(DISP_ARB_CTL, temp | DISP_TILE_SURFACE_SWIZZLING); 3409 I915_WRITE(DISP_ARB_CTL, temp | DISP_TILE_SURFACE_SWIZZLING);
@@ -3438,7 +3438,7 @@ void intel_crtc_load_lut(struct drm_crtc *crtc)
3438 return; 3438 return;
3439 3439
3440 /* use legacy palette for Ironlake */ 3440 /* use legacy palette for Ironlake */
3441 if (IS_IRONLAKE(dev)) 3441 if (HAS_PCH_SPLIT(dev))
3442 palreg = (intel_crtc->pipe == 0) ? LGC_PALETTE_A : 3442 palreg = (intel_crtc->pipe == 0) ? LGC_PALETTE_A :
3443 LGC_PALETTE_B; 3443 LGC_PALETTE_B;
3444 3444
@@ -3922,7 +3922,7 @@ static void intel_increase_pllclock(struct drm_crtc *crtc, bool schedule)
3922 int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; 3922 int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
3923 int dpll = I915_READ(dpll_reg); 3923 int dpll = I915_READ(dpll_reg);
3924 3924
3925 if (IS_IRONLAKE(dev)) 3925 if (HAS_PCH_SPLIT(dev))
3926 return; 3926 return;
3927 3927
3928 if (!dev_priv->lvds_downclock_avail) 3928 if (!dev_priv->lvds_downclock_avail)
@@ -3961,7 +3961,7 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
3961 int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; 3961 int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
3962 int dpll = I915_READ(dpll_reg); 3962 int dpll = I915_READ(dpll_reg);
3963 3963
3964 if (IS_IRONLAKE(dev)) 3964 if (HAS_PCH_SPLIT(dev))
3965 return; 3965 return;
3966 3966
3967 if (!dev_priv->lvds_downclock_avail) 3967 if (!dev_priv->lvds_downclock_avail)
@@ -4382,7 +4382,7 @@ static void intel_setup_outputs(struct drm_device *dev)
4382 if (IS_MOBILE(dev) && !IS_I830(dev)) 4382 if (IS_MOBILE(dev) && !IS_I830(dev))
4383 intel_lvds_init(dev); 4383 intel_lvds_init(dev);
4384 4384
4385 if (IS_IRONLAKE(dev)) { 4385 if (HAS_PCH_SPLIT(dev)) {
4386 int found; 4386 int found;
4387 4387
4388 if (IS_MOBILE(dev) && (I915_READ(DP_A) & DP_DETECTED)) 4388 if (IS_MOBILE(dev) && (I915_READ(DP_A) & DP_DETECTED))
@@ -4451,7 +4451,7 @@ static void intel_setup_outputs(struct drm_device *dev)
4451 DRM_DEBUG_KMS("probing DP_D\n"); 4451 DRM_DEBUG_KMS("probing DP_D\n");
4452 intel_dp_init(dev, DP_D); 4452 intel_dp_init(dev, DP_D);
4453 } 4453 }
4454 } else if (IS_I8XX(dev)) 4454 } else if (IS_GEN2(dev))
4455 intel_dvo_init(dev); 4455 intel_dvo_init(dev);
4456 4456
4457 if (SUPPORTS_TV(dev)) 4457 if (SUPPORTS_TV(dev))
@@ -4599,7 +4599,7 @@ void intel_init_clock_gating(struct drm_device *dev)
4599 * Disable clock gating reported to work incorrectly according to the 4599 * Disable clock gating reported to work incorrectly according to the
4600 * specs, but enable as much else as we can. 4600 * specs, but enable as much else as we can.
4601 */ 4601 */
4602 if (IS_IRONLAKE(dev)) { 4602 if (HAS_PCH_SPLIT(dev)) {
4603 return; 4603 return;
4604 } else if (IS_G4X(dev)) { 4604 } else if (IS_G4X(dev)) {
4605 uint32_t dspclk_gate; 4605 uint32_t dspclk_gate;
@@ -4672,7 +4672,7 @@ static void intel_init_display(struct drm_device *dev)
4672 struct drm_i915_private *dev_priv = dev->dev_private; 4672 struct drm_i915_private *dev_priv = dev->dev_private;
4673 4673
4674 /* We always want a DPMS function */ 4674 /* We always want a DPMS function */
4675 if (IS_IRONLAKE(dev)) 4675 if (HAS_PCH_SPLIT(dev))
4676 dev_priv->display.dpms = ironlake_crtc_dpms; 4676 dev_priv->display.dpms = ironlake_crtc_dpms;
4677 else 4677 else
4678 dev_priv->display.dpms = i9xx_crtc_dpms; 4678 dev_priv->display.dpms = i9xx_crtc_dpms;
@@ -4715,7 +4715,7 @@ static void intel_init_display(struct drm_device *dev)
4715 i830_get_display_clock_speed; 4715 i830_get_display_clock_speed;
4716 4716
4717 /* For FIFO watermark updates */ 4717 /* For FIFO watermark updates */
4718 if (IS_IRONLAKE(dev)) 4718 if (HAS_PCH_SPLIT(dev))
4719 dev_priv->display.update_wm = NULL; 4719 dev_priv->display.update_wm = NULL;
4720 else if (IS_G4X(dev)) 4720 else if (IS_G4X(dev))
4721 dev_priv->display.update_wm = g4x_update_wm; 4721 dev_priv->display.update_wm = g4x_update_wm;