From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFC PATCH 3/3] videodev2.h: add entity_id to struct v4l2_capability
Date: Mon, 04 May 2015 01:31:59 +0300 [thread overview]
Message-ID: <6142421.YpIavoBsT0@avalon> (raw)
In-Reply-To: <1430480030-29136-4-git-send-email-hverkuil@xs4all.nl>
Hi Hans,
Thank you for the patch.
On Friday 01 May 2015 13:33:50 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> Export the entity ID (if any) of the video device.
I would postpone this until we finish the DVB+MC discussion and properly
define the relationship between device nodes and MC, as it could have
implications on the V4L2 side as well.
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
> Documentation/DocBook/media/v4l/vidioc-querycap.xml | 16 +++++++++++++++-
> drivers/media/v4l2-core/v4l2-ioctl.c | 7 +++++++
> include/uapi/linux/videodev2.h | 5 ++++-
> 3 files changed, 26 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/DocBook/media/v4l/vidioc-querycap.xml
> b/Documentation/DocBook/media/v4l/vidioc-querycap.xml index
> c1ed844..4a7737c 100644
> --- a/Documentation/DocBook/media/v4l/vidioc-querycap.xml
> +++ b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
> @@ -154,7 +154,14 @@ printf ("Version: %u.%u.%u\n",
> </row>
> <row>
> <entry>__u32</entry>
> - <entry><structfield>reserved</structfield>[3]</entry>
> + <entry><structfield>entity_id</structfield></entry>
> + <entry>The media controller entity ID of the device. This is only
> valid if
> + the <constant>V4L2_CAP_ENTITY</constant> capability is set.
> + </entry>
> + </row>
> + <row>
> + <entry>__u32</entry>
> + <entry><structfield>reserved</structfield>[2]</entry>
> <entry>Reserved for future extensions. Drivers must set
> this array to zero.</entry>
> </row>
> @@ -308,6 +315,13 @@ modulator programming see
> fields.</entry>
> </row>
> <row>
> + <entry><constant>V4L2_CAP_ENTITY</constant></entry>
> + <entry>0x00400000</entry>
> + <entry>The device is a media controller entity and
> + the <structfield>entity_id</structfield> field of &v4l2-capability;
> + is valid.</entry>
> + </row>
> + <row>
> <entry><constant>V4L2_CAP_READWRITE</constant></entry>
> <entry>0x01000000</entry>
> <entry>The device supports the <link
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
> b/drivers/media/v4l2-core/v4l2-ioctl.c index 1476602..5179611 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1011,6 +1011,7 @@ static void v4l_sanitize_format(struct v4l2_format
> *fmt) static int v4l_querycap(const struct v4l2_ioctl_ops *ops,
> struct file *file, void *fh, void *arg)
> {
> + struct video_device *vfd = video_devdata(file);
> struct v4l2_capability *cap = (struct v4l2_capability *)arg;
> int ret;
>
> @@ -1019,6 +1020,12 @@ static int v4l_querycap(const struct v4l2_ioctl_ops
> *ops, ret = ops->vidioc_querycap(file, fh, cap);
>
> cap->capabilities |= V4L2_CAP_EXT_PIX_FORMAT;
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + if (vfd->entity.parent) {
> + cap->capabilities |= V4L2_CAP_ENTITY;
> + cap->entity_id = vfd->entity.id;
> + }
> +#endif
> /*
> * Drivers MUST fill in device_caps, so check for this and
> * warn if it was forgotten.
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index fa376f7..af7a667 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -307,6 +307,7 @@ struct v4l2_fract {
> * @version: KERNEL_VERSION
> * @capabilities: capabilities of the physical device as a whole
> * @device_caps: capabilities accessed via this particular device (node)
> + * @entity_id: the media controller entity ID
> * @reserved: reserved fields for future extensions
> */
> struct v4l2_capability {
> @@ -316,7 +317,8 @@ struct v4l2_capability {
> __u32 version;
> __u32 capabilities;
> __u32 device_caps;
> - __u32 reserved[3];
> + __u32 entity_id;
> + __u32 reserved[2];
> };
>
> /* Values for 'capabilities' field */
> @@ -348,6 +350,7 @@ struct v4l2_capability {
>
> #define V4L2_CAP_SDR_CAPTURE 0x00100000 /* Is a SDR capture device */
> #define V4L2_CAP_EXT_PIX_FORMAT 0x00200000 /* Supports the extended
pixel
> format */ +#define V4L2_CAP_ENTITY 0x00400000 /* This is a
> Media Controller entity */
>
> #define V4L2_CAP_READWRITE 0x01000000 /* read/write
> systemcalls */ #define V4L2_CAP_ASYNCIO 0x02000000 /* async
> I/O */
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-05-04 7:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-01 11:33 [RFC PATCH 0/3] Add VIDIOC_SUBDEV_QUERYCAP Hans Verkuil
2015-05-01 11:33 ` [RFC PATCH 1/3] v4l2-subdev: add VIDIOC_SUBDEV_QUERYCAP ioctl Hans Verkuil
2015-05-03 22:20 ` Laurent Pinchart
2015-05-04 8:04 ` Hans Verkuil
2015-07-02 13:01 ` Sakari Ailus
2015-07-02 13:07 ` Hans Verkuil
2015-05-01 11:33 ` [RFC PATCH 2/3] DocBook/media: document VIDIOC_SUBDEV_QUERYCAP Hans Verkuil
2015-05-03 22:29 ` Laurent Pinchart
2015-05-04 7:58 ` Hans Verkuil
2015-05-01 11:33 ` [RFC PATCH 3/3] videodev2.h: add entity_id to struct v4l2_capability Hans Verkuil
2015-05-03 22:31 ` Laurent Pinchart [this message]
2015-05-01 11:41 ` [RFC PATCH 0/3] Add VIDIOC_SUBDEV_QUERYCAP Hans Verkuil
2015-05-03 22:33 ` Laurent Pinchart
2015-05-04 8:06 ` Hans Verkuil
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=6142421.YpIavoBsT0@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
/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