[PATCH] ALSA: hda/hdmi: fix silent stream for first playback to DP

Takashi Iwai tiwai at suse.de
Thu Dec 10 16:54:58 CET 2020


On Thu, 10 Dec 2020 16:39:54 +0100,
Kai Vehmanen wrote:
> +static void silent_stream_disable(struct hda_codec *codec,
> +				  struct hdmi_spec_per_pin *per_pin)
> +{
> +	struct hdmi_spec *spec = codec->spec;
> +	struct hdmi_spec_per_cvt *per_cvt;
> +	int cvt_idx;
> +
> +	if (!per_pin->silent_stream)
> +		return;
> +
> +	codec_dbg(codec, "HDMI: disable silent stream on pin-NID=0x%x cvt-NID=0x%x\n",
> +		  per_pin->pin_nid, per_pin->cvt_nid);
> +
> +	cvt_idx = cvt_nid_to_cvt_index(codec, per_pin->cvt_nid);
> +	if (cvt_idx >= 0 && cvt_idx < spec->num_cvts) {
> +		per_cvt = get_cvt(spec, cvt_idx);
> +		per_cvt->assigned = 0;
> +	}
> +
> +	per_pin->cvt_nid = 0;
> +	per_pin->silent_stream = false;
> +}

Better to protect with per_pin->lock?


thanks,

Takashi


More information about the Alsa-devel mailing list