diff mbox

[09/12] drm/i915: Disable HDMI port after the pipe on PCH platforms

Message ID 1430835458-11187-10-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä May 5, 2015, 2:17 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

BSpec says we should disable all ports after the pipe on PCH
platforms. Do so. Fixes a pipe off timeout on ILK now caused by
the transcoder B workaround.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

Comments

Jesse Barnes May 21, 2015, 7:24 p.m. UTC | #1
On 05/05/2015 07:17 AM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> BSpec says we should disable all ports after the pipe on PCH
> platforms. Do so. Fixes a pipe off timeout on ILK now caused by
> the transcoder B workaround.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 33 +++++++++++++++++++++++++++++----
>  1 file changed, 29 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 9b9a69e..2ee19ca 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1097,9 +1097,6 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
>  	struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
>  	u32 temp;
>  
> -	if (crtc->config->has_audio)
> -		intel_audio_codec_disable(encoder);
> -
>  	temp = I915_READ(intel_hdmi->hdmi_reg);
>  
>  	temp &= ~(SDVO_ENABLE | SDVO_AUDIO_ENABLE);
> @@ -1134,6 +1131,29 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
>  	}
>  }
>  
> +static void g4x_disable_hdmi(struct intel_encoder *encoder)
> +{
> +	struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
> +
> +	if (crtc->config->has_audio)
> +		intel_audio_codec_disable(encoder);
> +
> +	intel_disable_hdmi(encoder);
> +}
> +
> +static void pch_disable_hdmi(struct intel_encoder *encoder)
> +{
> +	struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
> +
> +	if (crtc->config->has_audio)
> +		intel_audio_codec_disable(encoder);
> +}
> +
> +static void pch_post_disable_hdmi(struct intel_encoder *encoder)
> +{
> +	intel_disable_hdmi(encoder);
> +}
> +
>  static int hdmi_portclock_limit(struct intel_hdmi *hdmi, bool respect_dvi_limit)
>  {
>  	struct drm_device *dev = intel_hdmi_to_dev(hdmi);
> @@ -2020,7 +2040,12 @@ void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port)
>  			 DRM_MODE_ENCODER_TMDS);
>  
>  	intel_encoder->compute_config = intel_hdmi_compute_config;
> -	intel_encoder->disable = intel_disable_hdmi;
> +	if (HAS_PCH_SPLIT(dev)) {
> +		intel_encoder->disable = pch_disable_hdmi;
> +		intel_encoder->post_disable = pch_post_disable_hdmi;
> +	} else {
> +		intel_encoder->disable = g4x_disable_hdmi;
> +	}
>  	intel_encoder->get_hw_state = intel_hdmi_get_hw_state;
>  	intel_encoder->get_config = intel_hdmi_get_config;
>  	if (IS_CHERRYVIEW(dev)) {
> 

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 9b9a69e..2ee19ca 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -1097,9 +1097,6 @@  static void intel_disable_hdmi(struct intel_encoder *encoder)
 	struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
 	u32 temp;
 
-	if (crtc->config->has_audio)
-		intel_audio_codec_disable(encoder);
-
 	temp = I915_READ(intel_hdmi->hdmi_reg);
 
 	temp &= ~(SDVO_ENABLE | SDVO_AUDIO_ENABLE);
@@ -1134,6 +1131,29 @@  static void intel_disable_hdmi(struct intel_encoder *encoder)
 	}
 }
 
+static void g4x_disable_hdmi(struct intel_encoder *encoder)
+{
+	struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
+
+	if (crtc->config->has_audio)
+		intel_audio_codec_disable(encoder);
+
+	intel_disable_hdmi(encoder);
+}
+
+static void pch_disable_hdmi(struct intel_encoder *encoder)
+{
+	struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
+
+	if (crtc->config->has_audio)
+		intel_audio_codec_disable(encoder);
+}
+
+static void pch_post_disable_hdmi(struct intel_encoder *encoder)
+{
+	intel_disable_hdmi(encoder);
+}
+
 static int hdmi_portclock_limit(struct intel_hdmi *hdmi, bool respect_dvi_limit)
 {
 	struct drm_device *dev = intel_hdmi_to_dev(hdmi);
@@ -2020,7 +2040,12 @@  void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port)
 			 DRM_MODE_ENCODER_TMDS);
 
 	intel_encoder->compute_config = intel_hdmi_compute_config;
-	intel_encoder->disable = intel_disable_hdmi;
+	if (HAS_PCH_SPLIT(dev)) {
+		intel_encoder->disable = pch_disable_hdmi;
+		intel_encoder->post_disable = pch_post_disable_hdmi;
+	} else {
+		intel_encoder->disable = g4x_disable_hdmi;
+	}
 	intel_encoder->get_hw_state = intel_hdmi_get_hw_state;
 	intel_encoder->get_config = intel_hdmi_get_config;
 	if (IS_CHERRYVIEW(dev)) {