From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Daniel Scally <dan.scally@ideasonboard.com>
Cc: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
tomi.valkeinen@ideasonboard.com
Subject: Re: [PATCH 2/2] media-ctl: Re-order setting format and routes
Date: Wed, 17 Jan 2024 15:22:34 +0200 [thread overview]
Message-ID: <20240117132234.GG4860@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20240117130805.939312-2-dan.scally@ideasonboard.com>
Hi Dan,
Thank you for the patch.
On Wed, Jan 17, 2024 at 01:08:05PM +0000, Daniel Scally wrote:
> Currently media-ctl attempts to set formats that are passed to it
> with -V _before_ setting routes passed to it with -R. This is a
> problem, because the formats that one wants may not be valid until
> routing has been configured (for example, if the format is for a
> route that is inactive by default).
>
> Reorder things so that setting routes comes before setting formats.
>
> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> utils/media-ctl/media-ctl.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
> index 961d10c8..2081f111 100644
> --- a/utils/media-ctl/media-ctl.c
> +++ b/utils/media-ctl/media-ctl.c
> @@ -751,20 +751,20 @@ int main(int argc, char **argv)
> }
> }
>
> - if (media_opts.formats) {
> - ret = v4l2_subdev_parse_setup_formats(media,
> - media_opts.formats);
> + if (media_opts.routes) {
> + ret = v4l2_subdev_parse_setup_routes(media, media_opts.routes);
> if (ret) {
> - printf("Unable to setup formats: %s (%d)\n",
> + printf("Unable to setup routes: %s (%d)\n",
> strerror(-ret), -ret);
> goto out;
> }
> }
>
> - if (media_opts.routes) {
> - ret = v4l2_subdev_parse_setup_routes(media, media_opts.routes);
> + if (media_opts.formats) {
> + ret = v4l2_subdev_parse_setup_formats(media,
> + media_opts.formats);
> if (ret) {
> - printf("Unable to setup routes: %s (%d)\n",
> + printf("Unable to setup formats: %s (%d)\n",
> strerror(-ret), -ret);
> goto out;
> }
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-01-17 13:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 13:08 [PATCH 1/2] v4l2-ctl: Add --try-routing option Daniel Scally
2024-01-17 13:08 ` [PATCH 2/2] media-ctl: Re-order setting format and routes Daniel Scally
2024-01-17 13:22 ` Laurent Pinchart [this message]
2024-01-18 10:53 ` Sakari Ailus
2024-01-17 13:18 ` [PATCH 1/2] v4l2-ctl: Add --try-routing option Dan Scally
2024-01-17 13:21 ` Laurent Pinchart
2024-01-18 10:27 ` Dan Scally
2024-01-18 10:48 ` Laurent Pinchart
2024-01-18 10:58 ` Dan Scally
2024-01-18 11:37 ` Sakari Ailus
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=20240117132234.GG4860@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=dan.scally@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.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