From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
niklas.soderlund+renesas@ragnatech.se,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
satish.nagireddy@getcruise.com
Subject: Re: [PATCH v4 4/8] v4l2-ctl/compliance: Add simple routing test
Date: Mon, 24 Apr 2023 11:04:21 +0300 [thread overview]
Message-ID: <20230424080421.GI4926@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20230421124428.393261-5-tomi.valkeinen@ideasonboard.com>
Hi Tomi,
Thank you for the patch.
On Fri, Apr 21, 2023 at 03:44:24PM +0300, Tomi Valkeinen wrote:
> Add a very simple test for
> VIDIOC_SUBDEV_G_ROUTING/VIDIOC_SUBDEV_S_ROUTING.
>
> We can't (at least at the moment) really know here what kind of routings
> the driver would accept, but we can test a VIDIOC_SUBDEV_G_ROUTING call,
> followed by a VIDIOC_SUBDEV_S_ROUTING call with the routing we
> received.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
> utils/v4l2-compliance/v4l2-compliance.cpp | 12 ++++++++++++
> utils/v4l2-compliance/v4l2-compliance.h | 1 +
> utils/v4l2-compliance/v4l2-test-subdevs.cpp | 16 ++++++++++++++++
> 3 files changed, 29 insertions(+)
>
> diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
> index a147604c..7c3a688b 100644
> --- a/utils/v4l2-compliance/v4l2-compliance.cpp
> +++ b/utils/v4l2-compliance/v4l2-compliance.cpp
> @@ -1241,6 +1241,18 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_
> node.is_passthrough_subdev = has_source && has_sink;
>
> if (has_routes) {
> + printf("Sub-Device routing ioctls:\n");
> +
> + for (unsigned which = V4L2_SUBDEV_FORMAT_TRY;
> + which <= V4L2_SUBDEV_FORMAT_ACTIVE; which++) {
> +
> + printf("\ttest %s VIDIOC_SUBDEV_G_ROUTING/VIDIOC_SUBDEV_S_ROUTING: %s\n",
> + which ? "Active" : "Try",
> + ok(testSubDevRouting(&node, which)));
Weird indentation.
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> + }
> +
> + printf("\n");
> +
> for (unsigned which = V4L2_SUBDEV_FORMAT_TRY;
> which <= V4L2_SUBDEV_FORMAT_ACTIVE; which++) {
>
> diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
> index 0cd43980..35b2274b 100644
> --- a/utils/v4l2-compliance/v4l2-compliance.h
> +++ b/utils/v4l2-compliance/v4l2-compliance.h
> @@ -375,6 +375,7 @@ int testSubDevEnum(struct node *node, unsigned which, unsigned pad, unsigned str
> int testSubDevFormat(struct node *node, unsigned which, unsigned pad, unsigned stream);
> int testSubDevSelection(struct node *node, unsigned which, unsigned pad, unsigned stream);
> int testSubDevFrameInterval(struct node *node, unsigned pad, unsigned stream);
> +int testSubDevRouting(struct node *node, unsigned which);
>
> // Buffer ioctl tests
> int testReqBufs(struct node *node);
> diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> index 07192bda..962d9244 100644
> --- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> @@ -551,3 +551,19 @@ int testSubDevSelection(struct node *node, unsigned which, unsigned pad, unsigne
>
> return have_sel ? 0 : ENOTTY;
> }
> +
> +int testSubDevRouting(struct node *node, unsigned which)
> +{
> + struct v4l2_subdev_routing routing = {};
> + struct v4l2_subdev_route routes[256] = {};
> +
> + routing.which = which;
> + routing.routes = (__u64)&routes;
> + routing.num_routes = 256;
> +
> + fail_on_test(doioctl(node, VIDIOC_SUBDEV_G_ROUTING, &routing));
> +
> + fail_on_test(doioctl(node, VIDIOC_SUBDEV_S_ROUTING, &routing));
> +
> + return 0;
> +}
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2023-04-24 8:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 12:44 [PATCH v4 0/8] v4l-utils: Support multiplexed streams Tomi Valkeinen
2023-04-21 12:44 ` [PATCH v4 1/8] v4l2-ctl: Add routing and streams support Tomi Valkeinen
2023-04-24 7:04 ` Laurent Pinchart
2023-05-29 7:02 ` Tomi Valkeinen
2023-05-29 7:47 ` Laurent Pinchart
2023-04-21 12:44 ` [PATCH v4 2/8] media-ctl: Add support for routes and streams Tomi Valkeinen
2023-04-24 7:29 ` Laurent Pinchart
2023-05-29 7:34 ` Tomi Valkeinen
2023-05-29 7:49 ` Laurent Pinchart
2023-05-29 8:14 ` Tomi Valkeinen
2023-04-21 12:44 ` [PATCH v4 3/8] v4l2-ctl/compliance: Add routing and streams multiplexed streams Tomi Valkeinen
2023-04-21 12:44 ` [PATCH v4 4/8] v4l2-ctl/compliance: Add simple routing test Tomi Valkeinen
2023-04-24 8:04 ` Laurent Pinchart [this message]
2023-04-21 12:44 ` [PATCH v4 5/8] HACK: include/linux: Add client capabilities Tomi Valkeinen
2023-04-24 7:32 ` Laurent Pinchart
2023-05-25 14:05 ` Hans Verkuil
2023-05-26 8:19 ` Tomi Valkeinen
2023-04-21 12:44 ` [PATCH v4 6/8] media-ctl: Check for Streams API support Tomi Valkeinen
2023-04-24 7:54 ` Laurent Pinchart
2023-04-21 12:44 ` [PATCH v4 7/8] utils/common: Set V4L2_SUBDEV_CLIENT_CAP_STREAMS for subdevs Tomi Valkeinen
2023-04-24 8:01 ` Laurent Pinchart
2023-04-21 12:44 ` [PATCH v4 8/8] v4l2-ctl: Check for Streams API support Tomi Valkeinen
2023-04-24 8:03 ` Laurent Pinchart
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=20230424080421.GI4926@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jacopo.mondi@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=sakari.ailus@linux.intel.com \
--cc=satish.nagireddy@getcruise.com \
--cc=tomi.valkeinen@ideasonboard.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