From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Kai Vehmanen <kai.vehmanen@linux.intel.com>,
alsa-devel@alsa-project.org, tiwai@suse.de
Cc: intel-gfx@lists.freedesktop.org,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/3] ALSA: hda/hdmi: fix i915 silent stream programming flow
Date: Thu, 8 Dec 2022 17:25:21 +0100 [thread overview]
Message-ID: <5dd6e067-bc93-ad01-8cf2-3bb5c9a45443@linux.intel.com> (raw)
In-Reply-To: <20221208154358.3848764-2-kai.vehmanen@linux.intel.com>
On 12/8/2022 4:43 PM, Kai Vehmanen wrote:
> 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: 15175a4f2bbb ("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 <kai.vehmanen@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Tested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> sound/pci/hda/patch_hdmi.c | 23 +++++++++++++++++++++--
> 1 file changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index 7a40ddfd695a..a0ba24165ae2 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -2879,9 +2879,28 @@ static int i915_hsw_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
> hda_nid_t pin_nid, int dev_id, u32 stream_tag,
> int format)
> {
> + struct hdmi_spec *spec = codec->spec;
> + int pin_idx = pin_id_to_pin_index(codec, pin_nid, dev_id);
Shouldn't return value from pin_id_to_pin_index() be checked? It seems
that it can return -EINVAL.
> + struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
> + int res;
> +
> haswell_verify_D0(codec, cvt_nid, pin_nid);
> - return hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id,
> - stream_tag, format);
> +
> + if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) {
> + silent_stream_set_kae(codec, per_pin, false);
> + /* wait for pending transfers in codec to clear */
> + usleep_range(100, 200);
> + }
> +
> + res = hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id,
> + stream_tag, format);
> +
> + if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) {
> + usleep_range(100, 200);
> + silent_stream_set_kae(codec, per_pin, true);
> + }
> +
> + return res;
> }
>
> /* pin_cvt_fixup ops override for HSW+ and VLV+ */
next prev parent reply other threads:[~2022-12-08 16:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-08 15:43 [Intel-gfx] [PATCH 0/3] ALSA: hda/hdmi: i915 keepalive fixes Kai Vehmanen
2022-12-08 15:43 ` [Intel-gfx] [PATCH 1/3] ALSA: hda/hdmi: fix i915 silent stream programming flow Kai Vehmanen
2022-12-08 16:25 ` Amadeusz Sławiński [this message]
2022-12-09 8:42 ` Kai Vehmanen
2022-12-08 15:43 ` [Intel-gfx] [PATCH 2/3] ALSA: hda/hdmi: set default audio parameters for KAE silent-stream Kai Vehmanen
2022-12-08 15:43 ` [Intel-gfx] [PATCH 3/3] ALSA: hda/hdmi: fix stream-id config keep-alive for rt suspend Kai Vehmanen
2022-12-08 18:26 ` [Intel-gfx] ✓ Fi.CI.BAT: success for ALSA: hda/hdmi: i915 keepalive fixes Patchwork
2022-12-09 9:51 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
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=5dd6e067-bc93-ad01-8cf2-3bb5c9a45443@linux.intel.com \
--to=amadeuszx.slawinski@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rodrigo.vivi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox