Skip to contentSkip to conversation

drm/i915/audio: fix hdmi audio noise issue

PATCH Superseded [email protected] 3 participants 4 messages Nov 9, 2016 – Nov 10, 2016

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/audio: fix hdmi audio noise issue

From: Libin Yang <[email protected]>

This issue is caused by:
6014ac12: drm/i915/audio: set proper N/M in modeset

Some special 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 disable Enable CTS or M Prog bit. This is the initial setting after HW reset.

---
 drivers/gpu/drm/i915/intel_audio.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +12 -3
index 813fd74..a472d35 100644
@@ -332,6 +332,13 @@ hsw_hdmi_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
 	int n;
 	u32 tmp;
 
+	/* reset CTS value to 0 */
+	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
+	tmp &= ~AUD_CONFIG_M_MASK;
+	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
+	tmp |= AUD_M_CTS_M_PROG_ENABLE;
+	I915_WRITE(HSW_AUD_M_CTS_ENABLE(pipe), tmp);
+
 	tmp = I915_READ(HSW_AUD_CFG(pipe));
 	tmp &= ~AUD_CONFIG_N_VALUE_INDEX;
 	tmp &= ~AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK;
@@ -351,10 +358,12 @@ 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_VALUE_INDEX;
-	tmp |= AUD_M_CTS_M_PROG_ENABLE;
+	tmp &= ~AUD_M_CTS_M_PROG_ENABLE;
 	I915_WRITE(HSW_AUD_M_CTS_ENABLE(pipe), tmp);
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915/audio: fix hdmi audio noise issue

== Series Details ==

== Series Details ==

Series: drm/i915/audio: fix hdmi audio noise issue
URL : https://patchwork.freedesktop.org/series/15012/
State : success

== Summary ==

Series 15012v1 drm/i915/audio: fix hdmi audio noise issue
https://patchwork.freedesktop.org/api/1.0/series/15012/revisions/1/mbox/

fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:204  dwarn:0   dfail:0   fail:0   skip:40 
fi-bxt-t5700     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-j1900     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-n2820     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-hsw-4770      total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-hsw-4770r     total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-ilk-650       total:244  pass:191  dwarn:0   dfail:0   fail:0   skip:53 
fi-ivb-3520m     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-ivb-3770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-7200u     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:244  pass:223  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6700k     total:244  pass:222  dwarn:1   dfail:0   fail:0   skip:21 
fi-snb-2520m     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-snb-2600      total:244  pass:211  dwarn:0   dfail:0   fail:0   skip:33 

d761364280c79ec14915166048d038b67e8a5477 drm-intel-nightly: 2016y-11m-08d-21h-38m-12s UTC integration manifest abc7e21 drm/i915/audio: fix hdmi audio noise issue

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2939/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#2 lore raw
In reply to [email protected]
Quoted 5 lines · On Wed, 09 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

This issue is caused by:
6014ac12: drm/i915/audio: set proper N/M in modeset

Quoted 7 lines

Some special 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 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")
Quoted 27 lines
---
 drivers/gpu/drm/i915/intel_audio.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +7 -0
index 813fd74..a472d35 100644
@@ -332,6 +332,13 @@ hsw_hdmi_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
 	int n;
 	u32 tmp;
 
+	/* reset CTS value to 0 */
+	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
+	tmp &= ~AUD_CONFIG_M_MASK;
+	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
+	tmp |= AUD_M_CTS_M_PROG_ENABLE;
+	I915_WRITE(HSW_AUD_M_CTS_ENABLE(pipe), tmp);
+
 	tmp = I915_READ(HSW_AUD_CFG(pipe));
 	tmp &= ~AUD_CONFIG_N_VALUE_INDEX;
 	tmp &= ~AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK;
@@ -351,10 +358,12 @@ hsw_hdmi_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
 
 	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
 

drivers/gpu/drm/i915/intel_audio.c hsw_hdmi_audio_config_update(struct intel_crtc *intel_crtc, enum port port, · line 367

Quoted 10 lines
drivers/gpu/drm/i915/intel_audio.c +5 -3
+	/*
+	 * 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_VALUE_INDEX;
-	tmp |= AUD_M_CTS_M_PROG_ENABLE;
+	tmp &= ~AUD_M_CTS_M_PROG_ENABLE;
 	I915_WRITE(HSW_AUD_M_CTS_ENABLE(pipe), tmp);

Is it necessary to do the HSW_AUD_M_CTS_ENABLE updates in two places? Why do you both enable and disable AUD_M_CTS_M_PROG_ENABLE bit here?

BR,
Jani.

Quoted 1 line
drivers/gpu/drm/i915/intel_audio.c +0 -0
 }
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 19 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Wednesday, November 9, 2016 6:59 PM
To: Yang, Libin <[email protected]>; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>
Subject: Re: [PATCH] drm/i915/audio: fix hdmi audio noise issue

Quoted 8 lines · On Wed, 09 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

This issue is caused by:
6014ac12: drm/i915/audio: set proper N/M in modeset

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

Quoted 6 lines
Quoted 4 lines

In patch 6014ac12, it will reset the cts value to 0 for HDMI. However, we need 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")

Get it. Thanks.

Quoted 45 lines

drivers/gpu/drm/i915/intel_audio.c hsw_hdmi_audio_config_update(struct intel_crtc

Quoted 12 lines
---
 drivers/gpu/drm/i915/intel_audio.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index 813fd74..a472d35 100644
@@ -332,6 +332,13 @@ hsw_hdmi_audio_config_update(struct intel_crtc

*intel_crtc, enum port port,

Quoted 18 lines
drivers/gpu/drm/i915/intel_audio.c +7 -0
 	int n;
 	u32 tmp;
 
+	/* reset CTS value to 0 */
+	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
+	tmp &= ~AUD_CONFIG_M_MASK;
+	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
+	tmp |= AUD_M_CTS_M_PROG_ENABLE;
+	I915_WRITE(HSW_AUD_M_CTS_ENABLE(pipe), tmp);
+
 	tmp = I915_READ(HSW_AUD_CFG(pipe));
 	tmp &= ~AUD_CONFIG_N_VALUE_INDEX;
 	tmp &= ~AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK;
@@ -351,10 +358,12 @@ hsw_hdmi_audio_config_update(struct intel_crtc
 *intel_crtc, enum port port,
 
 	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
 

drivers/gpu/drm/i915/intel_audio.c hsw_hdmi_audio_config_update(struct intel_crtc · line 368

Quoted 10 lines
drivers/gpu/drm/i915/intel_audio.c +5 -3
+	/*
+	 * 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_VALUE_INDEX;
-	tmp |= AUD_M_CTS_M_PROG_ENABLE;
+	tmp &= ~AUD_M_CTS_M_PROG_ENABLE;
 	I915_WRITE(HSW_AUD_M_CTS_ENABLE(pipe), tmp);

Is it necessary to do the HSW_AUD_M_CTS_ENABLE updates in two places? Why do you both enable and disable AUD_M_CTS_M_PROG_ENABLE bit here?

Quoted 8 lines

BR,
Jani.

drivers/gpu/drm/i915/intel_audio.c hsw_hdmi_audio_config_update(struct intel_crtc · line 369

Quoted 1 line
drivers/gpu/drm/i915/intel_audio.c +0 -0
 }

--
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx