From patchwork Mon Feb 19 16:46:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10228231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D7529602B1 for ; Mon, 19 Feb 2018 16:46:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C73BE28AFB for ; Mon, 19 Feb 2018 16:46:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBE2728B02; Mon, 19 Feb 2018 16:46:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4E2F28AFB for ; Mon, 19 Feb 2018 16:46:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753169AbeBSQqN (ORCPT ); Mon, 19 Feb 2018 11:46:13 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:55723 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752939AbeBSQqN (ORCPT ); Mon, 19 Feb 2018 11:46:13 -0500 Received: from w540.lan (unknown [IPv6:2001:b07:6442:1ac4:c5d5:d2e5:f400:a467]) (Authenticated sender: jacopo@jmondi.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 89D6EC5A63; Mon, 19 Feb 2018 17:46:11 +0100 (CET) From: Jacopo Mondi To: hverkuil@xs4all.nl Cc: Jacopo Mondi , linux-media@vger.kernel.org Subject: [PATCH] v4l2-compliance: Relax g/s_parm type check Date: Mon, 19 Feb 2018 17:46:04 +0100 Message-Id: <1519058764-30045-1-git-send-email-jacopo@jmondi.org> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit commit 2e564ee56978874ddd4a8d061d37be088f130fd9 Author: Hans Verkuil vidioc-g-parm.rst: also allow _MPLANE buffer types V4L2 allows _MPLANE buffer types for capture/output on s/g_parm operations. Relax v4l2-compliance check to comply with this. Signed-off-by: Jacopo Mondi --- utils/v4l2-compliance/v4l2-test-formats.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp index b7a32fe..25c4da5 100644 --- a/utils/v4l2-compliance/v4l2-test-formats.cpp +++ b/utils/v4l2-compliance/v4l2-test-formats.cpp @@ -1235,9 +1235,20 @@ int testParm(struct node *node) type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && type != V4L2_BUF_TYPE_VIDEO_OUTPUT) return fail("G/S_PARM is only allowed for video capture/output\n"); - if (!(node->g_caps() & buftype2cap[type])) - return fail("%s cap not set, but G/S_PARM worked\n", - buftype2s(type).c_str()); + + if (!((node->g_caps() & V4L2_BUF_TYPE_VIDEO_CAPTURE || + node->g_caps() & V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)) && + ((buftype2cap[type] == V4L2_BUF_TYPE_VIDEO_CAPTURE || + buftype2cap[type] == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE))) + return fail("%s cap not set, but G/S_PARM worked\n", + buftype2s(type).c_str()); + + if (!((node->g_caps() & V4L2_BUF_TYPE_VIDEO_OUTPUT || + node->g_caps() & V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)) && + ((buftype2cap[type] == V4L2_BUF_TYPE_VIDEO_OUTPUT || + buftype2cap[type] == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE))) + return fail("%s cap not set, but G/S_PARM worked\n", + buftype2s(type).c_str()); } }