diff mbox series

[5/5] ALSA: hda: program stripe control for codec

Message ID 1547139805-1904-5-git-send-email-spujar@nvidia.com (mailing list archive)
State New, archived
Headers show
Series [1/5] ALSA: hda: add verbs for stripe control | expand

Commit Message

Sameer Pujar Jan. 10, 2019, 5:03 p.m. UTC
Program codec stripe through AC_VERB_SET_STRIPE_CONTROL to use multiple
sdo lines if supported. Audio needs to be striped across number of sdo
lines for simultaneous playbacks of higher resolutions to work.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
---
 sound/pci/hda/patch_hdmi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Takashi Iwai Jan. 11, 2019, 11:21 a.m. UTC | #1
On Thu, 10 Jan 2019 18:03:25 +0100,
Sameer Pujar wrote:
> 
> Program codec stripe through AC_VERB_SET_STRIPE_CONTROL to use multiple
> sdo lines if supported. Audio needs to be striped across number of sdo
> lines for simultaneous playbacks of higher resolutions to work.
> 
> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
> Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
> ---
>  sound/pci/hda/patch_hdmi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index 46f88dc..855e526 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -1865,7 +1865,7 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
>  	hda_nid_t pin_nid;
>  	struct snd_pcm_runtime *runtime = substream->runtime;
>  	bool non_pcm;
> -	int pinctl;
> +	int pinctl, stripe;
>  	int err = 0;
>  
>  	mutex_lock(&spec->pcm_lock);
> @@ -1909,6 +1909,10 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
>  	per_pin->channels = substream->runtime->channels;
>  	per_pin->setup = true;
>  
> +	stripe = snd_hdac_get_stream_stripe_ctl(&codec->bus->core, substream);
> +	snd_hda_codec_write(codec, cvt_nid, 0, AC_VERB_SET_STRIPE_CONTROL,
> +			    stripe);

This verb is supposed to be optional, hence it'd be safer to check the
widget capability before issuing.  I doubt whether all HDMI codecs
including the very old one support this verb.


thanks,

Takashi
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 46f88dc..855e526 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1865,7 +1865,7 @@  static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
 	hda_nid_t pin_nid;
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	bool non_pcm;
-	int pinctl;
+	int pinctl, stripe;
 	int err = 0;
 
 	mutex_lock(&spec->pcm_lock);
@@ -1909,6 +1909,10 @@  static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
 	per_pin->channels = substream->runtime->channels;
 	per_pin->setup = true;
 
+	stripe = snd_hdac_get_stream_stripe_ctl(&codec->bus->core, substream);
+	snd_hda_codec_write(codec, cvt_nid, 0, AC_VERB_SET_STRIPE_CONTROL,
+			    stripe);
+
 	hdmi_setup_audio_infoframe(codec, per_pin, non_pcm);
 	mutex_unlock(&per_pin->lock);
 	if (spec->dyn_pin_out) {