* [PATCHv3 01/20] media: add new types for DVB devnodes
[not found] <cover.1420578087.git.mchehab@osg.samsung.com>
@ 2015-01-06 21:08 ` Mauro Carvalho Chehab
[not found] ` <7f1ea82b1055aa490726f3af2ad22bca25e49a28.1420578087.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-01-06 21:08 ` [PATCHv3 09/20] tuner-core: properly initialize media controller subdev Mauro Carvalho Chehab
1 sibling, 1 reply; 8+ messages in thread
From: Mauro Carvalho Chehab @ 2015-01-06 21:08 UTC (permalink / raw)
To: Laurent Pinchart, Sakari Ailus
Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
Mauro Carvalho Chehab, linux-api
Most of the DVB subdevs have already their own devnode.
Add support for them at the media controller API.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
index 7902e800f019..707db275f92b 100644
--- a/include/uapi/linux/media.h
+++ b/include/uapi/linux/media.h
@@ -50,7 +50,14 @@ struct media_device_info {
#define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
#define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
#define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
-#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
+#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_DEVNODE + 4)
+#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_DEVNODE + 5)
+#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_DEVNODE + 6)
+#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_DEVNODE + 7)
+#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_DEVNODE + 8)
+
+/* Legacy symbol. Use it to avoid userspace compilation breakages */
+#define MEDIA_ENT_T_DEVNODE_DVB MEDIA_ENT_T_DEVNODE_DVB_FE
#define MEDIA_ENT_T_V4L2_SUBDEV (2 << MEDIA_ENT_TYPE_SHIFT)
#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV + 1)
--
2.1.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCHv3 09/20] tuner-core: properly initialize media controller subdev
[not found] <cover.1420578087.git.mchehab@osg.samsung.com>
2015-01-06 21:08 ` [PATCHv3 01/20] media: add new types for DVB devnodes Mauro Carvalho Chehab
@ 2015-01-06 21:08 ` Mauro Carvalho Chehab
1 sibling, 0 replies; 8+ messages in thread
From: Mauro Carvalho Chehab @ 2015-01-06 21:08 UTC (permalink / raw)
To: Laurent Pinchart, Sakari Ailus
Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
Mauro Carvalho Chehab, Hans Verkuil, Prabhakar Lad, linux-api
Properly initialize tuner core subdev at the media controller.
That requires a new subtype at the media controller API.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c
index 559f8372e2eb..9a83b27a7e8f 100644
--- a/drivers/media/v4l2-core/tuner-core.c
+++ b/drivers/media/v4l2-core/tuner-core.c
@@ -134,6 +134,9 @@ struct tuner {
unsigned int type; /* chip type id */
void *config;
const char *name;
+#if defined(CONFIG_MEDIA_CONTROLLER)
+ struct media_pad pad;
+#endif
};
/*
@@ -434,6 +437,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
t->name = analog_ops->info.name;
}
+ t->sd.entity.name = t->name;
+
tuner_dbg("type set to %s\n", t->name);
t->mode_mask = new_mode_mask;
@@ -592,6 +597,9 @@ static int tuner_probe(struct i2c_client *client,
struct tuner *t;
struct tuner *radio;
struct tuner *tv;
+#ifdef CONFIG_MEDIA_CONTROLLER
+ int ret;
+#endif
t = kzalloc(sizeof(struct tuner), GFP_KERNEL);
if (NULL == t)
@@ -684,6 +692,18 @@ static int tuner_probe(struct i2c_client *client,
/* Should be just before return */
register_client:
+#if defined(CONFIG_MEDIA_CONTROLLER)
+ t->pad.flags = MEDIA_PAD_FL_SOURCE;
+ t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER;
+ t->sd.entity.name = t->name;
+
+ ret = media_entity_init(&t->sd.entity, 1, &t->pad, 0);
+ if (ret < 0) {
+ tuner_err("failed to initialize media entity!\n");
+ kfree(t);
+ return -ENODEV;
+ }
+#endif
/* Sets a default mode */
if (t->mode_mask & T_ANALOG_TV)
t->mode = V4L2_TUNER_ANALOG_TV;
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
index 707db275f92b..5ffde035789b 100644
--- a/include/uapi/linux/media.h
+++ b/include/uapi/linux/media.h
@@ -66,6 +66,8 @@ struct media_device_info {
/* A converter of analogue video to its digital representation. */
#define MEDIA_ENT_T_V4L2_SUBDEV_DECODER (MEDIA_ENT_T_V4L2_SUBDEV + 4)
+#define MEDIA_ENT_T_V4L2_SUBDEV_TUNER (MEDIA_ENT_T_V4L2_SUBDEV + 5)
+
#define MEDIA_ENT_FL_DEFAULT (1 << 0)
struct media_entity_desc {
--
2.1.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCHv3 01/20] media: add new types for DVB devnodes
[not found] ` <7f1ea82b1055aa490726f3af2ad22bca25e49a28.1420578087.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
@ 2015-01-07 14:09 ` Sakari Ailus
[not found] ` <54AD3E00.5070208-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Sakari Ailus @ 2015-01-07 14:09 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Laurent Pinchart
Cc: Linux Media Mailing List, Mauro Carvalho Chehab,
linux-api-u79uwXL29TY76Z2rM5mHXA
Hi Mauro,
Mauro Carvalho Chehab wrote:
> Most of the DVB subdevs have already their own devnode.
>
> Add support for them at the media controller API.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
>
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index 7902e800f019..707db275f92b 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -50,7 +50,14 @@ struct media_device_info {
> #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
> #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
> #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
> -#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
> +#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_DEVNODE + 4)
> +#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_DEVNODE + 5)
> +#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_DEVNODE + 6)
> +#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_DEVNODE + 7)
> +#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_DEVNODE + 8)
I'd create another type for the DVB sub-type devices, as there is for
V4L2 sub-devices. I wonder what Laurent thinks.
> +
> +/* Legacy symbol. Use it to avoid userspace compilation breakages */
> +#define MEDIA_ENT_T_DEVNODE_DVB MEDIA_ENT_T_DEVNODE_DVB_FE
>
> #define MEDIA_ENT_T_V4L2_SUBDEV (2 << MEDIA_ENT_TYPE_SHIFT)
> #define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV + 1)
>
--
Kind regards,
Sakari Ailus
sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHv3 01/20] media: add new types for DVB devnodes
[not found] ` <54AD3E00.5070208-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2015-01-07 14:22 ` Mauro Carvalho Chehab
[not found] ` <20150107122239.232d1f56-iErKd7e5oVp+urZeOPWqwQ@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Mauro Carvalho Chehab @ 2015-01-07 14:22 UTC (permalink / raw)
To: Sakari Ailus
Cc: Laurent Pinchart, Linux Media Mailing List, Mauro Carvalho Chehab,
linux-api-u79uwXL29TY76Z2rM5mHXA
Em Wed, 07 Jan 2015 16:09:04 +0200
Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> escreveu:
> Hi Mauro,
>
> Mauro Carvalho Chehab wrote:
> > Most of the DVB subdevs have already their own devnode.
> >
> > Add support for them at the media controller API.
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
> >
> > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> > index 7902e800f019..707db275f92b 100644
> > --- a/include/uapi/linux/media.h
> > +++ b/include/uapi/linux/media.h
> > @@ -50,7 +50,14 @@ struct media_device_info {
> > #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
> > #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
> > #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
> > -#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
> > +#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_DEVNODE + 4)
> > +#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_DEVNODE + 5)
> > +#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_DEVNODE + 6)
> > +#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_DEVNODE + 7)
> > +#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_DEVNODE + 8)
>
> I'd create another type for the DVB sub-type devices, as there is for
> V4L2 sub-devices. I wonder what Laurent thinks.
I discussed this quickly with Laurent on IRC.
There are some concept differences between V4L2 and DVB.
At v4l2:
- the spec is one monolitic header (videodev2.h);
- one devnode is used to control everyhing (/dev/video?)
- there is one v4l core for all types of devices
At DVB:
- each different DVB API has its own header;
- each DVB device type has its own core (ok, they're
linked into one module, but internally they're almost independent);
- each different DVB API has its own devnode.
So, using "SUBDEV" for DVB (or at least for the devnodes) don't
make much sense.
Ok, there are still some things at DVB side that could be mapped as
subdev. The clear example is the tuner. However, in this case, the
same tuner can be either V4L, DVB or both. So, we need to define just
one subdev type for the tuner.
Also, each DVB device can be identified via major/minor pairs.
I wrote already (and submitted upstream) the patches for media-ctl to
recognize them. They're also on my experimental v4l-utils tree:
http://git.linuxtv.org/cgit.cgi/mchehab/experimental-v4l-utils.git/log/?h=dvb-media-ctl
Regards,
Mauro
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHv3 01/20] media: add new types for DVB devnodes
[not found] ` <20150107122239.232d1f56-iErKd7e5oVp+urZeOPWqwQ@public.gmane.org>
@ 2015-01-08 16:10 ` Laurent Pinchart
2015-01-08 17:44 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2015-01-08 16:10 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Sakari Ailus, Linux Media Mailing List, Mauro Carvalho Chehab,
linux-api-u79uwXL29TY76Z2rM5mHXA
Hi Mauro,
On Wednesday 07 January 2015 12:22:39 Mauro Carvalho Chehab wrote:
> Em Wed, 07 Jan 2015 16:09:04 +0200 Sakari Ailus escreveu:
> > Mauro Carvalho Chehab wrote:
> > > Most of the DVB subdevs have already their own devnode.
> > >
> > > Add support for them at the media controller API.
> > >
> > > Signed-off-by: Mauro Carvalho Chehab <mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
> > >
> > > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> > > index 7902e800f019..707db275f92b 100644
> > > --- a/include/uapi/linux/media.h
> > > +++ b/include/uapi/linux/media.h
> > > @@ -50,7 +50,14 @@ struct media_device_info {
> > >
> > > #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
> > > #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
> > > #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
> > >
> > > -#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
> > > +#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_DEVNODE + 4)
> > > +#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_DEVNODE + 5)
> > > +#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_DEVNODE + 6)
> > > +#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_DEVNODE + 7)
> > > +#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_DEVNODE + 8)
> >
> > I'd create another type for the DVB sub-type devices, as there is for
> > V4L2 sub-devices. I wonder what Laurent thinks.
>
> I discussed this quickly with Laurent on IRC.
>
> There are some concept differences between V4L2 and DVB.
>
> At v4l2:
> - the spec is one monolitic header (videodev2.h);
> - one devnode is used to control everyhing (/dev/video?)
> - there is one v4l core for all types of devices
>
> At DVB:
> - each different DVB API has its own header;
> - each DVB device type has its own core (ok, they're
> linked into one module, but internally they're almost independent);
> - each different DVB API has its own devnode.
>
> So, using "SUBDEV" for DVB (or at least for the devnodes) don't
> make much sense.
>
> Ok, there are still some things at DVB side that could be mapped as
> subdev. The clear example is the tuner. However, in this case, the
> same tuner can be either V4L, DVB or both. So, we need to define just
> one subdev type for the tuner.
>
> Also, each DVB device can be identified via major/minor pairs.
>
> I wrote already (and submitted upstream) the patches for media-ctl to
> recognize them. They're also on my experimental v4l-utils tree:
> http://git.linuxtv.org/cgit.cgi/mchehab/experimental-v4l-> utils.git/log/?h=dvb-media-ctl
As I've mentioned in a previous discussion, the media_entity type field is too
restrictive. Not only does this use case show that we need a type, sub-type
and sub-sub-type, there are also entities that implement several distinct
types. I thus believe we need a new ioctl is needed to expose detailed
information about entities. This topic has been discussed numerous times in
the past, it "just" requires someone to implement it.
I'm not opposed to a short-term solution like the one proposed here, but maybe
we should instead decide it's time to implement the new ioctl instead.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHv3 01/20] media: add new types for DVB devnodes
2015-01-08 16:10 ` Laurent Pinchart
@ 2015-01-08 17:44 ` Mauro Carvalho Chehab
[not found] ` <20150108154450.654d04d6-iErKd7e5oVp+urZeOPWqwQ@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Mauro Carvalho Chehab @ 2015-01-08 17:44 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Sakari Ailus, Linux Media Mailing List, Mauro Carvalho Chehab,
linux-api-u79uwXL29TY76Z2rM5mHXA
Em Thu, 08 Jan 2015 18:10:13 +0200
Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> escreveu:
> Hi Mauro,
>
> On Wednesday 07 January 2015 12:22:39 Mauro Carvalho Chehab wrote:
> > Em Wed, 07 Jan 2015 16:09:04 +0200 Sakari Ailus escreveu:
> > > Mauro Carvalho Chehab wrote:
> > > > Most of the DVB subdevs have already their own devnode.
> > > >
> > > > Add support for them at the media controller API.
> > > >
> > > > Signed-off-by: Mauro Carvalho Chehab <mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
> > > >
> > > > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> > > > index 7902e800f019..707db275f92b 100644
> > > > --- a/include/uapi/linux/media.h
> > > > +++ b/include/uapi/linux/media.h
> > > > @@ -50,7 +50,14 @@ struct media_device_info {
> > > >
> > > > #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
> > > > #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
> > > > #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
> > > >
> > > > -#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
> > > > +#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_DEVNODE + 4)
> > > > +#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_DEVNODE + 5)
> > > > +#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_DEVNODE + 6)
> > > > +#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_DEVNODE + 7)
> > > > +#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_DEVNODE + 8)
> > >
> > > I'd create another type for the DVB sub-type devices, as there is for
> > > V4L2 sub-devices. I wonder what Laurent thinks.
> >
> > I discussed this quickly with Laurent on IRC.
> >
> > There are some concept differences between V4L2 and DVB.
> >
> > At v4l2:
> > - the spec is one monolitic header (videodev2.h);
> > - one devnode is used to control everyhing (/dev/video?)
> > - there is one v4l core for all types of devices
> >
> > At DVB:
> > - each different DVB API has its own header;
> > - each DVB device type has its own core (ok, they're
> > linked into one module, but internally they're almost independent);
> > - each different DVB API has its own devnode.
> >
> > So, using "SUBDEV" for DVB (or at least for the devnodes) don't
> > make much sense.
> >
> > Ok, there are still some things at DVB side that could be mapped as
> > subdev. The clear example is the tuner. However, in this case, the
> > same tuner can be either V4L, DVB or both. So, we need to define just
> > one subdev type for the tuner.
> >
> > Also, each DVB device can be identified via major/minor pairs.
> >
> > I wrote already (and submitted upstream) the patches for media-ctl to
> > recognize them. They're also on my experimental v4l-utils tree:
> > http://git.linuxtv.org/cgit.cgi/mchehab/experimental-v4l-> utils.git/log/?h=dvb-media-ctl
>
> As I've mentioned in a previous discussion, the media_entity type field is too
> restrictive. Not only does this use case show that we need a type, sub-type
> and sub-sub-type, there are also entities that implement several distinct
> types. I thus believe we need a new ioctl is needed to expose detailed
> information about entities. This topic has been discussed numerous times in
> the past, it "just" requires someone to implement it.
>
> I'm not opposed to a short-term solution like the one proposed here, but maybe
> we should instead decide it's time to implement the new ioctl instead.
>
Ok, so let's stick with it for DVB. At DVB side, I don't see a need for
sub-sub-type, especially since DVB has no subdevs (except for the shared
tuner between DVB and V4L). Everything there are devnodes, with their
functionality strictly following the documentation, as the API is fully
handled inside the DVB core[1].
Also, I don't want to mix adding DVB media controller support with the
addition of a new ioctl.
[1] For the non-deprecated DVB devnodes. DVB have 3 devnode types that
are deprecated because they implement functionality found elsewhere
(video, audio and OSD dvb APIs). Only one legacy driver implements it,
and there's no plan to ever add media controller or expand/accept
new drivers using those legacy APIs.
Regards,
Mauro
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHv3 01/20] media: add new types for DVB devnodes
[not found] ` <20150108154450.654d04d6-iErKd7e5oVp+urZeOPWqwQ@public.gmane.org>
@ 2015-01-11 13:54 ` Laurent Pinchart
2015-01-11 14:09 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2015-01-11 13:54 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Sakari Ailus, Linux Media Mailing List, Mauro Carvalho Chehab,
linux-api-u79uwXL29TY76Z2rM5mHXA
Hi Mauro,
On Thursday 08 January 2015 15:44:50 Mauro Carvalho Chehab wrote:
> Em Thu, 08 Jan 2015 18:10:13 +0200 Laurent Pinchart escreveu:
> > On Wednesday 07 January 2015 12:22:39 Mauro Carvalho Chehab wrote:
> >> Em Wed, 07 Jan 2015 16:09:04 +0200 Sakari Ailus escreveu:
> >>> Mauro Carvalho Chehab wrote:
> >>>> Most of the DVB subdevs have already their own devnode.
> >>>>
> >>>> Add support for them at the media controller API.
> >>>>
> >>>> Signed-off-by: Mauro Carvalho Chehab <mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
> >>>>
> >>>> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> >>>> index 7902e800f019..707db275f92b 100644
> >>>> --- a/include/uapi/linux/media.h
> >>>> +++ b/include/uapi/linux/media.h
> >>>> @@ -50,7 +50,14 @@ struct media_device_info {
> >>>>
> >>>> #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
> >>>> #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
> >>>> #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
> >>>>
> >>>> -#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
> >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_DEVNODE + 4)
> >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_DEVNODE + 5)
> >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_DEVNODE + 6)
> >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_DEVNODE + 7)
> >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_DEVNODE + 8)
> >>>
> >>> I'd create another type for the DVB sub-type devices, as there is for
> >>> V4L2 sub-devices. I wonder what Laurent thinks.
> >>
> >> I discussed this quickly with Laurent on IRC.
> >>
> >> There are some concept differences between V4L2 and DVB.
> >>
> >> At v4l2:
> >> - the spec is one monolitic header (videodev2.h);
> >> - one devnode is used to control everyhing (/dev/video?)
> >> - there is one v4l core for all types of devices
> >>
> >> At DVB:
> >> - each different DVB API has its own header;
> >> - each DVB device type has its own core (ok, they're
> >> linked into one module, but internally they're almost independent);
> >> - each different DVB API has its own devnode.
> >>
> >> So, using "SUBDEV" for DVB (or at least for the devnodes) don't
> >> make much sense.
> >>
> >> Ok, there are still some things at DVB side that could be mapped as
> >> subdev. The clear example is the tuner. However, in this case, the
> >> same tuner can be either V4L, DVB or both. So, we need to define just
> >> one subdev type for the tuner.
> >>
> >> Also, each DVB device can be identified via major/minor pairs.
> >>
> >> I wrote already (and submitted upstream) the patches for media-ctl to
> >>
> >> recognize them. They're also on my experimental v4l-utils tree:
> >> http://git.linuxtv.org/cgit.cgi/mchehab/experimental-v4l-> >> utils.git/log/?h=dvb-media-ctl>
> >
> > As I've mentioned in a previous discussion, the media_entity type field is
> > too restrictive. Not only does this use case show that we need a type,
> > sub-type and sub-sub-type, there are also entities that implement several
> > distinct types. I thus believe we need a new ioctl is needed to expose
> > detailed information about entities. This topic has been discussed
> > numerous times in the past, it "just" requires someone to implement it.
> >
> > I'm not opposed to a short-term solution like the one proposed here, but
> > maybe we should instead decide it's time to implement the new ioctl
> > instead.
>
> Ok, so let's stick with it for DVB. At DVB side, I don't see a need for
> sub-sub-type, especially since DVB has no subdevs (except for the shared
> tuner between DVB and V4L). Everything there are devnodes, with their
> functionality strictly following the documentation, as the API is fully
> handled inside the DVB core[1].
At the moment the MC API has a devnode type with a DVB devnode subtype.
Splitting DVB devnodes into different categories effectively create sub-
subtypes. That's what bothers mode, the type field is becoming a ragbag.
> Also, I don't want to mix adding DVB media controller support with the
> addition of a new ioctl.
*If* we conclude that a new ioctl is needed to support DVB in a clean way, I
don't see why that new ioctl shouldn't be considered as a prerequisite.
> [1] For the non-deprecated DVB devnodes. DVB have 3 devnode types that
> are deprecated because they implement functionality found elsewhere
> (video, audio and OSD dvb APIs). Only one legacy driver implements it,
> and there's no plan to ever add media controller or expand/accept
> new drivers using those legacy APIs.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHv3 01/20] media: add new types for DVB devnodes
2015-01-11 13:54 ` Laurent Pinchart
@ 2015-01-11 14:09 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 8+ messages in thread
From: Mauro Carvalho Chehab @ 2015-01-11 14:09 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Sakari Ailus, Linux Media Mailing List, Mauro Carvalho Chehab,
linux-api-u79uwXL29TY76Z2rM5mHXA
Em Sun, 11 Jan 2015 15:54:14 +0200
Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> escreveu:
> Hi Mauro,
>
> On Thursday 08 January 2015 15:44:50 Mauro Carvalho Chehab wrote:
> > Em Thu, 08 Jan 2015 18:10:13 +0200 Laurent Pinchart escreveu:
> > > On Wednesday 07 January 2015 12:22:39 Mauro Carvalho Chehab wrote:
> > >> Em Wed, 07 Jan 2015 16:09:04 +0200 Sakari Ailus escreveu:
> > >>> Mauro Carvalho Chehab wrote:
> > >>>> Most of the DVB subdevs have already their own devnode.
> > >>>>
> > >>>> Add support for them at the media controller API.
> > >>>>
> > >>>> Signed-off-by: Mauro Carvalho Chehab <mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
> > >>>>
> > >>>> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> > >>>> index 7902e800f019..707db275f92b 100644
> > >>>> --- a/include/uapi/linux/media.h
> > >>>> +++ b/include/uapi/linux/media.h
> > >>>> @@ -50,7 +50,14 @@ struct media_device_info {
> > >>>>
> > >>>> #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
> > >>>> #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
> > >>>> #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
> > >>>>
> > >>>> -#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
> > >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_DEVNODE + 4)
> > >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_DEVNODE + 5)
> > >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_DEVNODE + 6)
> > >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_DEVNODE + 7)
> > >>>> +#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_DEVNODE + 8)
> > >>>
> > >>> I'd create another type for the DVB sub-type devices, as there is for
> > >>> V4L2 sub-devices. I wonder what Laurent thinks.
> > >>
> > >> I discussed this quickly with Laurent on IRC.
> > >>
> > >> There are some concept differences between V4L2 and DVB.
> > >>
> > >> At v4l2:
> > >> - the spec is one monolitic header (videodev2.h);
> > >> - one devnode is used to control everyhing (/dev/video?)
> > >> - there is one v4l core for all types of devices
> > >>
> > >> At DVB:
> > >> - each different DVB API has its own header;
> > >> - each DVB device type has its own core (ok, they're
> > >> linked into one module, but internally they're almost independent);
> > >> - each different DVB API has its own devnode.
> > >>
> > >> So, using "SUBDEV" for DVB (or at least for the devnodes) don't
> > >> make much sense.
> > >>
> > >> Ok, there are still some things at DVB side that could be mapped as
> > >> subdev. The clear example is the tuner. However, in this case, the
> > >> same tuner can be either V4L, DVB or both. So, we need to define just
> > >> one subdev type for the tuner.
> > >>
> > >> Also, each DVB device can be identified via major/minor pairs.
> > >>
> > >> I wrote already (and submitted upstream) the patches for media-ctl to
> > >>
> > >> recognize them. They're also on my experimental v4l-utils tree:
> > >> http://git.linuxtv.org/cgit.cgi/mchehab/experimental-v4l-> >> utils.git/log/?h=dvb-media-ctl>
> > >
> > > As I've mentioned in a previous discussion, the media_entity type field is
> > > too restrictive. Not only does this use case show that we need a type,
> > > sub-type and sub-sub-type, there are also entities that implement several
> > > distinct types. I thus believe we need a new ioctl is needed to expose
> > > detailed information about entities. This topic has been discussed
> > > numerous times in the past, it "just" requires someone to implement it.
> > >
> > > I'm not opposed to a short-term solution like the one proposed here, but
> > > maybe we should instead decide it's time to implement the new ioctl
> > > instead.
> >
> > Ok, so let's stick with it for DVB. At DVB side, I don't see a need for
> > sub-sub-type, especially since DVB has no subdevs (except for the shared
> > tuner between DVB and V4L). Everything there are devnodes, with their
> > functionality strictly following the documentation, as the API is fully
> > handled inside the DVB core[1].
>
> At the moment the MC API has a devnode type with a DVB devnode subtype.
> Splitting DVB devnodes into different categories effectively create sub-
> subtypes. That's what bothers mode, the type field is becoming a ragbag.
As I explained before, and more detailed at:
http://www.spinics.net/lists/linux-media/msg85229.html
DVB is actually 3 different APIs (demux, frontend and CA). Those APIs
are independent, and each have an independent devnode. The dvr is a
special case: it is a devnode that doesn't accept ioctl's. It is just
an output devnode, controlled vis the demux API.
The only thing in common to those 3 APIs is that they belong to the same
device type. But some may argue that, on an hybrid device, the input,
remote controller and even V4L2 are also sub-types.
In any case, they're all devnodes, so MEDIA_ENT_T_DEVNODE_foo fits well.
>
> > Also, I don't want to mix adding DVB media controller support with the
> > addition of a new ioctl.
>
> *If* we conclude that a new ioctl is needed to support DVB in a clean way, I
> don't see why that new ioctl shouldn't be considered as a prerequisite.
I don't see the need of a new ioctl for DVB. DVB is even simpler than V4L2,
as it doesn't have subdevs (except for tuner).
>
> > [1] For the non-deprecated DVB devnodes. DVB have 3 devnode types that
> > are deprecated because they implement functionality found elsewhere
> > (video, audio and OSD dvb APIs). Only one legacy driver implements it,
> > and there's no plan to ever add media controller or expand/accept
> > new drivers using those legacy APIs.
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-01-11 14:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1420578087.git.mchehab@osg.samsung.com>
2015-01-06 21:08 ` [PATCHv3 01/20] media: add new types for DVB devnodes Mauro Carvalho Chehab
[not found] ` <7f1ea82b1055aa490726f3af2ad22bca25e49a28.1420578087.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-01-07 14:09 ` Sakari Ailus
[not found] ` <54AD3E00.5070208-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-01-07 14:22 ` Mauro Carvalho Chehab
[not found] ` <20150107122239.232d1f56-iErKd7e5oVp+urZeOPWqwQ@public.gmane.org>
2015-01-08 16:10 ` Laurent Pinchart
2015-01-08 17:44 ` Mauro Carvalho Chehab
[not found] ` <20150108154450.654d04d6-iErKd7e5oVp+urZeOPWqwQ@public.gmane.org>
2015-01-11 13:54 ` Laurent Pinchart
2015-01-11 14:09 ` Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 09/20] tuner-core: properly initialize media controller subdev Mauro Carvalho Chehab
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).