diff mbox

[v3] drm/i915/audio: fix hdmi audio noise issue

Message ID 1478853988-139842-1-git-send-email-libin.yang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yang, Libin Nov. 11, 2016, 8:46 a.m. UTC
From: Libin Yang <libin.yang@intel.com>

Some monitors will have noise or even no sound after
applying the patch 6014ac12.

In patch 6014ac12, it will reset the cts value to 0 for HDMI.
However, we need to disable Enable CTS or M Prog bit. This is
the initial setting after HW reset.

Fixes: 6014ac122ed0 ("drm/i915/audio: set proper N/M in modeset")
Signed-off-by: Libin Yang <libin.yang@intel.com>
---
 drivers/gpu/drm/i915/intel_audio.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Jani Nikula Nov. 11, 2016, 9:36 a.m. UTC | #1
On Fri, 11 Nov 2016, libin.yang@intel.com wrote:
> From: Libin Yang <libin.yang@intel.com>
>
> Some monitors will have noise or even no sound after
> applying the patch 6014ac12.
>
> In patch 6014ac12, it will reset the cts value to 0 for HDMI.
> However, we need to disable Enable CTS or M Prog bit. This is
> the initial setting after HW reset.
>
> Fixes: 6014ac122ed0 ("drm/i915/audio: set proper N/M in modeset")
> Signed-off-by: Libin Yang <libin.yang@intel.com>

If this works, I guess all I can say is,

Acked-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_audio.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index 195223d..88ed869 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -351,10 +351,13 @@ hsw_hdmi_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
>  
>  	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>  
> +	/*
> +	 * Let's disable "Enable CTS or M Prog bit"
> +	 * and let HW calculate the value
> +	 */
>  	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
> -	tmp &= ~AUD_CONFIG_M_MASK;
> +	tmp &= ~AUD_M_CTS_M_PROG_ENABLE;
>  	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
> -	tmp |= AUD_M_CTS_M_PROG_ENABLE;
>  	I915_WRITE(HSW_AUD_M_CTS_ENABLE(pipe), tmp);
>  }
Jani Nikula Nov. 24, 2016, 3:40 p.m. UTC | #2
On Fri, 11 Nov 2016, libin.yang@intel.com wrote:
> From: Libin Yang <libin.yang@intel.com>
>
> Some monitors will have noise or even no sound after
> applying the patch 6014ac12.
>
> In patch 6014ac12, it will reset the cts value to 0 for HDMI.
> However, we need to disable Enable CTS or M Prog bit. This is
> the initial setting after HW reset.
>
> Fixes: 6014ac122ed0 ("drm/i915/audio: set proper N/M in modeset")
> Signed-off-by: Libin Yang <libin.yang@intel.com>

Pushed to dinq, thanks for the patch.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/intel_audio.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index 195223d..88ed869 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -351,10 +351,13 @@ hsw_hdmi_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
>  
>  	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>  
> +	/*
> +	 * Let's disable "Enable CTS or M Prog bit"
> +	 * and let HW calculate the value
> +	 */
>  	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
> -	tmp &= ~AUD_CONFIG_M_MASK;
> +	tmp &= ~AUD_M_CTS_M_PROG_ENABLE;
>  	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
> -	tmp |= AUD_M_CTS_M_PROG_ENABLE;
>  	I915_WRITE(HSW_AUD_M_CTS_ENABLE(pipe), tmp);
>  }
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 195223d..88ed869 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -351,10 +351,13 @@  hsw_hdmi_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
 
 	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
 
+	/*
+	 * Let's disable "Enable CTS or M Prog bit"
+	 * and let HW calculate the value
+	 */
 	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
-	tmp &= ~AUD_CONFIG_M_MASK;
+	tmp &= ~AUD_M_CTS_M_PROG_ENABLE;
 	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
-	tmp |= AUD_M_CTS_M_PROG_ENABLE;
 	I915_WRITE(HSW_AUD_M_CTS_ENABLE(pipe), tmp);
 }