All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: libin.yang@intel.com, alsa-devel@alsa-project.org, tiwai@suse.de,
	intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch
Subject: Re: [PATCH v3 3/4] ALSA: hda - display audio call ncts	callback
Date: Mon, 10 Aug 2015 15:03:13 +0300	[thread overview]
Message-ID: <874mk78i66.fsf@intel.com> (raw)
In-Reply-To: <1439191931-25705-3-git-send-email-libin.yang@intel.com>

On Mon, 10 Aug 2015, libin.yang@intel.com wrote:
> From: Libin Yang <libin.yang@intel.com>
>
> On some Intel platforms, display audio need set N/CTS
> manually at some TMDS frequencies.
>
> Signed-off-by: Libin Yang <libin.yang@intel.com>
> ---
>  sound/pci/hda/patch_hdmi.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index a97db5f..918435e 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -1770,6 +1770,16 @@ static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid)
>  	return non_pcm;
>  }
>  
> +/* There is a fixed mapping between audio pin node and display port
> + * on current Intel platforms:
> + * Pin Widget 5 - PORT B (port = 1 in i915 driver)
> + * Pin Widget 6 - PORT C (port = 2 in i915 driver)
> + * Pin Widget 7 - PORT D (port = 3 in i915 driver)
> + */
> +static int intel_pin2port(hda_nid_t pin_nid)
> +{
> +	return pin_nid - 4;
> +}
>  
>  /*
>   * HDMI callbacks
> @@ -1786,6 +1796,8 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
>  	int pin_idx = hinfo_to_pin_index(codec, hinfo);
>  	struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
>  	hda_nid_t pin_nid = per_pin->pin_nid;
> +	struct snd_pcm_runtime *runtime = substream->runtime;
> +	struct i915_audio_component *acomp = codec->bus->core.audio_component;
>  	bool non_pcm;
>  	int pinctl;
>  
> @@ -1802,6 +1814,17 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
>  		intel_not_share_assigned_cvt(codec, pin_nid, per_pin->mux_idx);
>  	}
>  
> +	/* Set N/CTS for HSW, BDW and SKL platforms.
> +	 * These platforms need call set_ncts to set the N/CTS manually,
> +	 * otherwise there is no sound in some sample rates.
> +	 */
> +	if (is_haswell_plus(codec)) {

Maybe you should move this check to the graphics side, and do the call
whenever the callback is non-NULL, and you can be sure of the pin->port
mapping?

> +		/* Todo: add DP1.2 MST audio support later */
> +		if (acomp && acomp->ops && acomp->ops->set_ncts)
> +			acomp->ops->set_ncts(acomp->dev,
> +				intel_pin2port(pin_nid),
> +				0, runtime->rate);
> +	}
>  	non_pcm = check_non_pcm_per_cvt(codec, cvt_nid);
>  	mutex_lock(&per_pin->lock);
>  	per_pin->channels = substream->runtime->channels;
> -- 
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-08-10 12:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-10  7:32 [PATCH v2 1/4] drm/i915: Add audio set_ncts callback libin.yang
2015-08-10  7:32 ` [PATCH v2 2/4] drm/i915: implement " libin.yang
2015-08-10 12:00   ` Jani Nikula
2015-08-11  2:49     ` Yang, Libin
2015-08-12 13:04     ` Daniel Vetter
2015-08-12 14:31       ` Yang, Libin
2015-08-10 12:16   ` Jani Nikula
2015-08-11  2:55     ` Yang, Libin
2015-08-12 13:06     ` Daniel Vetter
2015-08-12 14:36       ` Yang, Libin
2015-08-12 14:45         ` Jani Nikula
2015-08-12 14:48           ` Yang, Libin
2015-08-10  7:32 ` [PATCH v3 3/4] ALSA: hda - display audio call ncts callback libin.yang
2015-08-10 12:03   ` Jani Nikula [this message]
2015-08-11  2:51     ` Yang, Libin
2015-08-10  7:32 ` [PATCH v4 4/4] drm/i915: set proper N/CTS in modeset libin.yang
2015-08-10  8:04   ` Takashi Iwai
2015-08-10  8:30     ` Yang, Libin
2015-08-10 12:10   ` Jani Nikula
2015-08-11  3:10     ` Yang, Libin
2015-08-11  7:13       ` Jani Nikula
2015-08-11  7:46         ` Yang, Libin
2015-08-11  8:14           ` Jani Nikula
2015-08-12  2:41             ` Yang, Libin
2015-08-12  6:20               ` Jani Nikula
2015-08-12  7:28                 ` Yang, Libin
2015-08-12 13:10                 ` Daniel Vetter
2015-08-12 13:23                   ` Jani Nikula
2015-08-12 13:43                     ` Daniel Vetter
2015-08-12 14:18                       ` Jani Nikula
2015-08-12 14:57                       ` Yang, Libin
2015-08-10 11:46 ` [PATCH v2 1/4] drm/i915: Add audio set_ncts callback Jani Nikula
2015-08-11  2:40   ` Yang, Libin
2015-08-12  3:16     ` Yang, Libin
2015-08-12  6:14       ` [Intel-gfx] " Jani Nikula
2015-08-11  5:51   ` Yang, Libin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mk78i66.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=libin.yang@intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.