Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>,
	"Zhang, Vivian" <vivian.zhang@intel.com>,
	alsa-devel@alsa-project.org, "Koul, Vinod" <vinod.koul@intel.com>
Subject: Re: [PATCH v2 2/3] ASoC: topology: Add topology core
Date: Thu, 28 May 2015 15:33:29 +0100	[thread overview]
Message-ID: <1432823609.2726.42.camel@loki> (raw)
In-Reply-To: <20150527190021.GO21577@sirena.org.uk>

On Wed, 2015-05-27 at 20:00 +0100, Mark Brown wrote:
> On Mon, May 25, 2015 at 06:22:49PM +0100, Liam Girdwood wrote:
> 
> This looks really nice at a high level, obviously it's a lot of code so
> there might be detail problems but I expect we can fix those up later.
> 
> > @@ -564,6 +565,7 @@ struct snd_soc_dapm_widget {
> >  	int num_kcontrols;
> >  	const struct snd_kcontrol_new *kcontrol_news;
> >  	struct snd_kcontrol **kcontrols;
> > +	struct snd_soc_dobj dobj;
> >  
> >  	/* widget input and outputs */
> >  	struct list_head sources;
> 
> This adds the dynamic object (which isn't enormous but isn't tiny) to
> every widget which could add up a bit.  I don't know if it's worth
> making it a pointer to a dobj and allocating that separately?  OTOH it's
> really routes rather than widgets that are the big cost, and it depends
> on allocators being friendly and not putting lots of padding round
> dobjs.  Definitely fixable incrementally if it is an issue though.
> 

Fwiw, we are planning to shrink DAPM a bit as part of the reduced memory
work that Keyon and Vivian are doing. This will be on the list.

> > +	/* external kcontrol init - used to set ext funcs + private data */
> > +	int (*control_load)(struct snd_soc_component *,
> > +		struct snd_kcontrol_new *, struct snd_soc_tplg_ctl_hdr *);
> > +	int (*control_unload)(struct snd_soc_component *,
> > +		struct snd_soc_dobj *);
> 
> Do we have examples of all these external users yet?  Just thinking
> about what happens if we need a load/unload function but the kernel
> doesn't know about this particular firmware type - the file didn't say
> code would be needed and perhaps the code is optional anyway (some
> optimisation or something).  Is that something that was thought about
> yet, what sort of uses are we expecting?

Vinod has some example code that has the callback on SKL (dont know if
it's on public git atm). The intention here was to allow the driver to
setup any configuration outside the standard kcontrol registration, so
it would be used for things like sending DSP IPC messages to create the
control in FW, or loading the private data into the DSP for that control
etc. The comment is probably misleading since the get/put/info function
binding is done in the core. I'll fix the comment for V3. 

> 
> > +/* pass vendor data to component driver for processing */
> > +static int soc_tplg_vendor_load_(struct soc_tplg *tplg,
> > +	struct snd_soc_tplg_hdr *hdr)
> > +{
> > +	int ret = 0;
> > +
> > +	if (tplg->comp && tplg->ops && tplg->ops->vendor_load)
> > +		ret = tplg->ops->vendor_load(tplg->comp, hdr);
> > +
> > +	if (ret < 0)
> > +		dev_err(tplg->dev,
> > +			"ASoC: vendor load failed at hdr offset %ld/0x%lx for type %d:%d\n",
> > +			soc_tplg_get_hdr_offset(tplg),
> > +			soc_tplg_get_hdr_offset(tplg),
> > +			hdr->type, hdr->vendor_type);
> > +	return ret;
> > +}
> 
> For example I wonder if we should warn if we don't have a handler for
> vendor data that we see?

Yes, will fix in V3.

  parent reply	other threads:[~2015-05-28 14:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 17:22 [PATCH v2 1/3] ASoC: topology: Add topology UAPI header Liam Girdwood
2015-05-25 17:22 ` [PATCH v2 2/3] ASoC: topology: Add topology core Liam Girdwood
2015-05-27 19:00   ` Mark Brown
2015-05-27 19:23     ` Lars-Peter Clausen
2015-05-27 19:48       ` Mark Brown
2015-05-28 14:45         ` Liam Girdwood
2015-05-28 15:23           ` Mark Brown
2015-05-28 14:33     ` Liam Girdwood [this message]
2015-05-29  5:57       ` Vinod Koul
2015-05-25 17:22 ` [PATCH v2 3/3] ALSA: topology: Export ID types for TLV controls Liam Girdwood
2015-05-28 14:47   ` Liam Girdwood
2015-05-28 14:59     ` Takashi Iwai
2015-05-26 10:33 ` [PATCH v2 1/3] ASoC: topology: Add topology UAPI header Mark Brown

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=1432823609.2726.42.camel@loki \
    --to=liam.r.girdwood@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.com \
    --cc=vivian.zhang@intel.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