Skip to contentSkip to conversation

drm/i915/audio: fix hdmi audio noise issue

PATCH Superseded [email protected] 3 participants 6 messages Nov 10, 2016 – Nov 11, 2016

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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

From: Libin Yang <[email protected]>

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")
---
 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 (rev2)

== Series Details ==

== Series Details ==

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

== Summary ==

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

Test kms_pipe_crc_basic:

        Subgroup suspend-read-crc-pipe-a:
                fail       -> PASS       (fi-ivb-3520m)
        Subgroup suspend-read-crc-pipe-b:
                fail       -> PASS       (fi-ivb-3520m)
        Subgroup suspend-read-crc-pipe-c:
                fail       -> PASS       (fi-ivb-3520m)
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 

1afd351596b6deaead14d5812f0d6850379e30ad drm-intel-nightly: 2016y-11m-09d-21h-03m-31s UTC integration manifest 65718a7 drm/i915/audio: fix hdmi audio noise issue

== Logs ==

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

maintainer
#2 lore raw
In reply to [email protected]
Quoted 37 lines · On Thu, 10 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

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")
---
 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);

You did not address my review comment on the earlier version:

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

Hi Jani,

Quoted 63 lines

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

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

Quoted 21 lines · On Thu, 10 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

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")
---
 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);

You did not address my review comment on the earlier version:

Quoted 2 lines

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?

Sorry, I missed your comments.

The first doing the HSW_AUD_M_CTS_ENABLE is to reset the M value to 0. The second doing the HSW_AUD_M_CTS_ENABLE is to let HW calculate the M value.

Or we can just try to disable the HSW_AUD_M_CTS_ENABLE bit. What's your opinion?

Regards,
Libin

Quoted 9 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

maintainer
#4 lore raw
Quoted 68 lines · Libin

Hi Jani,

Quoted 63 lines

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

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

Quoted 21 lines · On Thu, 10 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

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")
---
 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);

You did not address my review comment on the earlier version:

Quoted 2 lines

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 6 lines

Sorry, I missed your comments.

The first doing the HSW_AUD_M_CTS_ENABLE is to reset the M value to 0. The second doing the HSW_AUD_M_CTS_ENABLE is to let HW calculate the M value.

Or we can just try to disable the HSW_AUD_M_CTS_ENABLE bit. What's your opinion?

I would have thought just doing the latter would be sufficient. Please test.

BR,
Jani.

Quoted 13 lines

Regards,
Libin

Quoted 9 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

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
Quoted 82 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Friday, November 11, 2016 4:41 PM
To: Yang, Libin <[email protected]>; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; [email protected]
Subject: RE: [PATCH v2] drm/i915/audio: fix hdmi audio noise issue

Quoted 27 lines · Libin

Hi Jani,

Quoted 25 lines

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

Quoted 15 lines · On Thu, 10 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

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")
---
 drivers/gpu/drm/i915/intel_audio.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
Quoted 6 lines
Quoted 6 lines

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

Quoted 6 lines
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

Quoted 32 lines
Quoted 32 lines

*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 · 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);

You did not address my review comment on the earlier version:

Quoted 2 lines
Quoted 2 lines

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 3 lines

Sorry, I missed your comments.

Quoted 8 lines
Quoted 2 lines

The first doing the HSW_AUD_M_CTS_ENABLE is to reset the M value to 0. The second doing the HSW_AUD_M_CTS_ENABLE is to let HW calculate the

M value.

Quoted 2 lines

Or we can just try to disable the HSW_AUD_M_CTS_ENABLE bit. What's

your opinion?

I would have thought just doing the latter would be sufficient. Please test.

I have done the test on 32KHz, 44.1KHz, 48KHz, 88KHz, it is OK.

Regards,
Libin

Quoted 13 lines

BR,
Jani.

Quoted 9 lines

Regards,
Libin

Quoted 5 lines

BR,
Jani.

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

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

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

--
Jani Nikula, Intel Open Source Technology Center

--
Jani Nikula, Intel Open Source Technology Center

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