aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-16 19:32:17 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-21 06:19:45 -0400
commita6c45cf013a57e32ddae43dd4ac911eb4a3919fd (patch)
tree21ce3ea9dcbeb815c92eb0a17377e5061b33151c /drivers/gpu/drm/i915/intel_display.c
parent219adae138513bae20b256f1946b9cb3b75ca05c (diff)
drm/i915: INTEL_INFO->gen supercedes i8xx, i9xx, i965g
Avoid confusion between i965g meaning broadwater and the gen4+ chipset families. 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.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1b5d878be975..c3f0400963de 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -708,16 +708,16 @@ static const intel_limit_t *intel_limit(struct drm_crtc *crtc)
708 limit = intel_ironlake_limit(crtc); 708 limit = intel_ironlake_limit(crtc);
709 else if (IS_G4X(dev)) { 709 else if (IS_G4X(dev)) {
710 limit = intel_g4x_limit(crtc); 710 limit = intel_g4x_limit(crtc);
711 } else if (IS_I9XX(dev) && !IS_PINEVIEW(dev)) {
712 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS))
713 limit = &intel_limits_i9xx_lvds;
714 else
715 limit = &intel_limits_i9xx_sdvo;
716 } else if (IS_PINEVIEW(dev)) { 711 } else if (IS_PINEVIEW(dev)) {
717 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) 712 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS))
718 limit = &intel_limits_pineview_lvds; 713 limit = &intel_limits_pineview_lvds;
719 else 714 else
720 limit = &intel_limits_pineview_sdvo; 715 limit = &intel_limits_pineview_sdvo;
716 } else if (!IS_GEN2(dev)) {
717 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS))
718 limit = &intel_limits_i9xx_lvds;
719 else
720 limit = &intel_limits_i9xx_sdvo;
721 } else { 721 } else {
722 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) 722 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS))
723 limit = &intel_limits_i8xx_lvds; 723 limit = &intel_limits_i8xx_lvds;
@@ -1429,7 +1429,7 @@ intel_pin_and_fence_fb_obj(struct drm_device *dev,
1429 case I915_TILING_NONE: 1429 case I915_TILING_NONE:
1430 if (IS_BROADWATER(dev) || IS_CRESTLINE(dev)) 1430 if (IS_BROADWATER(dev) || IS_CRESTLINE(dev))
1431 alignment = 128 * 1024; 1431 alignment = 128 * 1024;
1432 else if (IS_I965G(dev)) 1432 else if (INTEL_INFO(dev)->gen >= 4)
1433 alignment = 4 * 1024; 1433 alignment = 4 * 1024;
1434 else 1434 else
1435 alignment = 64 * 1024; 1435 alignment = 64 * 1024;
@@ -1524,7 +1524,7 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
1524 DRM_ERROR("Unknown color depth\n"); 1524 DRM_ERROR("Unknown color depth\n");
1525 return -EINVAL; 1525 return -EINVAL;
1526 } 1526 }
1527 if (IS_I965G(dev)) { 1527 if (INTEL_INFO(dev)->gen >= 4) {
1528 if (obj_priv->tiling_mode != I915_TILING_NONE) 1528 if (obj_priv->tiling_mode != I915_TILING_NONE)
1529 dspcntr |= DISPPLANE_TILED; 1529 dspcntr |= DISPPLANE_TILED;
1530 else 1530 else
@@ -1543,7 +1543,7 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
1543 DRM_DEBUG_KMS("Writing base %08lX %08lX %d %d %d\n", 1543 DRM_DEBUG_KMS("Writing base %08lX %08lX %d %d %d\n",
1544 Start, Offset, x, y, fb->pitch); 1544 Start, Offset, x, y, fb->pitch);
1545 I915_WRITE(DSPSTRIDE(plane), fb->pitch); 1545 I915_WRITE(DSPSTRIDE(plane), fb->pitch);
1546 if (IS_I965G(dev)) { 1546 if (INTEL_INFO(dev)->gen >= 4) {
1547 I915_WRITE(DSPSURF(plane), Start); 1547 I915_WRITE(DSPSURF(plane), Start);
1548 I915_WRITE(DSPTILEOFF(plane), (y << 16) | x); 1548 I915_WRITE(DSPTILEOFF(plane), (y << 16) | x);
1549 I915_WRITE(DSPADDR(plane), Offset); 1549 I915_WRITE(DSPADDR(plane), Offset);
@@ -2388,7 +2388,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
2388 intel_flush_display_plane(dev, plane); 2388 intel_flush_display_plane(dev, plane);
2389 2389
2390 /* Wait for vblank for the disable to take effect */ 2390 /* Wait for vblank for the disable to take effect */
2391 if (!IS_I9XX(dev)) 2391 if (IS_GEN2(dev))
2392 intel_wait_for_vblank_off(dev, pipe); 2392 intel_wait_for_vblank_off(dev, pipe);
2393 } 2393 }
2394 2394
@@ -3181,11 +3181,11 @@ static void i965_update_wm(struct drm_device *dev, int planea_clock,
3181 DRM_DEBUG_KMS("self-refresh watermark: display plane %d " 3181 DRM_DEBUG_KMS("self-refresh watermark: display plane %d "
3182 "cursor %d\n", srwm, cursor_sr); 3182 "cursor %d\n", srwm, cursor_sr);
3183 3183
3184 if (IS_I965GM(dev)) 3184 if (IS_CRESTLINE(dev))
3185 I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN); 3185 I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN);
3186 } else { 3186 } else {
3187 /* Turn off self refresh if both pipes are enabled */ 3187 /* Turn off self refresh if both pipes are enabled */
3188 if (IS_I965GM(dev)) 3188 if (IS_CRESTLINE(dev))
3189 I915_WRITE(FW_BLC_SELF, I915_READ(FW_BLC_SELF) 3189 I915_WRITE(FW_BLC_SELF, I915_READ(FW_BLC_SELF)
3190 & ~FW_BLC_SELF_EN); 3190 & ~FW_BLC_SELF_EN);
3191 } 3191 }
@@ -3215,9 +3215,9 @@ static void i9xx_update_wm(struct drm_device *dev, int planea_clock,
3215 int sr_clock, sr_entries = 0; 3215 int sr_clock, sr_entries = 0;
3216 3216
3217 /* Create copies of the base settings for each pipe */ 3217 /* Create copies of the base settings for each pipe */
3218 if (IS_I965GM(dev) || IS_I945GM(dev)) 3218 if (IS_CRESTLINE(dev) || IS_I945GM(dev))
3219 planea_params = planeb_params = i945_wm_info; 3219 planea_params = planeb_params = i945_wm_info;
3220 else if (IS_I9XX(dev)) 3220 else if (!IS_GEN2(dev))
3221 planea_params = planeb_params = i915_wm_info; 3221 planea_params = planeb_params = i915_wm_info;
3222 else 3222 else
3223 planea_params = planeb_params = i855_wm_info; 3223 planea_params = planeb_params = i855_wm_info;
@@ -3576,7 +3576,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3576 refclk = dev_priv->lvds_ssc_freq * 1000; 3576 refclk = dev_priv->lvds_ssc_freq * 1000;
3577 DRM_DEBUG_KMS("using SSC reference clock of %d MHz\n", 3577 DRM_DEBUG_KMS("using SSC reference clock of %d MHz\n",
3578 refclk / 1000); 3578 refclk / 1000);
3579 } else if (IS_I9XX(dev)) { 3579 } else if (!IS_GEN2(dev)) {
3580 refclk = 96000; 3580 refclk = 96000;
3581 if (HAS_PCH_SPLIT(dev)) 3581 if (HAS_PCH_SPLIT(dev))
3582 refclk = 120000; /* 120Mhz refclk */ 3582 refclk = 120000; /* 120Mhz refclk */
@@ -3775,7 +3775,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3775 if (!HAS_PCH_SPLIT(dev)) 3775 if (!HAS_PCH_SPLIT(dev))
3776 dpll = DPLL_VGA_MODE_DIS; 3776 dpll = DPLL_VGA_MODE_DIS;
3777 3777
3778 if (IS_I9XX(dev)) { 3778 if (!IS_GEN2(dev)) {
3779 if (is_lvds) 3779 if (is_lvds)
3780 dpll |= DPLLB_MODE_LVDS; 3780 dpll |= DPLLB_MODE_LVDS;
3781 else 3781 else
@@ -3818,7 +3818,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3818 dpll |= DPLLB_LVDS_P2_CLOCK_DIV_14; 3818 dpll |= DPLLB_LVDS_P2_CLOCK_DIV_14;
3819 break; 3819 break;
3820 } 3820 }
3821 if (IS_I965G(dev) && !HAS_PCH_SPLIT(dev)) 3821 if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev))
3822 dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT); 3822 dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT);
3823 } else { 3823 } else {
3824 if (is_lvds) { 3824 if (is_lvds) {
@@ -3859,7 +3859,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3859 dspcntr |= DISPPLANE_SEL_PIPE_B; 3859 dspcntr |= DISPPLANE_SEL_PIPE_B;
3860 } 3860 }
3861 3861
3862 if (pipe == 0 && !IS_I965G(dev)) { 3862 if (pipe == 0 && INTEL_INFO(dev)->gen < 4) {
3863 /* Enable pixel doubling when the dot clock is > 90% of the (display) 3863 /* Enable pixel doubling when the dot clock is > 90% of the (display)
3864 * core speed. 3864 * core speed.
3865 * 3865 *
@@ -3947,7 +3947,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3947 * panels behave in the two modes. 3947 * panels behave in the two modes.
3948 */ 3948 */
3949 /* set the dithering flag on non-PCH LVDS as needed */ 3949 /* set the dithering flag on non-PCH LVDS as needed */
3950 if (IS_I965G(dev) && !HAS_PCH_SPLIT(dev)) { 3950 if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev)) {
3951 if (dev_priv->lvds_dither) 3951 if (dev_priv->lvds_dither)
3952 temp |= LVDS_ENABLE_DITHER; 3952 temp |= LVDS_ENABLE_DITHER;
3953 else 3953 else
@@ -3991,7 +3991,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3991 POSTING_READ(dpll_reg); 3991 POSTING_READ(dpll_reg);
3992 udelay(150); 3992 udelay(150);
3993 3993
3994 if (IS_I965G(dev) && !HAS_PCH_SPLIT(dev)) { 3994 if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev)) {
3995 temp = 0; 3995 temp = 0;
3996 if (is_sdvo) { 3996 if (is_sdvo) {
3997 temp = intel_mode_get_pixel_multiplier(adjusted_mode); 3997 temp = intel_mode_get_pixel_multiplier(adjusted_mode);
@@ -4334,7 +4334,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
4334 addr = obj_priv->phys_obj->handle->busaddr; 4334 addr = obj_priv->phys_obj->handle->busaddr;
4335 } 4335 }
4336 4336
4337 if (!IS_I9XX(dev)) 4337 if (IS_GEN2(dev))
4338 I915_WRITE(CURSIZE, (height << 12) | width); 4338 I915_WRITE(CURSIZE, (height << 12) | width);
4339 4339
4340 finish: 4340 finish:
@@ -4569,7 +4569,7 @@ static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc)
4569 clock.m2 = (fp & FP_M2_DIV_MASK) >> FP_M2_DIV_SHIFT; 4569 clock.m2 = (fp & FP_M2_DIV_MASK) >> FP_M2_DIV_SHIFT;
4570 } 4570 }
4571 4571
4572 if (IS_I9XX(dev)) { 4572 if (!IS_GEN2(dev)) {
4573 if (IS_PINEVIEW(dev)) 4573 if (IS_PINEVIEW(dev))
4574 clock.p1 = ffs((dpll & DPLL_FPA01_P1_POST_DIV_MASK_PINEVIEW) >> 4574 clock.p1 = ffs((dpll & DPLL_FPA01_P1_POST_DIV_MASK_PINEVIEW) >>
4575 DPLL_FPA01_P1_POST_DIV_SHIFT_PINEVIEW); 4575 DPLL_FPA01_P1_POST_DIV_SHIFT_PINEVIEW);
@@ -5768,20 +5768,20 @@ void intel_init_clock_gating(struct drm_device *dev)
5768 if (IS_GM45(dev)) 5768 if (IS_GM45(dev))
5769 dspclk_gate |= DSSUNIT_CLOCK_GATE_DISABLE; 5769 dspclk_gate |= DSSUNIT_CLOCK_GATE_DISABLE;
5770 I915_WRITE(DSPCLK_GATE_D, dspclk_gate); 5770 I915_WRITE(DSPCLK_GATE_D, dspclk_gate);
5771 } else if (IS_I965GM(dev)) { 5771 } else if (IS_CRESTLINE(dev)) {
5772 I915_WRITE(RENCLK_GATE_D1, I965_RCC_CLOCK_GATE_DISABLE); 5772 I915_WRITE(RENCLK_GATE_D1, I965_RCC_CLOCK_GATE_DISABLE);
5773 I915_WRITE(RENCLK_GATE_D2, 0); 5773 I915_WRITE(RENCLK_GATE_D2, 0);
5774 I915_WRITE(DSPCLK_GATE_D, 0); 5774 I915_WRITE(DSPCLK_GATE_D, 0);
5775 I915_WRITE(RAMCLK_GATE_D, 0); 5775 I915_WRITE(RAMCLK_GATE_D, 0);
5776 I915_WRITE16(DEUC, 0); 5776 I915_WRITE16(DEUC, 0);
5777 } else if (IS_I965G(dev)) { 5777 } else if (IS_BROADWATER(dev)) {
5778 I915_WRITE(RENCLK_GATE_D1, I965_RCZ_CLOCK_GATE_DISABLE | 5778 I915_WRITE(RENCLK_GATE_D1, I965_RCZ_CLOCK_GATE_DISABLE |
5779 I965_RCC_CLOCK_GATE_DISABLE | 5779 I965_RCC_CLOCK_GATE_DISABLE |
5780 I965_RCPB_CLOCK_GATE_DISABLE | 5780 I965_RCPB_CLOCK_GATE_DISABLE |
5781 I965_ISC_CLOCK_GATE_DISABLE | 5781 I965_ISC_CLOCK_GATE_DISABLE |
5782 I965_FBC_CLOCK_GATE_DISABLE); 5782 I965_FBC_CLOCK_GATE_DISABLE);
5783 I915_WRITE(RENCLK_GATE_D2, 0); 5783 I915_WRITE(RENCLK_GATE_D2, 0);
5784 } else if (IS_I9XX(dev)) { 5784 } else if (IS_GEN3(dev)) {
5785 u32 dstate = I915_READ(D_STATE); 5785 u32 dstate = I915_READ(D_STATE);
5786 5786
5787 dstate |= DSTATE_PLL_D3_OFF | DSTATE_GFX_CLOCK_GATING | 5787 dstate |= DSTATE_PLL_D3_OFF | DSTATE_GFX_CLOCK_GATING |
@@ -5863,7 +5863,7 @@ static void intel_init_display(struct drm_device *dev)
5863 dev_priv->display.fbc_enabled = g4x_fbc_enabled; 5863 dev_priv->display.fbc_enabled = g4x_fbc_enabled;
5864 dev_priv->display.enable_fbc = g4x_enable_fbc; 5864 dev_priv->display.enable_fbc = g4x_enable_fbc;
5865 dev_priv->display.disable_fbc = g4x_disable_fbc; 5865 dev_priv->display.disable_fbc = g4x_disable_fbc;
5866 } else if (IS_I965GM(dev)) { 5866 } else if (IS_CRESTLINE(dev)) {
5867 dev_priv->display.fbc_enabled = i8xx_fbc_enabled; 5867 dev_priv->display.fbc_enabled = i8xx_fbc_enabled;
5868 dev_priv->display.enable_fbc = i8xx_enable_fbc; 5868 dev_priv->display.enable_fbc = i8xx_enable_fbc;
5869 dev_priv->display.disable_fbc = i8xx_disable_fbc; 5869 dev_priv->display.disable_fbc = i8xx_disable_fbc;
@@ -5923,9 +5923,9 @@ static void intel_init_display(struct drm_device *dev)
5923 dev_priv->display.update_wm = pineview_update_wm; 5923 dev_priv->display.update_wm = pineview_update_wm;
5924 } else if (IS_G4X(dev)) 5924 } else if (IS_G4X(dev))
5925 dev_priv->display.update_wm = g4x_update_wm; 5925 dev_priv->display.update_wm = g4x_update_wm;
5926 else if (IS_I965G(dev)) 5926 else if (IS_GEN4(dev))
5927 dev_priv->display.update_wm = i965_update_wm; 5927 dev_priv->display.update_wm = i965_update_wm;
5928 else if (IS_I9XX(dev)) { 5928 else if (IS_GEN3(dev)) {
5929 dev_priv->display.update_wm = i9xx_update_wm; 5929 dev_priv->display.update_wm = i9xx_update_wm;
5930 dev_priv->display.get_fifo_size = i9xx_get_fifo_size; 5930 dev_priv->display.get_fifo_size = i9xx_get_fifo_size;
5931 } else if (IS_I85X(dev)) { 5931 } else if (IS_I85X(dev)) {
@@ -6039,24 +6039,24 @@ void intel_modeset_init(struct drm_device *dev)
6039 6039
6040 intel_init_display(dev); 6040 intel_init_display(dev);
6041 6041
6042 if (IS_I965G(dev)) { 6042 if (IS_GEN2(dev)) {
6043 dev->mode_config.max_width = 8192; 6043 dev->mode_config.max_width = 2048;
6044 dev->mode_config.max_height = 8192; 6044 dev->mode_config.max_height = 2048;
6045 } else if (IS_I9XX(dev)) { 6045 } else if (IS_GEN3(dev)) {
6046 dev->mode_config.max_width = 4096; 6046 dev->mode_config.max_width = 4096;
6047 dev->mode_config.max_height = 4096; 6047 dev->mode_config.max_height = 4096;
6048 } else { 6048 } else {
6049 dev->mode_config.max_width = 2048; 6049 dev->mode_config.max_width = 8192;
6050 dev->mode_config.max_height = 2048; 6050 dev->mode_config.max_height = 8192;
6051 } 6051 }
6052 6052
6053 /* set memory base */ 6053 /* set memory base */
6054 if (IS_I9XX(dev)) 6054 if (IS_GEN2(dev))
6055 dev->mode_config.fb_base = pci_resource_start(dev->pdev, 2);
6056 else
6057 dev->mode_config.fb_base = pci_resource_start(dev->pdev, 0); 6055 dev->mode_config.fb_base = pci_resource_start(dev->pdev, 0);
6056 else
6057 dev->mode_config.fb_base = pci_resource_start(dev->pdev, 2);
6058 6058
6059 if (IS_MOBILE(dev) || IS_I9XX(dev)) 6059 if (IS_MOBILE(dev) || !IS_GEN2(dev))
6060 dev_priv->num_pipe = 2; 6060 dev_priv->num_pipe = 2;
6061 else 6061 else
6062 dev_priv->num_pipe = 1; 6062 dev_priv->num_pipe = 1;