Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nikhil Mahale <nmahale@nvidia.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, tiwai@suse.com, aplattner@nvidia.com
Subject: Re: [alsa-devel] [PATCH v1 5/5] ALSA: hda - Add DP-MST support for NVIDIA codecs
Date: Thu, 14 Nov 2019 17:20:29 +0530	[thread overview]
Message-ID: <9a27790c-2d30-8622-8e38-1ff547de4c3a@nvidia.com> (raw)
In-Reply-To: <s5hmucyn2jt.wl-tiwai@suse.de>

On 11/14/19 4:32 PM, Takashi Iwai wrote:
> On Thu, 14 Nov 2019 04:37:04 +0100,
> Nikhil Mahale wrote:
>>
>> @@ -3494,11 +3500,86 @@ static const struct drm_audio_component_audio_ops nvhdmi_audio_ops = {
>>  	.master_unbind = generic_acomp_master_unbind,
>>  };
>>  
>> +static int nvhdmi_find_pcm_slot(struct hdmi_spec *spec,
>> +				struct hdmi_spec_per_pin *per_pin)
>> +{
>> +	int i;
>> +
>> +	/*
>> +	 * generic_hdmi_build_pcms() allocates (num_nids + dev_num - 1)
>> +	 * number of pcms.
>> +	 *
>> +	 * The per_pin of pin_nid_idx=n and dev_id=m prefers to get pcm-n if m==0.
>> +	 * This guarantees that dynamic pcm assignments are compatible with the
>> +	 * legacy static per_pin-pmc assignment that existed in the days before
>> +	 * DP-MST.
>> +	 *
>> +	 * per_pin of m!=0 prefers to get pcm=(num_nids + (m - 1)).
>> +	 */
>> +	if (per_pin->dev_id == 0 &&
>> +	    !test_bit(per_pin->pin_nid_idx, &spec->pcm_bitmap))
>> +		return per_pin->pin_nid_idx;
>> +
>> +	if (per_pin->dev_id != 0 &&
>> +	    !(test_bit(spec->num_nids + (per_pin->dev_id - 1),
>> +		&spec->pcm_bitmap))) {
>> +		return spec->num_nids + (per_pin->dev_id - 1);
>> +	}
>> +
>> +	/* have a second try; check the area over num_nids */
>> +	for (i = spec->num_nids; i < spec->pcm_used; i++) {
>> +		if (!test_bit(i, &spec->pcm_bitmap))
>> +			return i;
>> +	}
>> +
>> +	/* the last try; check the empty slots in pins */
>> +	for (i = 0; i < spec->num_nids; i++) {
>> +		if (!test_bit(i, &spec->pcm_bitmap))
>> +			return i;
>> +	}
>> +	return -EBUSY;
>> +}
> 
> I think this can be applied for Intel case, too.  No need for creating
> yet another indirect branch.

Do you mean I should replace existing logic in hdmi_find_pcm_slot()
by this new logic?

Thanks,
Nikhil Mahale

> thanks,
> 
> Takashi
> 

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-11-14 11:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14  3:36 [alsa-devel] [PATCH v1 0/5] ALSA: hda - Add DP-MST support for NVIDIA codecs Nikhil Mahale
2019-11-14  3:37 ` [alsa-devel] [PATCH v1 1/5] ALSA: hda - Rename snd_hda_pin_sense to snd_hda_jack_pin_sense Nikhil Mahale
2019-11-14  3:37 ` [alsa-devel] [PATCH v1 2/5] ALSA: hda - Add DP-MST jack support Nikhil Mahale
2019-11-14 10:46   ` Kai Vehmanen
2019-11-15  9:39     ` Nikhil Mahale
2019-11-14 10:54   ` Takashi Iwai
2019-11-15  9:46     ` Nikhil Mahale
2019-11-14  3:37 ` [alsa-devel] [PATCH v1 3/5] ALSA: hda - Add DP-MST conn list support Nikhil Mahale
2019-11-14 10:57   ` Takashi Iwai
2019-11-14 11:47     ` Nikhil Mahale
2019-11-14 13:14       ` Takashi Iwai
2019-11-15  9:52         ` Nikhil Mahale
2019-11-15 10:30           ` Takashi Iwai
2019-11-19  8:43             ` Nikhil Mahale
2019-11-14  3:37 ` [alsa-devel] [PATCH v1 4/5] ALSA: hda - Add DP-MST support for non-acomp codecs Nikhil Mahale
2019-11-14  3:37 ` [alsa-devel] [PATCH v1 5/5] ALSA: hda - Add DP-MST support for NVIDIA codecs Nikhil Mahale
2019-11-14 11:02   ` Takashi Iwai
2019-11-14 11:50     ` Nikhil Mahale [this message]
2019-11-14 13:15       ` Takashi Iwai
2019-11-14 10:38 ` [alsa-devel] [PATCH v1 0/5] " Takashi Iwai
2019-11-15  9:37   ` 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=9a27790c-2d30-8622-8e38-1ff547de4c3a@nvidia.com \
    --to=nmahale@nvidia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=aplattner@nvidia.com \
    --cc=tiwai@suse.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