diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-07 10:43:04 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-07 10:43:04 -0400 |
commit | a56e74f546b64be93731e42d83baf5b538cc1b11 (patch) | |
tree | 18f6dee45d801e57ac9db2a31664b0d5c0762c50 /drivers/gpu/drm/i915/intel_display.c | |
parent | d08e2e09042bd3f7ef66a35cb4bb92794ab26bb2 (diff) | |
parent | e4e7f10bfc4069925e99cc4b428c3434e30b6c3f (diff) |
Merge branch 'arm-aesbs' of git://git.linaro.org/people/ardbiesheuvel/linux-arm into devel-stable
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2489d0b4c7d2..e5822e79f912 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); |
@@ -4775,6 +4775,10 @@ static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc) | |||
4775 | 4775 | ||
4776 | pipeconf = 0; | 4776 | pipeconf = 0; |
4777 | 4777 | ||
4778 | if (dev_priv->quirks & QUIRK_PIPEA_FORCE && | ||
4779 | I915_READ(PIPECONF(intel_crtc->pipe)) & PIPECONF_ENABLE) | ||
4780 | pipeconf |= PIPECONF_ENABLE; | ||
4781 | |||
4778 | if (intel_crtc->pipe == 0 && INTEL_INFO(dev)->gen < 4) { | 4782 | if (intel_crtc->pipe == 0 && INTEL_INFO(dev)->gen < 4) { |
4779 | /* Enable pixel doubling when the dot clock is > 90% of the (display) | 4783 | /* Enable pixel doubling when the dot clock is > 90% of the (display) |
4780 | * core speed. | 4784 | * core speed. |
@@ -4877,9 +4881,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, | |||
4877 | return -EINVAL; | 4881 | return -EINVAL; |
4878 | } | 4882 | } |
4879 | 4883 | ||
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) { | 4884 | if (is_lvds && dev_priv->lvds_downclock_avail) { |
4884 | /* | 4885 | /* |
4885 | * Ensure we match the reduced clock's P to the target clock. | 4886 | * Ensure we match the reduced clock's P to the target clock. |
@@ -5768,9 +5769,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, | |||
5768 | intel_crtc->config.dpll.p2 = clock.p2; | 5769 | intel_crtc->config.dpll.p2 = clock.p2; |
5769 | } | 5770 | } |
5770 | 5771 | ||
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. */ | 5772 | /* CPU eDP is the only output that doesn't need a PCH PLL of its own. */ |
5775 | if (intel_crtc->config.has_pch_encoder) { | 5773 | if (intel_crtc->config.has_pch_encoder) { |
5776 | fp = i9xx_dpll_compute_fp(&intel_crtc->config.dpll); | 5774 | fp = i9xx_dpll_compute_fp(&intel_crtc->config.dpll); |
@@ -5859,6 +5857,7 @@ static void ironlake_get_pfit_config(struct intel_crtc *crtc, | |||
5859 | tmp = I915_READ(PF_CTL(crtc->pipe)); | 5857 | tmp = I915_READ(PF_CTL(crtc->pipe)); |
5860 | 5858 | ||
5861 | if (tmp & PF_ENABLE) { | 5859 | if (tmp & PF_ENABLE) { |
5860 | pipe_config->pch_pfit.enabled = true; | ||
5862 | pipe_config->pch_pfit.pos = I915_READ(PF_WIN_POS(crtc->pipe)); | 5861 | 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)); | 5862 | pipe_config->pch_pfit.size = I915_READ(PF_WIN_SZ(crtc->pipe)); |
5864 | 5863 | ||
@@ -6236,7 +6235,7 @@ static void haswell_modeset_global_resources(struct drm_device *dev) | |||
6236 | if (!crtc->base.enabled) | 6235 | if (!crtc->base.enabled) |
6237 | continue; | 6236 | continue; |
6238 | 6237 | ||
6239 | if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.size || | 6238 | if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.enabled || |
6240 | crtc->config.cpu_transcoder != TRANSCODER_EDP) | 6239 | crtc->config.cpu_transcoder != TRANSCODER_EDP) |
6241 | enable = true; | 6240 | enable = true; |
6242 | } | 6241 | } |
@@ -6259,9 +6258,6 @@ static int haswell_crtc_mode_set(struct drm_crtc *crtc, | |||
6259 | if (!intel_ddi_pll_mode_set(crtc)) | 6258 | if (!intel_ddi_pll_mode_set(crtc)) |
6260 | return -EINVAL; | 6259 | return -EINVAL; |
6261 | 6260 | ||
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) | 6261 | if (intel_crtc->config.has_dp_encoder) |
6266 | intel_dp_set_m_n(intel_crtc); | 6262 | intel_dp_set_m_n(intel_crtc); |
6267 | 6263 | ||
@@ -6494,15 +6490,15 @@ static void haswell_write_eld(struct drm_connector *connector, | |||
6494 | 6490 | ||
6495 | /* Set ELD valid state */ | 6491 | /* Set ELD valid state */ |
6496 | tmp = I915_READ(aud_cntrl_st2); | 6492 | tmp = I915_READ(aud_cntrl_st2); |
6497 | DRM_DEBUG_DRIVER("HDMI audio: pin eld vld status=0x%8x\n", tmp); | 6493 | DRM_DEBUG_DRIVER("HDMI audio: pin eld vld status=0x%08x\n", tmp); |
6498 | tmp |= (AUDIO_ELD_VALID_A << (pipe * 4)); | 6494 | tmp |= (AUDIO_ELD_VALID_A << (pipe * 4)); |
6499 | I915_WRITE(aud_cntrl_st2, tmp); | 6495 | I915_WRITE(aud_cntrl_st2, tmp); |
6500 | tmp = I915_READ(aud_cntrl_st2); | 6496 | tmp = I915_READ(aud_cntrl_st2); |
6501 | DRM_DEBUG_DRIVER("HDMI audio: eld vld status=0x%8x\n", tmp); | 6497 | DRM_DEBUG_DRIVER("HDMI audio: eld vld status=0x%08x\n", tmp); |
6502 | 6498 | ||
6503 | /* Enable HDMI mode */ | 6499 | /* Enable HDMI mode */ |
6504 | tmp = I915_READ(aud_config); | 6500 | tmp = I915_READ(aud_config); |
6505 | DRM_DEBUG_DRIVER("HDMI audio: audio conf: 0x%8x\n", tmp); | 6501 | DRM_DEBUG_DRIVER("HDMI audio: audio conf: 0x%08x\n", tmp); |
6506 | /* clear N_programing_enable and N_value_index */ | 6502 | /* clear N_programing_enable and N_value_index */ |
6507 | tmp &= ~(AUD_CONFIG_N_VALUE_INDEX | AUD_CONFIG_N_PROG_ENABLE); | 6503 | tmp &= ~(AUD_CONFIG_N_VALUE_INDEX | AUD_CONFIG_N_PROG_ENABLE); |
6508 | I915_WRITE(aud_config, tmp); | 6504 | I915_WRITE(aud_config, tmp); |
@@ -6937,7 +6933,8 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, | |||
6937 | intel_crtc->cursor_width = width; | 6933 | intel_crtc->cursor_width = width; |
6938 | intel_crtc->cursor_height = height; | 6934 | intel_crtc->cursor_height = height; |
6939 | 6935 | ||
6940 | intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL); | 6936 | if (intel_crtc->active) |
6937 | intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL); | ||
6941 | 6938 | ||
6942 | return 0; | 6939 | return 0; |
6943 | fail_unpin: | 6940 | fail_unpin: |
@@ -6956,7 +6953,8 @@ static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | |||
6956 | intel_crtc->cursor_x = x; | 6953 | intel_crtc->cursor_x = x; |
6957 | intel_crtc->cursor_y = y; | 6954 | intel_crtc->cursor_y = y; |
6958 | 6955 | ||
6959 | intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL); | 6956 | if (intel_crtc->active) |
6957 | intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL); | ||
6960 | 6958 | ||
6961 | return 0; | 6959 | return 0; |
6962 | } | 6960 | } |
@@ -8205,9 +8203,10 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc, | |||
8205 | pipe_config->gmch_pfit.control, | 8203 | pipe_config->gmch_pfit.control, |
8206 | pipe_config->gmch_pfit.pgm_ratios, | 8204 | pipe_config->gmch_pfit.pgm_ratios, |
8207 | pipe_config->gmch_pfit.lvds_border_bits); | 8205 | pipe_config->gmch_pfit.lvds_border_bits); |
8208 | DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x\n", | 8206 | DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x, %s\n", |
8209 | pipe_config->pch_pfit.pos, | 8207 | pipe_config->pch_pfit.pos, |
8210 | pipe_config->pch_pfit.size); | 8208 | pipe_config->pch_pfit.size, |
8209 | pipe_config->pch_pfit.enabled ? "enabled" : "disabled"); | ||
8211 | DRM_DEBUG_KMS("ips: %i\n", pipe_config->ips_enabled); | 8210 | DRM_DEBUG_KMS("ips: %i\n", pipe_config->ips_enabled); |
8212 | } | 8211 | } |
8213 | 8212 | ||
@@ -8603,8 +8602,11 @@ intel_pipe_config_compare(struct drm_device *dev, | |||
8603 | if (INTEL_INFO(dev)->gen < 4) | 8602 | if (INTEL_INFO(dev)->gen < 4) |
8604 | PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios); | 8603 | PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios); |
8605 | PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits); | 8604 | PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits); |
8606 | PIPE_CONF_CHECK_I(pch_pfit.pos); | 8605 | PIPE_CONF_CHECK_I(pch_pfit.enabled); |
8607 | PIPE_CONF_CHECK_I(pch_pfit.size); | 8606 | if (current_config->pch_pfit.enabled) { |
8607 | PIPE_CONF_CHECK_I(pch_pfit.pos); | ||
8608 | PIPE_CONF_CHECK_I(pch_pfit.size); | ||
8609 | } | ||
8608 | 8610 | ||
8609 | PIPE_CONF_CHECK_I(ips_enabled); | 8611 | PIPE_CONF_CHECK_I(ips_enabled); |
8610 | 8612 | ||