diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2489d0b4c7d2..d8a1d98693e7 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2249,7 +2249,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
2249 | I915_WRITE(PIPESRC(intel_crtc->pipe), | 2249 | I915_WRITE(PIPESRC(intel_crtc->pipe), |
2250 | ((crtc->mode.hdisplay - 1) << 16) | | 2250 | ((crtc->mode.hdisplay - 1) << 16) | |
2251 | (crtc->mode.vdisplay - 1)); | 2251 | (crtc->mode.vdisplay - 1)); |
2252 | if (!intel_crtc->config.pch_pfit.size && | 2252 | if (!intel_crtc->config.pch_pfit.enabled && |
2253 | (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) || | 2253 | (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) || |
2254 | intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) { | 2254 | intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) { |
2255 | I915_WRITE(PF_CTL(intel_crtc->pipe), 0); | 2255 | I915_WRITE(PF_CTL(intel_crtc->pipe), 0); |
@@ -3203,7 +3203,7 @@ static void ironlake_pfit_enable(struct intel_crtc *crtc) | |||
3203 | struct drm_i915_private *dev_priv = dev->dev_private; | 3203 | struct drm_i915_private *dev_priv = dev->dev_private; |
3204 | int pipe = crtc->pipe; | 3204 | int pipe = crtc->pipe; |
3205 | 3205 | ||
3206 | if (crtc->config.pch_pfit.size) { | 3206 | if (crtc->config.pch_pfit.enabled) { |
3207 | /* Force use of hard-coded filter coefficients | 3207 | /* Force use of hard-coded filter coefficients |
3208 | * as some pre-programmed values are broken, | 3208 | * as some pre-programmed values are broken, |
3209 | * e.g. x201. | 3209 | * e.g. x201. |
@@ -3428,7 +3428,7 @@ static void ironlake_pfit_disable(struct intel_crtc *crtc) | |||
3428 | 3428 | ||
3429 | /* To avoid upsetting the power well on haswell only disable the pfit if | 3429 | /* To avoid upsetting the power well on haswell only disable the pfit if |
3430 | * it's in use. The hw state code will make sure we get this right. */ | 3430 | * it's in use. The hw state code will make sure we get this right. */ |
3431 | if (crtc->config.pch_pfit.size) { | 3431 | if (crtc->config.pch_pfit.enabled) { |
3432 | I915_WRITE(PF_CTL(pipe), 0); | 3432 | I915_WRITE(PF_CTL(pipe), 0); |
3433 | I915_WRITE(PF_WIN_POS(pipe), 0); | 3433 | I915_WRITE(PF_WIN_POS(pipe), 0); |
3434 | I915_WRITE(PF_WIN_SZ(pipe), 0); | 3434 | I915_WRITE(PF_WIN_SZ(pipe), 0); |
@@ -4877,9 +4877,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, | |||
4877 | return -EINVAL; | 4877 | return -EINVAL; |
4878 | } | 4878 | } |
4879 | 4879 | ||
4880 | /* Ensure that the cursor is valid for the new mode before changing... */ | ||
4881 | intel_crtc_update_cursor(crtc, true); | ||
4882 | |||
4883 | if (is_lvds && dev_priv->lvds_downclock_avail) { | 4880 | if (is_lvds && dev_priv->lvds_downclock_avail) { |
4884 | /* | 4881 | /* |
4885 | * Ensure we match the reduced clock's P to the target clock. | 4882 | * Ensure we match the reduced clock's P to the target clock. |
@@ -5768,9 +5765,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, | |||
5768 | intel_crtc->config.dpll.p2 = clock.p2; | 5765 | intel_crtc->config.dpll.p2 = clock.p2; |
5769 | } | 5766 | } |
5770 | 5767 | ||
5771 | /* Ensure that the cursor is valid for the new mode before changing... */ | ||
5772 | intel_crtc_update_cursor(crtc, true); | ||
5773 | |||
5774 | /* CPU eDP is the only output that doesn't need a PCH PLL of its own. */ | 5768 | /* CPU eDP is the only output that doesn't need a PCH PLL of its own. */ |
5775 | if (intel_crtc->config.has_pch_encoder) { | 5769 | if (intel_crtc->config.has_pch_encoder) { |
5776 | fp = i9xx_dpll_compute_fp(&intel_crtc->config.dpll); | 5770 | fp = i9xx_dpll_compute_fp(&intel_crtc->config.dpll); |
@@ -5859,6 +5853,7 @@ static void ironlake_get_pfit_config(struct intel_crtc *crtc, | |||
5859 | tmp = I915_READ(PF_CTL(crtc->pipe)); | 5853 | tmp = I915_READ(PF_CTL(crtc->pipe)); |
5860 | 5854 | ||
5861 | if (tmp & PF_ENABLE) { | 5855 | if (tmp & PF_ENABLE) { |
5856 | pipe_config->pch_pfit.enabled = true; | ||
5862 | pipe_config->pch_pfit.pos = I915_READ(PF_WIN_POS(crtc->pipe)); | 5857 | pipe_config->pch_pfit.pos = I915_READ(PF_WIN_POS(crtc->pipe)); |
5863 | pipe_config->pch_pfit.size = I915_READ(PF_WIN_SZ(crtc->pipe)); | 5858 | pipe_config->pch_pfit.size = I915_READ(PF_WIN_SZ(crtc->pipe)); |
5864 | 5859 | ||
@@ -6236,7 +6231,7 @@ static void haswell_modeset_global_resources(struct drm_device *dev) | |||
6236 | if (!crtc->base.enabled) | 6231 | if (!crtc->base.enabled) |
6237 | continue; | 6232 | continue; |
6238 | 6233 | ||
6239 | if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.size || | 6234 | if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.enabled || |
6240 | crtc->config.cpu_transcoder != TRANSCODER_EDP) | 6235 | crtc->config.cpu_transcoder != TRANSCODER_EDP) |
6241 | enable = true; | 6236 | enable = true; |
6242 | } | 6237 | } |
@@ -6259,9 +6254,6 @@ static int haswell_crtc_mode_set(struct drm_crtc *crtc, | |||
6259 | if (!intel_ddi_pll_mode_set(crtc)) | 6254 | if (!intel_ddi_pll_mode_set(crtc)) |
6260 | return -EINVAL; | 6255 | return -EINVAL; |
6261 | 6256 | ||
6262 | /* Ensure that the cursor is valid for the new mode before changing... */ | ||
6263 | intel_crtc_update_cursor(crtc, true); | ||
6264 | |||
6265 | if (intel_crtc->config.has_dp_encoder) | 6257 | if (intel_crtc->config.has_dp_encoder) |
6266 | intel_dp_set_m_n(intel_crtc); | 6258 | intel_dp_set_m_n(intel_crtc); |
6267 | 6259 | ||
@@ -6494,15 +6486,15 @@ static void haswell_write_eld(struct drm_connector *connector, | |||
6494 | 6486 | ||
6495 | /* Set ELD valid state */ | 6487 | /* Set ELD valid state */ |
6496 | tmp = I915_READ(aud_cntrl_st2); | 6488 | tmp = I915_READ(aud_cntrl_st2); |
6497 | DRM_DEBUG_DRIVER("HDMI audio: pin eld vld status=0x%8x\n", tmp); | 6489 | DRM_DEBUG_DRIVER("HDMI audio: pin eld vld status=0x%08x\n", tmp); |
6498 | tmp |= (AUDIO_ELD_VALID_A << (pipe * 4)); | 6490 | tmp |= (AUDIO_ELD_VALID_A << (pipe * 4)); |
6499 | I915_WRITE(aud_cntrl_st2, tmp); | 6491 | I915_WRITE(aud_cntrl_st2, tmp); |
6500 | tmp = I915_READ(aud_cntrl_st2); | 6492 | tmp = I915_READ(aud_cntrl_st2); |
6501 | DRM_DEBUG_DRIVER("HDMI audio: eld vld status=0x%8x\n", tmp); | 6493 | DRM_DEBUG_DRIVER("HDMI audio: eld vld status=0x%08x\n", tmp); |
6502 | 6494 | ||
6503 | /* Enable HDMI mode */ | 6495 | /* Enable HDMI mode */ |
6504 | tmp = I915_READ(aud_config); | 6496 | tmp = I915_READ(aud_config); |
6505 | DRM_DEBUG_DRIVER("HDMI audio: audio conf: 0x%8x\n", tmp); | 6497 | DRM_DEBUG_DRIVER("HDMI audio: audio conf: 0x%08x\n", tmp); |
6506 | /* clear N_programing_enable and N_value_index */ | 6498 | /* clear N_programing_enable and N_value_index */ |
6507 | tmp &= ~(AUD_CONFIG_N_VALUE_INDEX | AUD_CONFIG_N_PROG_ENABLE); | 6499 | tmp &= ~(AUD_CONFIG_N_VALUE_INDEX | AUD_CONFIG_N_PROG_ENABLE); |
6508 | I915_WRITE(aud_config, tmp); | 6500 | I915_WRITE(aud_config, tmp); |
@@ -6937,7 +6929,8 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, | |||
6937 | intel_crtc->cursor_width = width; | 6929 | intel_crtc->cursor_width = width; |
6938 | intel_crtc->cursor_height = height; | 6930 | intel_crtc->cursor_height = height; |
6939 | 6931 | ||
6940 | intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL); | 6932 | if (intel_crtc->active) |
6933 | intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL); | ||
6941 | 6934 | ||
6942 | return 0; | 6935 | return 0; |
6943 | fail_unpin: | 6936 | fail_unpin: |
@@ -6956,7 +6949,8 @@ static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | |||
6956 | intel_crtc->cursor_x = x; | 6949 | intel_crtc->cursor_x = x; |
6957 | intel_crtc->cursor_y = y; | 6950 | intel_crtc->cursor_y = y; |
6958 | 6951 | ||
6959 | intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL); | 6952 | if (intel_crtc->active) |
6953 | intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL); | ||
6960 | 6954 | ||
6961 | return 0; | 6955 | return 0; |
6962 | } | 6956 | } |
@@ -8205,9 +8199,10 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc, | |||
8205 | pipe_config->gmch_pfit.control, | 8199 | pipe_config->gmch_pfit.control, |
8206 | pipe_config->gmch_pfit.pgm_ratios, | 8200 | pipe_config->gmch_pfit.pgm_ratios, |
8207 | pipe_config->gmch_pfit.lvds_border_bits); | 8201 | pipe_config->gmch_pfit.lvds_border_bits); |
8208 | DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x\n", | 8202 | DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x, %s\n", |
8209 | pipe_config->pch_pfit.pos, | 8203 | pipe_config->pch_pfit.pos, |
8210 | pipe_config->pch_pfit.size); | 8204 | pipe_config->pch_pfit.size, |
8205 | pipe_config->pch_pfit.enabled ? "enabled" : "disabled"); | ||
8211 | DRM_DEBUG_KMS("ips: %i\n", pipe_config->ips_enabled); | 8206 | DRM_DEBUG_KMS("ips: %i\n", pipe_config->ips_enabled); |
8212 | } | 8207 | } |
8213 | 8208 | ||
@@ -8603,8 +8598,11 @@ intel_pipe_config_compare(struct drm_device *dev, | |||
8603 | if (INTEL_INFO(dev)->gen < 4) | 8598 | if (INTEL_INFO(dev)->gen < 4) |
8604 | PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios); | 8599 | PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios); |
8605 | PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits); | 8600 | PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits); |
8606 | PIPE_CONF_CHECK_I(pch_pfit.pos); | 8601 | PIPE_CONF_CHECK_I(pch_pfit.enabled); |
8607 | PIPE_CONF_CHECK_I(pch_pfit.size); | 8602 | if (current_config->pch_pfit.enabled) { |
8603 | PIPE_CONF_CHECK_I(pch_pfit.pos); | ||
8604 | PIPE_CONF_CHECK_I(pch_pfit.size); | ||
8605 | } | ||
8608 | 8606 | ||
8609 | PIPE_CONF_CHECK_I(ips_enabled); | 8607 | PIPE_CONF_CHECK_I(ips_enabled); |
8610 | 8608 | ||