From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH 05/18] [media] media-controller: enable all interface links at init
Date: Mon, 23 Nov 2015 21:46:53 +0200 [thread overview]
Message-ID: <29585066.DcXagjeG5R@avalon> (raw)
In-Reply-To: <2ddddaaaecbdbf624441793ca4c57e81530eaf05.1441559233.git.mchehab@osg.samsung.com>
Hi Mauro,
Thank you for the patch.
On Sunday 06 September 2015 14:30:48 Mauro Carvalho Chehab wrote:
> Interface links are normally enabled, meaning that the interfaces are
> bound to the entities. So, any ioctl send to the interface are reflected
s/send/sent/
> at the entities managed by the interface.
>
> However, when a device is usage, other interfaces for the same hardware
s/usage/in use/
> could be decoupled from the entities linked to them, because the
> hardware may have some parts busy.
>
> That's for example, what happens when an hybrid TV device is in usage.
s/usage/use/
> If it is streaming analog TV or capturing signals from S-Video/Composite
> connectors, typically the digital part of the hardware can't be used and
> vice-versa.
>
> This is generally due to some internal hardware or firmware limitation,
> that it is not easily mapped via data pipelines.
>
> What the Kernel drivers do internally is that they decouple the hardware
> from the interface. So, all changes, if allowed, are done only at some
> interface cache, but not physically changed at the hardware.
>
> The usage is similar to the usage of the MEDIA_LNK_FL_ENABLED on data
> links. So, let's use the same flag to indicate if ether the interface
s/ether/either/
> to entity link is bound/enabled or not.
I believe we'll need to experiment with the interface links to see what's
really needed there. As a general rule I'd like to avoid exposing too much
information to userspace without a clear indication that the information is
actually needed, as it's always easier to expose additional information later
than to remove information already exposed.
For this reason I'd like to see as a first step how we would do in userspace
without making those links dynamic. If we then realize that we're lacking
information we'll decide on the best course of action and on exactly what to
expose and how to expose it, using concrete userspace use cases.
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>
> diff --git a/drivers/media/dvb-core/dvbdev.c
> b/drivers/media/dvb-core/dvbdev.c index a8e7e2398f7a..5c4fb41060b4 100644
> --- a/drivers/media/dvb-core/dvbdev.c
> +++ b/drivers/media/dvb-core/dvbdev.c
> @@ -396,7 +396,8 @@ static void dvb_register_media_device(struct dvb_device
> *dvbdev, if (!dvbdev->entity || !dvbdev->intf_devnode)
> return;
>
> - media_create_intf_link(dvbdev->entity, &dvbdev->intf_devnode->intf, 0);
> + media_create_intf_link(dvbdev->entity, &dvbdev->intf_devnode->intf,
> + MEDIA_LNK_FL_ENABLED);
>
> #endif
> }
> @@ -583,20 +584,24 @@ void dvb_create_media_graph(struct dvb_adapter *adap)
> /* Create indirect interface links for FE->tuner, DVR->demux and CA->ca
*/
> media_device_for_each_intf(intf, mdev) {
> if (intf->type == MEDIA_INTF_T_DVB_CA && ca)
> - media_create_intf_link(ca, intf, 0);
> + media_create_intf_link(ca, intf, MEDIA_LNK_FL_ENABLED);
>
> if (intf->type == MEDIA_INTF_T_DVB_FE && tuner)
> - media_create_intf_link(tuner, intf, 0);
> + media_create_intf_link(tuner, intf,
> + MEDIA_LNK_FL_ENABLED);
>
> if (intf->type == MEDIA_INTF_T_DVB_DVR && demux)
> - media_create_intf_link(demux, intf, 0);
> + media_create_intf_link(demux, intf,
> + MEDIA_LNK_FL_ENABLED);
>
> media_device_for_each_entity(entity, mdev) {
> if (entity->type == MEDIA_ENT_T_DVB_TSOUT) {
> if (!strcmp(entity->name, DVR_TSOUT))
> - media_create_intf_link(entity, intf, 0);
> + media_create_intf_link(entity, intf,
> + MEDIA_LNK_FL_ENABLED);
> if (!strcmp(entity->name, DEMUX_TSOUT))
> - media_create_intf_link(entity, intf, 0);
> + media_create_intf_link(entity, intf,
> + MEDIA_LNK_FL_ENABLED);
> break;
> }
> }
> diff --git a/drivers/media/v4l2-core/v4l2-dev.c
> b/drivers/media/v4l2-core/v4l2-dev.c index 07123dd569c4..8429da66754a
> 100644
> --- a/drivers/media/v4l2-core/v4l2-dev.c
> +++ b/drivers/media/v4l2-core/v4l2-dev.c
> @@ -788,7 +788,8 @@ static int video_register_media_controller(struct
> video_device *vdev, int type) struct media_link *link;
>
> link = media_create_intf_link(&vdev->entity,
> - &vdev->intf_devnode->intf, 0);
> + &vdev->intf_devnode->intf,
> + MEDIA_LNK_FL_ENABLED);
> if (!link) {
> media_devnode_remove(vdev->intf_devnode);
> media_device_unregister_entity(&vdev->entity);
> diff --git a/drivers/media/v4l2-core/v4l2-device.c
> b/drivers/media/v4l2-core/v4l2-device.c index e788a085ba96..bb58d90fde5e
> 100644
> --- a/drivers/media/v4l2-core/v4l2-device.c
> +++ b/drivers/media/v4l2-core/v4l2-device.c
> @@ -256,7 +256,7 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device
> *v4l2_dev)
>
> link = media_create_intf_link(&sd->entity,
> &vdev->intf_devnode->intf,
> - 0);
> + MEDIA_LNK_FL_ENABLED);
> if (!link)
> goto clean_up;
> }
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-11-23 19:46 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-06 17:30 [PATCH 00/18] MC fixes, improvements and cleanups Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 01/18] [media] tuner-core: add an input pad Mauro Carvalho Chehab
2015-09-11 14:48 ` Hans Verkuil
2015-11-23 20:01 ` Laurent Pinchart
2015-11-24 11:00 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 02/18] [media] au0828: add support for the connectors Mauro Carvalho Chehab
2015-09-11 14:57 ` Hans Verkuil
2015-12-10 18:24 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 03/18] [media] au0828: Create connector links Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 04/18] [media] media-device: supress backlinks at G_TOPOLOGY ioctl Mauro Carvalho Chehab
2015-09-11 14:58 ` Hans Verkuil
2015-11-23 19:56 ` Laurent Pinchart
2015-11-24 10:57 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 05/18] [media] media-controller: enable all interface links at init Mauro Carvalho Chehab
2015-09-11 15:18 ` Hans Verkuil
2015-11-23 19:46 ` Laurent Pinchart [this message]
2015-12-10 11:37 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 06/18] [media] media.h: create connector entities for hybrid TV devices Mauro Carvalho Chehab
2015-09-11 15:19 ` Hans Verkuil
2015-11-23 18:09 ` Laurent Pinchart
2015-12-10 18:43 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 07/18] [media] dvbdev: returns error if graph object creation fails Mauro Carvalho Chehab
2015-09-11 15:20 ` Hans Verkuil
2015-12-10 17:33 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 08/18] [media] dvb core: must check dvb_create_media_graph() Mauro Carvalho Chehab
2015-09-11 15:22 ` Hans Verkuil
2015-09-06 17:30 ` [PATCH 09/18] [media] media-entity: enforce check of interface and links creation Mauro Carvalho Chehab
2015-09-11 15:23 ` Hans Verkuil
2015-09-06 17:30 ` [PATCH 10/18] [media] cx231xx: enforce check for graph creation Mauro Carvalho Chehab
2015-09-11 15:23 ` Hans Verkuil
2015-09-06 17:30 ` [PATCH 11/18] [media] au0828:: " Mauro Carvalho Chehab
2015-09-11 15:23 ` Hans Verkuil
2015-09-06 17:30 ` [PATCH 12/18] [media] media-entity: must check media_create_pad_link() Mauro Carvalho Chehab
2015-09-11 15:24 ` Hans Verkuil
2015-11-23 17:54 ` Laurent Pinchart
2015-12-10 19:13 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 13/18] [media] media-entity.h: rename entity.type to entity.function Mauro Carvalho Chehab
2015-09-11 15:25 ` Hans Verkuil
2015-11-23 17:51 ` Laurent Pinchart
2015-11-24 10:32 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 14/18] [media] media-device: export the entity function via new ioctl Mauro Carvalho Chehab
2015-09-11 15:26 ` Hans Verkuil
2015-11-23 17:46 ` Laurent Pinchart
2015-11-24 10:27 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 15/18] [media] uapi/media.h: Rename entities types to functions Mauro Carvalho Chehab
2015-09-11 15:36 ` Hans Verkuil
2015-12-10 19:54 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 16/18] [media] DocBook: update entities documentation Mauro Carvalho Chehab
2015-09-06 17:31 ` [PATCH 17/18] [media] dvbdev: move indirect links on dvr/demux to a separate function Mauro Carvalho Chehab
2015-09-11 15:38 ` Hans Verkuil
2015-09-06 17:31 ` [PATCH 18/18] [media] dvbdev: Don't create indirect links Mauro Carvalho Chehab
2015-09-11 15:48 ` Hans Verkuil
2015-12-10 20:20 ` Mauro Carvalho Chehab
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=29585066.DcXagjeG5R@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--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