All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda - verify pin:converter connection on unsol event for HSW and VLV
@ 2014-06-12  6:42 mengdong.lin
  2014-06-12 10:00 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: mengdong.lin @ 2014-06-12  6:42 UTC (permalink / raw)
  To: alsa-devel, tiwai; +Cc: Mengdong Lin

From: Mengdong Lin <mengdong.lin@intel.com>

This patch will verify the pin's coverter selection for an active stream
when an unsol event reports this pin becomes available again after a display
mode change or hot-plug event.

For Haswell+ and Valleyview: display mode change or hot-plug can change the
transcoder:port connection and make all the involved audio pins share the 1st
converter. So the stream using 1st convertor will flow to multiple pins
but active streams using other converters will fail. This workaround
is to assure the pin selects the right conveter and an assigned converter is
not shared by other unused pins.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index be0a9ee..3e4417b 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1594,10 +1594,18 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
 		 * Re-setup pin and infoframe. This is needed e.g. when
 		 * - sink is first plugged-in (infoframe is not set up if !monitor_present)
 		 * - transcoder can change during stream playback on Haswell
+		 *   and this can make HW reset converter selection on a pin.
 		 */
-		if (eld->eld_valid && !old_eld_valid && per_pin->setup)
+		if (eld->eld_valid && !old_eld_valid && per_pin->setup) {
+			if (is_haswell_plus(codec) || is_valleyview(codec)) {
+				intel_verify_pin_cvt_connect(codec, per_pin);
+				intel_not_share_assigned_cvt(codec, pin_nid,
+							per_pin->mux_idx);
+			}
+
 			hdmi_setup_audio_infoframe(codec, per_pin,
 						   per_pin->non_pcm);
+		}
 	}
 
 	if (eld_changed)
-- 
1.8.1.2

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

* Re: [PATCH] ALSA: hda - verify pin:converter connection on unsol event for HSW and VLV
  2014-06-12  6:42 [PATCH] ALSA: hda - verify pin:converter connection on unsol event for HSW and VLV mengdong.lin
@ 2014-06-12 10:00 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2014-06-12 10:00 UTC (permalink / raw)
  To: mengdong.lin; +Cc: alsa-devel

At Thu, 12 Jun 2014 14:42:25 +0800,
mengdong.lin@intel.com wrote:
> 
> From: Mengdong Lin <mengdong.lin@intel.com>
> 
> This patch will verify the pin's coverter selection for an active stream
> when an unsol event reports this pin becomes available again after a display
> mode change or hot-plug event.
> 
> For Haswell+ and Valleyview: display mode change or hot-plug can change the
> transcoder:port connection and make all the involved audio pins share the 1st
> converter. So the stream using 1st convertor will flow to multiple pins
> but active streams using other converters will fail. This workaround
> is to assure the pin selects the right conveter and an assigned converter is
> not shared by other unused pins.
> 
> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>

Thanks, applied now with Cc to stable.


Takashi

> 
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index be0a9ee..3e4417b 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -1594,10 +1594,18 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
>  		 * Re-setup pin and infoframe. This is needed e.g. when
>  		 * - sink is first plugged-in (infoframe is not set up if !monitor_present)
>  		 * - transcoder can change during stream playback on Haswell
> +		 *   and this can make HW reset converter selection on a pin.
>  		 */
> -		if (eld->eld_valid && !old_eld_valid && per_pin->setup)
> +		if (eld->eld_valid && !old_eld_valid && per_pin->setup) {
> +			if (is_haswell_plus(codec) || is_valleyview(codec)) {
> +				intel_verify_pin_cvt_connect(codec, per_pin);
> +				intel_not_share_assigned_cvt(codec, pin_nid,
> +							per_pin->mux_idx);
> +			}
> +
>  			hdmi_setup_audio_infoframe(codec, per_pin,
>  						   per_pin->non_pcm);
> +		}
>  	}
>  
>  	if (eld_changed)
> -- 
> 1.8.1.2
> 

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

end of thread, other threads:[~2014-06-12 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-12  6:42 [PATCH] ALSA: hda - verify pin:converter connection on unsol event for HSW and VLV mengdong.lin
2014-06-12 10:00 ` 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.