From patchwork Wed Mar 18 13:27:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 11445271 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4594117E6 for ; Wed, 18 Mar 2020 13:27:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 221B520775 for ; Wed, 18 Mar 2020 13:27:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727059AbgCRN1o (ORCPT ); Wed, 18 Mar 2020 09:27:44 -0400 Received: from bin-mail-out-05.binero.net ([195.74.38.228]:31145 "EHLO bin-mail-out-05.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726777AbgCRN1o (ORCPT ); Wed, 18 Mar 2020 09:27:44 -0400 X-Halon-ID: 2ae76ec9-691c-11ea-9f40-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 2ae76ec9-691c-11ea-9f40-0050569116f7; Wed, 18 Mar 2020 14:27:09 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Helen Koike , Hans Verkuil , Sakari Ailus , Laurent Pinchart , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH 1/2] [DNI] v4l-utils: Add V4L2_CAP_IO_MC to videodev2.h Date: Wed, 18 Mar 2020 14:27:21 +0100 Message-Id: <20200318132722.3089925-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200318132722.3089925-1-niklas.soderlund+renesas@ragnatech.se> References: <20200318132722.3089925-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add the define from the out of tree patches for V4L2_CAP_IO_MC capability. This patch is not intended for consumption but to ease adding tests to v4l2-compliance while IO_MC makes it way into the media-tree. Not-yet-Signed-off-by: Niklas Söderlund --- include/linux/videodev2.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 8c5963ee4a677b57..020dd808e60e1b93 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -481,6 +481,8 @@ struct v4l2_capability { #define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */ +#define V4L2_CAP_IO_MC 0x20000000 /* Is input/output controlled by the media controller */ + #define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */ /* From patchwork Wed Mar 18 13:27:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 11445275 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCB2D6CA for ; Wed, 18 Mar 2020 13:27:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C52D720775 for ; Wed, 18 Mar 2020 13:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727093AbgCRN1q (ORCPT ); Wed, 18 Mar 2020 09:27:46 -0400 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:65063 "EHLO vsp-unauthed02.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbgCRN1q (ORCPT ); Wed, 18 Mar 2020 09:27:46 -0400 X-Halon-ID: 2b75de50-691c-11ea-9f40-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 2b75de50-691c-11ea-9f40-0050569116f7; Wed, 18 Mar 2020 14:27:10 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Helen Koike , Hans Verkuil , Sakari Ailus , Laurent Pinchart , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH 2/2] v4l2-compliance: add tests for V4L2_CAP_IO_MC Date: Wed, 18 Mar 2020 14:27:22 +0100 Message-Id: <20200318132722.3089925-3-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200318132722.3089925-1-niklas.soderlund+renesas@ragnatech.se> References: <20200318132722.3089925-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- 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; }