From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>,
linux-media@vger.kernel.org, m.chehab@samsung.com,
gjasny@googlemail.com, hdegoede@redhat.com,
hans.verkuil@cisco.com, b.zolnierkie@samsung.com,
kyungmin.park@samsung.com, laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH/RFC v4 05/11] mediactl: Add media device graph helpers
Date: Mon, 01 Dec 2014 15:21:00 +0100 [thread overview]
Message-ID: <547C794C.1090105@samsung.com> (raw)
In-Reply-To: <547C5F4A.7050400@linux.intel.com>
Hi Sakari,
On 12/01/2014 01:30 PM, Sakari Ailus wrote:
> Hi Jacek,
>
> Jacek Anaszewski wrote:
> ...
>>>> +int media_get_busy_pads_by_entity(struct media_device *media,
>>>> + struct media_entity *entity,
>>>> + unsigned int type,
>>>> + struct media_pad **busy_pads,
>>>> + int *num_busy_pads)
>>>
>>> Are you looking for enabled links that someone else would have
>>> configured
>>> here?
>>
>> The assumption is made here that there will be no concurrent users of
>> a media device and an entity will have no more than one link connected
>> to its sink pad. If this assumption is not valid than all the links
>> in the pipeline would have to be defined in the media config and
>> the pipeline would have to be only validated not discovered.
>> By pipeline validation I mean checking whether all config links are
>> enabled
>
> You do get an error from MEDIA_IOC_LINK_SETUP if enabling a link fails.
My intention here was to discuss the situation when there is more
than one active link connected to an entity sink pad(s).
There are two options:
a) more than one active link connected to the same sink pad
(I don't know if this has been ever considered a valid arrangement)
b) more than one active link connected to separate sink pads
if the same entity.
In both cases discovering a pipeline will require different approach
than in the recent patch set, where there are only configurable
links expected in the media config and those fixed aren't taken
into account. After the config links are set up, the pipeline
is discovered by walking from the sink entity upstream, until
the entity with no sink pads is encountered.
If more than one link is connected to the sink pad(s) of
an entity the situation becomes ambiguous.
Therefore I propose to define all the links for the pipeline
in the media config. The fixed links could be marked with
relevant flags. By validating the pipeline I meant checking
whether all links from the media configuration file are
active.
>>> I think we should have a more generic solution to that. This one still
>>> does
>>> not guard against concurrent user space processes that attempt to
>>> configure
>>> the media device.
>>> One possibility would be to add IOCTLs to grant and release exclusive
>>> write
>>> (i.e. change configuration) access to the device. Once streaming is
>>> started,
>>> exclusive access could be released by the user. I wonder what Laurent
>>> would
>>> think about that. I think this would be very robust --- one could
>>> start with
>>> resetting all the links one can, and then configure those that are
>>> needed;
>>> if this fails, then the pipeline is already used by someone else and
>>> streaming cannot taken place on it. No cleanup of the configuration is
>>> needed.
>>
>> This approach would preclude having more than one pipeline configured
>> in a media device.
>
> That's not true. You can *configure* a single pipeline at once, but once
> that one is streaming (or write access is allowed from other file
> handles again), you can configure another one that does no conflict with
> the first one.
OK, I missed that.
>>> But this is definitely out of scope of this patchset (also because
>>> this is
>>> for the user space).
>>
>> Taking into account that there are cases when it would be useful
>> to allow for having more than one active pipelines in a media device
>> I think that we would require changes in the media controller API.
>>
>> I would hide from the user a possibility of reconfiguring the links
>> one by one, but instead provide an ioctl which would accept
>> a definition of a whole pipeline to be linked. Something
>> similar to extended controls.
>> A user space process calling such an ioctl would take the ownership
>> of the all involved sub-devices, and their linkage couldn't be
>> reconfigured until released.
>
> That does not mean someone else could reconfigure the links before you
> attempt to start streaming.
Therefore this ioctl should lock media device until VIDIOC_STREAMON
on the configured pipeline. I am not sure about other implications and
feasibility of such a design though.
Best Regards,
Jacek Anaszewski
next prev parent reply other threads:[~2014-12-01 14:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-21 16:14 [PATCH/RFC v4 00/11] Add a plugin for Exynos4 camera Jacek Anaszewski
2014-11-21 16:14 ` [PATCH/RFC v4 01/11] mediactl: Introduce v4l2_subdev structure Jacek Anaszewski
2014-11-25 11:36 ` Sakari Ailus
2014-11-25 12:22 ` Jacek Anaszewski
2014-11-26 10:20 ` Sakari Ailus
2014-11-21 16:14 ` [PATCH/RFC v4 02/11] mediactl: Add support for v4l2 controls Jacek Anaszewski
2014-11-21 16:14 ` [PATCH/RFC v4 03/11] mediactl: Separate entity and pad parsing Jacek Anaszewski
2014-11-21 16:14 ` [PATCH/RFC v4 04/11] mediatext: Add library Jacek Anaszewski
2014-11-21 16:14 ` [PATCH/RFC v4 05/11] mediactl: Add media device graph helpers Jacek Anaszewski
2014-11-28 17:06 ` Sakari Ailus
2014-12-01 11:23 ` Jacek Anaszewski
2014-12-01 12:30 ` Sakari Ailus
2014-12-01 14:21 ` Jacek Anaszewski [this message]
2014-11-21 16:14 ` [PATCH/RFC v4 06/11] mediactl: Add media_device creation helpers Jacek Anaszewski
2014-11-21 16:14 ` [PATCH/RFC v4 07/11] media-ctl: libv4l2subdev: add VYUY8_2X8 mbus code Jacek Anaszewski
2014-11-28 17:10 ` Sakari Ailus
2014-11-21 16:14 ` [PATCH/RFC v4 08/11] mediactl: Add support for media device pipelines Jacek Anaszewski
2014-11-21 16:14 ` [PATCH/RFC v4 09/11] mediactl: Close only pipeline sub-devices Jacek Anaszewski
2014-11-21 16:14 ` [PATCH/RFC v4 10/11] mediactl: Add media device ioctl API Jacek Anaszewski
2014-11-21 16:14 ` [PATCH/RFC v4 11/11] Add a libv4l plugin for Exynos4 camera Jacek Anaszewski
2014-11-27 8:41 ` Sakari Ailus
2014-11-28 13:29 ` Jacek Anaszewski
2015-02-27 9:32 ` Jacek Anaszewski
2015-03-15 19:07 ` Gregor Jasny
2015-03-16 8:54 ` Jacek Anaszewski
2015-03-15 19:12 ` Gregor Jasny
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=547C794C.1090105@samsung.com \
--to=j.anaszewski@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=gjasny@googlemail.com \
--cc=hans.verkuil@cisco.com \
--cc=hdegoede@redhat.com \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=sakari.ailus@iki.fi \
--cc=sakari.ailus@linux.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;
as well as URLs for NNTP newsgroup(s).