All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Helen Koike <helen.koike@collabora.com>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH 2/2] v4l2-compliance: add tests for V4L2_CAP_IO_MC
Date: Wed, 18 Mar 2020 14:27:22 +0100	[thread overview]
Message-ID: <20200318132722.3089925-3-niklas.soderlund+renesas@ragnatech.se> (raw)
In-Reply-To: <20200318132722.3089925-1-niklas.soderlund+renesas@ragnatech.se>

Add tests to check the behavior of VIDIOC_ENUM{INPUT,OUTPUT},
VIDIOC_G_{INPUT,OUTPUT} and VIDIOC_S_{INPUT,OUTPUT} when the
V4L2_CAP_IO_MC  is set.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 utils/v4l2-compliance/v4l2-test-input-output.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/utils/v4l2-compliance/v4l2-test-input-output.cpp b/utils/v4l2-compliance/v4l2-test-input-output.cpp
index 2bf338e6f6d7ec5a..bf937abec320f88a 100644
--- a/utils/v4l2-compliance/v4l2-test-input-output.cpp
+++ b/utils/v4l2-compliance/v4l2-test-input-output.cpp
@@ -466,6 +466,13 @@ int testInput(struct node *node)
 	if (!node->inputs && node->has_inputs)
 		return fail("no inputs found, but input capabilities set\n");
 	fail_on_test(node->is_m2m && node->inputs > 1);
+	if (node->g_caps() & V4L2_CAP_IO_MC) {
+		if (!node->is_video && !node->is_meta)
+			return fail("media device controls none video or meta input\n");
+
+		if (!node->is_meta && node->inputs != 1)
+			return fail("media device controlled input have %d inputs\n", node->inputs);
+	}
 	return 0;
 }
 
@@ -836,6 +843,13 @@ int testOutput(struct node *node)
 	if (!node->outputs && node->has_outputs)
 		return fail("no outputs found, but output capabilities set\n");
 	fail_on_test(node->is_m2m && node->outputs > 1);
+	if (node->g_caps() & V4L2_CAP_IO_MC) {
+		if (!node->is_video && !node->is_meta)
+			return fail("media device controls none video or meta output\n");
+
+		if (!node->is_meta && node->outputs != 1)
+			return fail("media device controlled output have %d outputs\n", node->outputs);
+	}
 	return 0;
 }
 
-- 
2.25.0


  parent reply	other threads:[~2020-03-18 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 13:27 [PATCH 0/2] v4l2-compliance: add tests for V4L2_CAP_IO_MC Niklas Söderlund
2020-03-18 13:27 ` [PATCH 1/2] [DNI] v4l-utils: Add V4L2_CAP_IO_MC to videodev2.h Niklas Söderlund
2020-03-18 13:27 ` Niklas Söderlund [this message]
2020-03-19  2:48   ` [PATCH 2/2] v4l2-compliance: add tests for V4L2_CAP_IO_MC Laurent Pinchart
2020-04-23  9:40   ` 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=20200318132722.3089925-3-niklas.soderlund+renesas@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=helen.koike@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.