From patchwork Tue Oct 20 15:56:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11847269 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 9350A16BC for ; Tue, 20 Oct 2020 15:57:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 37F9522249 for ; Tue, 20 Oct 2020 15:57:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VbajbqSs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37F9522249 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=iTWYGkDayXEOJwcDnoj57JKJVOEFw3cTxada0RSOvM0=; b=VbajbqSsFQG2uZHcs6kjxNxAjx mIoQ8X9SpmTcLeL0+CELHkwsGSnYW8LHWs4AKYgf1U2gnLSXFScY3CD3SDhHAUBkRVLLC6JovcQ02 1fai7c1KRwbvGKYcPbMmlVJZULpOY9+rDZlIty4t1ylKbksxHubyH2wvQJb7dEh2wDs6YZLMe+dSp HQZNWHLZxFkxEJEVU+BF/He5V1OMjR41U2MeycRhngWGdfpjqwgppvJ0073sQ/KKxv0dFyd9Ijy40 uzdapMZ94QK3MaGS2gPvWFvfb/mQLmtdqIrwgAvXZPy3MqCv250uqqGA0JfQK9J8P5HGywmDC282J bxdkOZ7A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUu0Q-0002of-DL; Tue, 20 Oct 2020 15:56:58 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUu0L-0002nF-Km for linux-rockchip@lists.infradead.org; Tue, 20 Oct 2020 15:56:56 +0000 Received: from guri.fritz.box (p200300c7cf435b0028a32f4e277d2227.dip0.t-ipconnect.de [IPv6:2003:c7:cf43:5b00:28a3:2f4e:277d:2227]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 6024F1F44F01; Tue, 20 Oct 2020 16:56:52 +0100 (BST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Subject: [PATCH v2] v4l2-compliance: fail if format MEDIA_BUS_FMT_METADATA_FIXED has width/height not equal 0 Date: Tue, 20 Oct 2020 17:56:42 +0200 Message-Id: <20201020155642.1604-1-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201020_115653_807502_88D305C9 X-CRM114-Status: GOOD ( 14.45 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com, dafna3@gmail.com, tfiga@chromium.org, hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org, helen.koike@collabora.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, kernel@collabora.com, ezequiel@collabora.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The media bus format code MEDIA_BUS_FMT_METADATA_FIXED is used for metadata formats that are not configurable from userspace. This format should have width and height set to 0. Signed-off-by: Dafna Hirschfeld Reviewed-by: Helen Koike --- The patch should be applied together with the kernel patch https://patchwork.kernel.org/project/linux-media/patch/20201020154522.654-1-dafna.hirschfeld@collabora.com/ changes from v1: add a test that check if the mbus format is MEDIA_BUS_FMT_METADATA_FIXED and the width or height are not 0 utils/v4l2-compliance/v4l2-test-subdevs.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp index ec3ef169..4dedc7a9 100644 --- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp +++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp @@ -300,8 +300,12 @@ int testSubDevFrameInterval(struct node *node, unsigned pad) static int checkMBusFrameFmt(struct node *node, struct v4l2_mbus_framefmt &fmt) { fail_on_test(check_0(fmt.reserved, sizeof(fmt.reserved))); - fail_on_test(fmt.width == 0 || fmt.width > 65536); - fail_on_test(fmt.height == 0 || fmt.height > 65536); + if (fmt.code != MEDIA_BUS_FMT_METADATA_FIXED) { + fail_on_test(fmt.width == 0 || fmt.width > 65536); + fail_on_test(fmt.height == 0 || fmt.height > 65536); + } else { + fail_on_test(fmt.width != 0 || fmt.height != 0); + } fail_on_test(fmt.code == 0 || fmt.code == ~0U); fail_on_test(fmt.field == ~0U); if (!node->is_passthrough_subdev) {