Skip to content

Commit ada261b

Browse files
kv2019itiwai
authored andcommitted
ALSA: hda/hdmi: fix i915 silent stream programming flow
The i915 display codec may not successfully transition to normal audio streaming mode, if the stream id is programmed while codec is actively transmitting data. This can happen when silent stream is enabled in KAE mode. Fix the issue by implementing a i915 specific programming flow, where the silent streaming is temporarily stopped, a small delay is applied to ensure display codec becomes idle, and then proceed with reprogramming the stream ID. Fixes: 15175a4 ("ALSA: hda/hdmi: add keep-alive support for ADL-P and DG2") Link: https://gitlab.freedesktop.org/drm/intel/-/issues/7353 Signed-off-by: Kai Vehmanen <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Tested-by: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 084ca21 commit ada261b

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,9 +2879,33 @@ static int i915_hsw_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
28792879
hda_nid_t pin_nid, int dev_id, u32 stream_tag,
28802880
int format)
28812881
{
2882+
struct hdmi_spec *spec = codec->spec;
2883+
int pin_idx = pin_id_to_pin_index(codec, pin_nid, dev_id);
2884+
struct hdmi_spec_per_pin *per_pin;
2885+
int res;
2886+
2887+
if (pin_idx < 0)
2888+
per_pin = NULL;
2889+
else
2890+
per_pin = get_pin(spec, pin_idx);
2891+
28822892
haswell_verify_D0(codec, cvt_nid, pin_nid);
2883-
return hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id,
2884-
stream_tag, format);
2893+
2894+
if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) {
2895+
silent_stream_set_kae(codec, per_pin, false);
2896+
/* wait for pending transfers in codec to clear */
2897+
usleep_range(100, 200);
2898+
}
2899+
2900+
res = hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id,
2901+
stream_tag, format);
2902+
2903+
if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) {
2904+
usleep_range(100, 200);
2905+
silent_stream_set_kae(codec, per_pin, true);
2906+
}
2907+
2908+
return res;
28852909
}
28862910

28872911
/* pin_cvt_fixup ops override for HSW+ and VLV+ */

0 commit comments

Comments
 (0)