From: Takashi Iwai <tiwai@suse.de>
To: Nikhil Mahale <nmahale@nvidia.com>
Cc: alsa-devel@alsa-project.org, tiwai@suse.com, aplattner@nvidia.com
Subject: Re: [alsa-devel] [PATCH v2 2/5] ALSA: hda - Add DP-MST jack support
Date: Fri, 15 Nov 2019 14:12:55 +0100 [thread overview]
Message-ID: <s5hd0dtjnag.wl-tiwai@suse.de> (raw)
In-Reply-To: <20191115095606.22392-3-nmahale@nvidia.com>
On Fri, 15 Nov 2019 10:56:03 +0100,
Nikhil Mahale wrote:
>
> static struct hda_jack_tbl *
> -snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid)
> +snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id)
> {
> - struct hda_jack_tbl *jack = snd_hda_jack_tbl_get(codec, nid);
> + struct hda_jack_tbl *jack =
> + snd_hda_jack_tbl_get_mst(codec, nid, dev_id);
> + struct hda_jack_tbl *existing_nid_jack =
> + any_jack_tbl_get_from_nid(codec, nid);
> +
> + WARN_ON(dev_id != 0 && !codec->dp_mst);
> +
> if (jack)
> return jack;
> jack = snd_array_new(&codec->jacktbl);
> if (!jack)
> return NULL;
> jack->nid = nid;
> + jack->dev_id = dev_id;
> jack->jack_dirty = 1;
> - jack->tag = codec->jacktbl.used;
> + if (!existing_nid_jack)
> + jack->tag = codec->jacktbl.used;
> + else
> + jack->tag = existing_nid_jack->tag;
> +
> return jack;
> }
In this logic, we assign the same tag to multiple jack objects, and
this will lead to the multiple calls of SET_UNSOLICITED_ENABLE on the
same pin. But this should be only once at parsing, and the rest
resume init will be done from the codec regmap cache, so it's not too
bad, I guess.
Alternatively we can set 0 to jack->tag when existing_nid_jack!=NULL,
too, and skip SET_UNSOLICITED_ENABLE for tag==0. But this will make
*_get_from_tag() won't work as you intended, hence the step will be
- get the jack once via snd_hda_jack_tbl_get_from_tag(tag)
- get the jack again with snd_hda_jack_tbl_get_mst(jack->nid, dev_id)
But it's more complex, and not better, either.
thanks,
Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2019-11-15 13:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 9:56 [alsa-devel] [PATCH v2 0/5] ALSA: hda - Add DP-MST support for NVIDIA codecs Nikhil Mahale
2019-11-15 9:56 ` [alsa-devel] [PATCH v2 1/5] ALSA: hda - Rename snd_hda_pin_sense to snd_hda_jack_pin_sense Nikhil Mahale
2019-11-15 9:56 ` [alsa-devel] [PATCH v2 2/5] ALSA: hda - Add DP-MST jack support Nikhil Mahale
2019-11-15 13:12 ` Takashi Iwai [this message]
2019-11-19 4:45 ` Nikhil Mahale
2019-11-19 6:47 ` Takashi Iwai
2019-11-15 9:56 ` [alsa-devel] [PATCH v2 3/5] ALSA: hda - Add DP-MST conn list support Nikhil Mahale
2019-11-15 9:56 ` [alsa-devel] [PATCH v2 4/5] ALSA: hda - Add DP-MST support for non-acomp codecs Nikhil Mahale
2019-11-15 9:56 ` [alsa-devel] [PATCH v2 5/5] ALSA: hda - Add DP-MST support for NVIDIA codecs Nikhil Mahale
2019-11-15 13:15 ` Takashi Iwai
2019-11-19 8:44 ` Nikhil Mahale
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=s5hd0dtjnag.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=aplattner@nvidia.com \
--cc=nmahale@nvidia.com \
--cc=tiwai@suse.com \
/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