All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ALSA: hda - program ICT bits to support HBR audio
@ 2017-09-19 22:25 Pierre-Louis Bossart
  2017-09-20 10:00 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-19 22:25 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Sriram Periyasamy, broonie, Subhransu S . Prusty,
	Pierre-Louis Bossart

From: Sriram Periyasamy <sriramx.periyasamy@intel.com>

On recent Intel platforms (Haswell, Broadwell, Skylake, ApolloLake,
KabyLake, ...), the IEC Coding Type (ICT) bitfield in the Digital
Converter Control #3 needs to be set explicitly for HDMI/DisplayPort
High Bit Rate (HBR) audio playback to work. This was not required in
earlier platforms when HBR was first introduced. The ICT bits are
defined in Section 7.3.3.9 of the HDaudio 1.0a specification.

Since the ICT bitfield was not specified for HDAudio 1.0 devices
(before 2009), we only program it on machines more recent than
Haswell.

We tested that this fix is not needed on Baytrail-I (MinnowBoard
Turbot) and believe by extension it also does not apply to Braswell.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98797

Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
---
v2: move digi3 verb in Set section, only set ICT for haswell and newer

 include/sound/hda_verbs.h  |  1 +
 sound/pci/hda/patch_hdmi.c | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/include/sound/hda_verbs.h b/include/sound/hda_verbs.h
index d0509db6d0ec..d2004d7feb2b 100644
--- a/include/sound/hda_verbs.h
+++ b/include/sound/hda_verbs.h
@@ -54,6 +54,7 @@ enum {
 #define AC_VERB_GET_EAPD_BTLENABLE		0x0f0c
 #define AC_VERB_GET_DIGI_CONVERT_1		0x0f0d
 #define AC_VERB_GET_DIGI_CONVERT_2		0x0f0e /* unused */
+#define AC_VERB_SET_DIGI_CONVERT_3		0x73e
 #define AC_VERB_GET_VOLUME_KNOB_CONTROL		0x0f0f
 /* f10-f1a: GPIO */
 #define AC_VERB_GET_GPIO_DATA			0x0f15
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 53f9311370de..8566de298ea3 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -906,6 +906,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
 			      hda_nid_t pin_nid, u32 stream_tag, int format)
 {
 	struct hdmi_spec *spec = codec->spec;
+	unsigned int param;
 	int err;
 
 	err = spec->ops.pin_hbr_setup(codec, pin_nid, is_hbr_format(format));
@@ -915,6 +916,26 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
 		return err;
 	}
 
+	if (is_haswell_plus(codec)) {
+
+		/*
+		 * on recent platforms IEC Coding Type is required for HBR
+		 * support, read current Digital Converter settings and set
+		 * ICT bitfield if needed.
+		 */
+		param = snd_hda_codec_read(codec, cvt_nid, 0,
+					   AC_VERB_GET_DIGI_CONVERT_1, 0);
+
+		param = (param >> 16) & ~(AC_DIG3_ICT);
+
+		/* on recent platforms ICT mode is required for HBR support */
+		if (is_hbr_format(format))
+			param |= 0x1;
+
+		snd_hda_codec_write(codec, cvt_nid, 0,
+				    AC_VERB_SET_DIGI_CONVERT_3, param);
+	}
+
 	snd_hda_codec_setup_stream(codec, cvt_nid, stream_tag, 0, format);
 	return 0;
 }
-- 
2.11.0

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

* Re: [PATCH v2] ALSA: hda - program ICT bits to support HBR audio
  2017-09-19 22:25 [PATCH v2] ALSA: hda - program ICT bits to support HBR audio Pierre-Louis Bossart
@ 2017-09-20 10:00 ` Takashi Iwai
  2017-09-20 13:12   ` Pierre-Louis Bossart
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2017-09-20 10:00 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: Sriram Periyasamy, alsa-devel, broonie, Subhransu S . Prusty

On Wed, 20 Sep 2017 00:25:05 +0200,
Pierre-Louis Bossart wrote:
> 
> From: Sriram Periyasamy <sriramx.periyasamy@intel.com>
> 
> On recent Intel platforms (Haswell, Broadwell, Skylake, ApolloLake,
> KabyLake, ...), the IEC Coding Type (ICT) bitfield in the Digital
> Converter Control #3 needs to be set explicitly for HDMI/DisplayPort
> High Bit Rate (HBR) audio playback to work. This was not required in
> earlier platforms when HBR was first introduced. The ICT bits are
> defined in Section 7.3.3.9 of the HDaudio 1.0a specification.
> 
> Since the ICT bitfield was not specified for HDAudio 1.0 devices
> (before 2009), we only program it on machines more recent than
> Haswell.
> 
> We tested that this fix is not needed on Baytrail-I (MinnowBoard
> Turbot) and believe by extension it also does not apply to Braswell.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98797
> 
> Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> ---
> v2: move digi3 verb in Set section, only set ICT for haswell and newer

Applied now with a slight fix (moving *_SET_* definition to the right
place).


thanks,

Takashi

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

* Re: [PATCH v2] ALSA: hda - program ICT bits to support HBR audio
  2017-09-20 10:00 ` Takashi Iwai
@ 2017-09-20 13:12   ` Pierre-Louis Bossart
  2017-09-25 14:56     ` Subhransu S. Prusty
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-20 13:12 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Sriram Periyasamy, alsa-devel, broonie, Subhransu S . Prusty

On 9/20/17 5:00 AM, Takashi Iwai wrote:
> On Wed, 20 Sep 2017 00:25:05 +0200,
> Pierre-Louis Bossart wrote:
>>
>> From: Sriram Periyasamy <sriramx.periyasamy@intel.com>
>>
>> On recent Intel platforms (Haswell, Broadwell, Skylake, ApolloLake,
>> KabyLake, ...), the IEC Coding Type (ICT) bitfield in the Digital
>> Converter Control #3 needs to be set explicitly for HDMI/DisplayPort
>> High Bit Rate (HBR) audio playback to work. This was not required in
>> earlier platforms when HBR was first introduced. The ICT bits are
>> defined in Section 7.3.3.9 of the HDaudio 1.0a specification.
>>
>> Since the ICT bitfield was not specified for HDAudio 1.0 devices
>> (before 2009), we only program it on machines more recent than
>> Haswell.
>>
>> We tested that this fix is not needed on Baytrail-I (MinnowBoard
>> Turbot) and believe by extension it also does not apply to Braswell.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98797
>>
>> Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
>> ---
>> v2: move digi3 verb in Set section, only set ICT for haswell and newer
> 
> Applied now with a slight fix (moving *_SET_* definition to the right
> place).

Thanks Takashi. Not sure what happened since I have a clear memory of 
doing that change and making a note of it...

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

* Re: [PATCH v2] ALSA: hda - program ICT bits to support HBR audio
  2017-09-20 13:12   ` Pierre-Louis Bossart
@ 2017-09-25 14:56     ` Subhransu S. Prusty
  2017-10-02  9:26       ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Subhransu S. Prusty @ 2017-09-25 14:56 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: Takashi Iwai, Sriram Periyasamy, alsa-devel, broonie

On Wed, Sep 20, 2017 at 08:12:36AM -0500, Pierre-Louis Bossart wrote:
> On 9/20/17 5:00 AM, Takashi Iwai wrote:
> >On Wed, 20 Sep 2017 00:25:05 +0200,
> >Pierre-Louis Bossart wrote:
> >>
> >>From: Sriram Periyasamy <sriramx.periyasamy@intel.com>
> >>
> >>On recent Intel platforms (Haswell, Broadwell, Skylake, ApolloLake,
> >>KabyLake, ...), the IEC Coding Type (ICT) bitfield in the Digital
> >>Converter Control #3 needs to be set explicitly for HDMI/DisplayPort
> >>High Bit Rate (HBR) audio playback to work. This was not required in
> >>earlier platforms when HBR was first introduced. The ICT bits are
> >>defined in Section 7.3.3.9 of the HDaudio 1.0a specification.
> >>
> >>Since the ICT bitfield was not specified for HDAudio 1.0 devices
> >>(before 2009), we only program it on machines more recent than
> >>Haswell.
> >>
> >>We tested that this fix is not needed on Baytrail-I (MinnowBoard
> >>Turbot) and believe by extension it also does not apply to Braswell.
> >>
> >>Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98797
> >>
> >>Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
> >>Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> >>Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> >>---
> >>v2: move digi3 verb in Set section, only set ICT for haswell and newer
> >
> >Applied now with a slight fix (moving *_SET_* definition to the right
> >place).
> 
> Thanks Takashi. Not sure what happened since I have a clear memory
> of doing that change and making a note of it...

Hi Takashi,

I think this patch should have also gone to stable. We didn't cc. Please
suggest whether we should submit it separately for stable.

Regards,
Subhransu

> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

-- 

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

* Re: [PATCH v2] ALSA: hda - program ICT bits to support HBR audio
  2017-09-25 14:56     ` Subhransu S. Prusty
@ 2017-10-02  9:26       ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2017-10-02  9:26 UTC (permalink / raw)
  To: Subhransu S. Prusty
  Cc: Sriram Periyasamy, alsa-devel, broonie, Pierre-Louis Bossart

On Mon, 25 Sep 2017 16:56:53 +0200,
Subhransu S. Prusty wrote:
> 
> On Wed, Sep 20, 2017 at 08:12:36AM -0500, Pierre-Louis Bossart wrote:
> > On 9/20/17 5:00 AM, Takashi Iwai wrote:
> > >On Wed, 20 Sep 2017 00:25:05 +0200,
> > >Pierre-Louis Bossart wrote:
> > >>
> > >>From: Sriram Periyasamy <sriramx.periyasamy@intel.com>
> > >>
> > >>On recent Intel platforms (Haswell, Broadwell, Skylake, ApolloLake,
> > >>KabyLake, ...), the IEC Coding Type (ICT) bitfield in the Digital
> > >>Converter Control #3 needs to be set explicitly for HDMI/DisplayPort
> > >>High Bit Rate (HBR) audio playback to work. This was not required in
> > >>earlier platforms when HBR was first introduced. The ICT bits are
> > >>defined in Section 7.3.3.9 of the HDaudio 1.0a specification.
> > >>
> > >>Since the ICT bitfield was not specified for HDAudio 1.0 devices
> > >>(before 2009), we only program it on machines more recent than
> > >>Haswell.
> > >>
> > >>We tested that this fix is not needed on Baytrail-I (MinnowBoard
> > >>Turbot) and believe by extension it also does not apply to Braswell.
> > >>
> > >>Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98797
> > >>
> > >>Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
> > >>Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > >>Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > >>---
> > >>v2: move digi3 verb in Set section, only set ICT for haswell and newer
> > >
> > >Applied now with a slight fix (moving *_SET_* definition to the right
> > >place).
> > 
> > Thanks Takashi. Not sure what happened since I have a clear memory
> > of doing that change and making a note of it...
> 
> Hi Takashi,
> 
> I think this patch should have also gone to stable. We didn't cc. Please
> suggest whether we should submit it separately for stable.

In such a case, please send a mail to Greg KH once after the patch
gets merged to Linus tree and tell him the upstream git commit id to
cherry-pick for stable kernels.


thanks,

Takashi

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

end of thread, other threads:[~2017-10-02  9:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-19 22:25 [PATCH v2] ALSA: hda - program ICT bits to support HBR audio Pierre-Louis Bossart
2017-09-20 10:00 ` Takashi Iwai
2017-09-20 13:12   ` Pierre-Louis Bossart
2017-09-25 14:56     ` Subhransu S. Prusty
2017-10-02  9:26       ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.