intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915/audio: fix hdmi audio noise issue
@ 2016-11-10  5:14 libin.yang
  2016-11-10  5:47 ` ✓ Fi.CI.BAT: success for drm/i915/audio: fix hdmi audio noise issue (rev2) Patchwork
  2016-11-10 10:37 ` [PATCH v2] drm/i915/audio: fix hdmi audio noise issue Jani Nikula
  0 siblings, 2 replies; 6+ messages in thread
From: libin.yang @ 2016-11-10  5:14 UTC (permalink / raw)
  To: intel-gfx, jani.nikula, ville.syrjala, daniel.vetter, tiwai

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 | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 813fd74..a472d35 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -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);
 }
 
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-11  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-10  5:14 [PATCH v2] drm/i915/audio: fix hdmi audio noise issue libin.yang
2016-11-10  5:47 ` ✓ Fi.CI.BAT: success for drm/i915/audio: fix hdmi audio noise issue (rev2) Patchwork
2016-11-10 10:37 ` [PATCH v2] drm/i915/audio: fix hdmi audio noise issue Jani Nikula
2016-11-11  2:14   ` Yang, Libin
2016-11-11  8:41     ` Jani Nikula
2016-11-11  8:46       ` Yang, Libin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).