All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Helen Fornazier <helen.fornazier@gmail.com>,
	linux-media@vger.kernel.org
Subject: Re: VIMC: API proposal, configuring the topology through user space
Date: Thu, 20 Aug 2015 02:33:15 +0300	[thread overview]
Message-ID: <1479402.af4JO5SPSd@avalon> (raw)
In-Reply-To: <20150818070636.22c23415@recife.lan>

Hi Mauro,

On Tuesday 18 August 2015 07:06:36 Mauro Carvalho Chehab wrote:
> Em Tue, 18 Aug 2015 09:35:14 +0300 Laurent Pinchart escreveu:
> > On Friday 14 August 2015 12:54:44 Hans Verkuil wrote:

[snip]

> > I think this is becoming too complex. How about considering "deploy" as a
> > commit instead ? There would then be no need to undeploy, any modification
> > will start a new transaction that will be applied in one go when
> > committed. This includes removal of entities by removing the corresponding
> > directories.
>
> Agreed. I would implement just a /configfs/vimc/commit file, instead of
> /configfs/vimc/vimc1/build_topology.
> 
> any write to the "commit" configfs file will make all changes to all vimc
> instances to be applied, or return an error if committing is not possible.

Wouldn't it be better to have a commit file inside each vimc[0-9]+ directory ? 
vimc device instances are completely independent, I'd prefer having the 
configuration API operate per-instance as well.

> A read to it would return a message saying if the changes were committed or
> not.
> 
> This way, an entire vimc instance could be removed with just:
> 
> 	rm -rf /configfs/vimc/vimc1
> 
> As we won't have unremoved files there anymore.

Some files will be automatically created by the kernel, such as the flags file 
in link directories, or the name file in entity directories. rm -rf might thus 
not work. That's a technical detail though, I haven't checked how configfs 
operates.

> In order to remove a
> group of objects:
> 	rm -rf /configfs/vimc/vimc1/[files that belong to the group]
> 
> The API also become simpler and clearer, IMHO.
> 
> Btw, as we discussed at the userspace API RFC, if we end by having a new
> type of graph object that represents a group of objects (MEDIA_ID_T_GROUP),

Let's see about that when the userspace API will be agreed on.

> that could be used, for example, to represent a project ARA hardware module,
> it would be easier to remove an entire group by doing something like:
> 
> 	rm -rf /configfs/vimc/vimc1/obj_group_1

[snip]

> >> I misunderstood your original proposal, I thought the name of the
> >> link_to_raw_capture_0 directory was interpreted by the driver to mean
> >> that a link between the pad and pad 0 of the raw_capture entity should
> >> be created. But you don't interpret the name at all.
> >> 
> >> I think this is confusing. Wouldn't it be easier to interpret the name
> >> of the link directory? I.e. it has to be of the form: link_to_<entity
> >> name>_<pad name>.
> > 
> > I'd rather use symlinks and no link directory at all, but then we'd have
> > no place to specify link flags :-/ I believe that's the reason why a link
> > directory is needed.
> > 
> > Maybe I worry for no reason, but interpreting the name seems to me more
> > error- prone than using a symlink inside the link directory.
> 
> Yeah, using symlinks makes perfect sense to me, although I'm not so sure
> of adding them inside the pads (/configfs/vimc/vimc0/sensor_a/pad_0/).
> If we do that, we'll need to represent both links and backlinks, with
> makes harder to remove them.

I don't think we need to specify both, the forward link should be enough.

> I would, instead, have a separate part of the configfs for the links:
> 
> /configfs/vimc/vimc0/links
> 
> 	and a link from sensor_a/pad_0 to raw_capture_1/pad_0/ would
> be represented as:
> 
> ../../sensor_a/pad_0 -> /configfs/vimc/vimc0/links/link0/source
> ../../raw_capture_1/pad_0 -> /configfs/vimc/vimc0/links/link0/sink
> 
> This way, if one wants to remove the link, he can do just:
> 
> 	rm -rf /configfs/vimc/vimc0/links/link0
> 
> Also, the direction of the link is properly expressed by using the
> names "source" and "sink" there.

That's an interesting option. The drawback is that you can't easily see links 
in the configfs entities directory tree. I'll think about it.

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2015-08-19 23:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-08  1:55 VIMC: API proposal, configuring the topology through user space Helen Fornazier
2015-08-08  9:33 ` Mauro Carvalho Chehab
2015-08-10 13:11 ` Hans Verkuil
2015-08-10 17:21   ` Helen Fornazier
2015-08-11  9:28     ` Hans Verkuil
2015-08-11  9:36       ` Mauro Carvalho Chehab
2015-08-11 10:34         ` Hans Verkuil
2015-08-11 11:03           ` Mauro Carvalho Chehab
2015-08-13 15:50           ` Laurent Pinchart
2015-08-11 20:07         ` Helen Fornazier
2015-08-13 17:29           ` Laurent Pinchart
2015-08-14 10:54             ` Hans Verkuil
2015-08-18  6:35               ` Laurent Pinchart
2015-08-18 10:06                 ` Mauro Carvalho Chehab
2015-08-19 23:33                   ` Laurent Pinchart [this message]
2015-08-20  3:13                     ` Mauro Carvalho Chehab
2015-08-20 23:41                       ` Laurent Pinchart
2015-08-25 10:52                         ` Helen Fornazier

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=1479402.af4JO5SPSd@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=helen.fornazier@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.