From patchwork Tue Sep 24 10:33:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Palcu X-Patchwork-Id: 13810767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D872CF9C71 for ; Tue, 24 Sep 2024 10:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:Message-Id:Date:Subject:Cc: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=vW1ZVtQ5gP2VFZ6CvIDUlYCQPPo6gfXH9zlozSoPuow=; b=XqcTr75pdYCarJbChnuuCSfd5j sYjQ5NjifYLbLo/ClQBxXCd4jZmTUzUUysfEW1bQQfJTCOTLmThaoV0P/Cndb+aByKvtr1xtDd9qd lv0XIACCwKHSiJamJN6EkZ+MnRg+MlQ9n774ZDKiu7TUpqFYFCR4XwV0inWw096ddfHvGm3ijqV4F CkPW/7uqUtSh+KSvRB8heQny5K3SW4j9KGG+c7vC8nWmCTbYXlsi/iEnQ+nYi5pucIdxJWEuBF+mf yEkde6peQfib9bGFnzlyE2NeEqhGeZM99iYngE4HN0DDn0X+qMF6V3EkwsCRNJAKLCxKHeFxBT+l4 fG8G7DeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1st31B-000000022JM-1MTr; Tue, 24 Sep 2024 10:43:41 +0000 Received: from mail-vi1eur05on20603.outbound.protection.outlook.com ([2a01:111:f403:2613::603] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1st2rI-0000000210s-3oWZ for linux-arm-kernel@lists.infradead.org; Tue, 24 Sep 2024 10:33:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fDGfWuQNqAA0Z1eXJll9YGt7irrVSx07yM6j01O0IRZWXwcqlEIq8YmXO/Pa2FfA6sw6bcDeyjNSvWz1TzXUnzucG0khGMTZU2BvZloIEoyxT6Z42e7kQrJ5YjH5poqs2mw1C8YsicPRwppSghxd9fUbicce99AtKkZbIdu36pEAZxBqyAH3R7rn+U2vOwljavFijC+rozgUTtN91NfU6LL7KTB0K1/EuW58nJGzjbLiBBhDG8efrQTcGOvHhB/Anl5o+lokxOGE1Ise95P+kkOmXEoDXxi3wO+sEyi86LBSB/VxFXF7wDl1oBgyPXtiBtBKcifBjbp4BhkIR2ZLmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vW1ZVtQ5gP2VFZ6CvIDUlYCQPPo6gfXH9zlozSoPuow=; b=SzX793xFikhwdUYa434FgXXm7yHytrqgvj9xssioG08huOgo9R57x2NeccvOeavXKdfu6nH3tcRtmwe9iHvP1I5PJ6/e7dVCtZzqc7R3oBva4ZM2SHCkden9bRR6HSGhOcGaMfk522MQHhlyEW0r8cOgsp2EsW5sjkcAHyVPsuzLfyeEA1WF+eGs/DQt1frcnw2Gask+d1clcRdzBXUaJmE2slAZU619VOr4vuWGTwtrP5/+JbWzRGjz/gRtjkFQexmyxdiQUZoP40OOmTMyyUonoemV5ktoD5yP4ETZeNCQFjqc2vSrLSp74BdC3qb8dVBWYnDW588R2o/7ckK+EA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vW1ZVtQ5gP2VFZ6CvIDUlYCQPPo6gfXH9zlozSoPuow=; b=c9ikHpwCQGxiL2gGW1RK1u8FE/8h6xYMZVUqSrlBJ6mr94sVF+RryUzHNdHQwMXQhvptMMAWiJPOSXtj2L65RCqN7wFvsR/eYHhhY0dThsXrfxxGPPhOtIR4v0S1jBzylKYmvTe7QKqmR0BmWOxOlRmIvM58latT2KjOq0uvVUYSu6lFl2R4yFv1/7LL5GzKZl7u2nqh6MFFF8uhIZtnqmRQQaSw1UMbsBHOgp4Wjcj9W90twTUW5suDNR5Y/WlNNNlaDldYY4+pnMaVsvklODGcT4zw46z/8aBPqZRyHbmyM9lowwqGNBJvY8QX80MFi4CRx4lokDdcUZzbrc3ZLg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AS4PR04MB9576.eurprd04.prod.outlook.com (2603:10a6:20b:4fe::12) by PR3PR04MB7257.eurprd04.prod.outlook.com (2603:10a6:102:93::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Tue, 24 Sep 2024 10:33:23 +0000 Received: from AS4PR04MB9576.eurprd04.prod.outlook.com ([fe80::9cf2:8eae:c3d1:2f30]) by AS4PR04MB9576.eurprd04.prod.outlook.com ([fe80::9cf2:8eae:c3d1:2f30%7]) with mapi id 15.20.7982.022; Tue, 24 Sep 2024 10:33:22 +0000 From: Laurentiu Palcu To: Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Guoniu Zhou , Christian Hemp , Dong Aisheng Cc: Laurentiu Palcu , Jacopo Mondi , linux-media@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] media: nxp: imx8-isi: fix v4l2-compliance test errors Date: Tue, 24 Sep 2024 13:33:04 +0300 Message-Id: <20240924103304.124085-1-laurentiu.palcu@oss.nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM0PR10CA0033.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::13) To AS4PR04MB9576.eurprd04.prod.outlook.com (2603:10a6:20b:4fe::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR04MB9576:EE_|PR3PR04MB7257:EE_ X-MS-Office365-Filtering-Correlation-Id: 312e64f1-40cc-443d-2784-08dcdc84508d X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: 5Fn962mjFLeDPj03vV+n1dyIhzveP6+ueaDh9g54ONtTICaY+ngIC9qLoXKWVDO6Wou7oM9ge97KOk3CpvsDngxu+NKT6gTT561opfQAeOInbOwD1kXwlBOLvY386PGx4/OkAaRkMJd+S4I0B6+y94OdB+biA4KOwRh0y2/Lr2dyQpa3mt6ohBodYE2V8IvdRR5OndPFYm8cWoxxD65CZGn/XueZknzB68dDwnuLDR3gR40Zufi8WuEEOT/SCoLQGyB1rrdD9xJ6iftppkM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;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR04MB9576.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KWNH+AZUCMB82IOWup2zxHIuDxeWN0d9MeFPCVYIcejJBt3rEkhvsH/GswWHJSmJUHEYLJz7jwPEp1/2pTxI2KIKFVU6fFJYPRnf0BAUtWzJMAicRXbDZ8TP35LqhcYate2rRs4u29EQiuumjCIqDgv8ALhf3FpXw/rwU2oj+2tJjBUmgZwT9rcnkE7X2S/pK+WaJuV2PcDnQud9S6Xygowk5CfCmh/yZ4TmmHd/vExbQ5pQWgiqy03vv0Mnz2GUl3E/65IRFFXqS1Qx26W8gvezosN7ehvdXlg85tpruat1S4T7bylUq2DPGlJONZwKYymE1gqvKn5b5UROFD5rxi9MtMkWsQOVL0HbYqM+YCMfOQBDaq6G1J4ARN4BjTNomosy+1mr/969wbjN/nwmQ8ko+u3IfFvZi57bK4/o7Be8F+Kuni50XUaIkRWMmX6IT6YJoOsQJx1OVRtnXi2YBJiC4uABoedhE6ZGnYsbu2wp3DDJuQsJwYqiPcc3y+DySQRyvqqGTrP9na/tkJ9r8OJhSOL0o8SZlpGbtjr9Be9cYIDDZHv9JHdQHlxVq4NeL8cXeMLBvrIdR0o5/cnuyr+iymIllD6SzHBtsyK3Sbmbd3bjzoC8THPOkKWDypcVaPZ9g1o6Wf2JsRMf89jXpPNo7bGOc48n+xMJoip6O7yuvFky2FgEiL80/2iIGFh2r26Dvv1hcqynXeqdD6CyxbLkSkVunORpR5qIOigQQzY1LyPVPlyFQoHxoJj5O2IoskFXXBNVzOEuyps0EoxDo4tFfBipMD20jzOlFtJJ33Uyu6f+xQUJFJxpJWD9WxoVXAoMSyk4Tb/w3AfNpjNvh8CzLIwCeywuvuhC+d0yKCQOcYoBrt1qj3qVnW+TsvlR2vWald+bnkk6zVgBd31fcjDeWQgVOp5pT3wwduRtGgwcsYy4+cDl3sJtm5b2vUS4HHr8m1tyQnF6UBjfzZwN06fDrDjZV3tKmp/0IGW+syfetGNUQkpaYCoDmChoZ6dS9JDwU1lii34gBJgI8hgJW5DLG95ffwryV55+Ggg1+Dzk13N21NpiviXK+3voHRTslUfT1EmmGG0AYeHbyt+luRs2ybOQEOIk3eIZIj7yrl8xHSpU3GrMwU64HwJC3bb95XWvPQrvqDUnMl9PAl2j6+BiEZdCl7EKeIdGBgYnlKoJNZjdGeeWgH9G9evsI03J9adwqTJJqNaU0sqCHukbIbnWOIlQQGBi53YlmhYjnMZ8afly0LkfP/ylkL6NVXedNHPB9rDmcfPNfbyG1cNS3nPVwbmIzc02B4UjAUjw9jxBUXwkt4d4kPnsYGwrE9x90ZjXXeF+a0QMSTEF5Yke3KiE8FQrzR1nuScgn/pNah9yfQLEmgpCIzMkXkV84+/+kV5r/pRe45Y4G8c6m2U22rLJEX6lK1N6U1z9QClTAhdV2qDKP8C8TRNlHFdA68XwLQeG1TkaTqpEr7Ia8jVpVGRUdSyVrW8wywEChyA755mRX85kphBXy90R9CVXKlQMIzrRIr9ozZOQQzls3Btd1vCaOfo0kT7K061FgeITXa7nasuENkQ5X8DtLxgyhIqrSukgS3fMMzr/4rbRvqDShA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 312e64f1-40cc-443d-2784-08dcdc84508d X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9576.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2024 10:33:22.7053 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qcwwak0dCTzvaEE8AEQN0tQUzZsnlpQTq8/oS8OxKDNmvgn0DBCUXO3gFeN+hkwsH+7LL+1RsJpcY2Qt6ypwQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7257 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240924_033328_986756_7F406C7E X-CRM114-Status: GOOD ( 13.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Running the v4l2-compliance (1.27.0-5208, SHA: af114250d48d) on the m2m device fails on the MMAP streaming tests, with the following messages: fail: v4l2-test-buffers.cpp(240): g_field() == V4L2_FIELD_ANY fail: v4l2-test-buffers.cpp(1508): buf.qbuf(node) Apparently, the driver does not properly set the field member of vb2_v4l2_buffer struct, returning the default V4L2_FIELD_ANY value which is against the guidelines. Fixes: cf21f328fcafac ("media: nxp: Add i.MX8 ISI driver") Signed-off-by: Laurentiu Palcu Reviewed-by: Laurent Pinchart --- v2: * set the 'field' in mxc_isi_video_buffer_prepare() as suggested by Laurent; * change the commit subject to make it more generic as the fix does not address only the M2M device compliance errors but also the video capture ones; drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c index ddd42a8f17884..60c55d6839431 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c @@ -898,6 +898,7 @@ int mxc_isi_video_buffer_prepare(struct mxc_isi_dev *isi, struct vb2_buffer *vb2 const struct v4l2_pix_format_mplane *pix) { unsigned int i; + struct vb2_v4l2_buffer *v4l2_buf = to_vb2_v4l2_buffer(vb2); for (i = 0; i < info->mem_planes; i++) { unsigned long size = pix->plane_fmt[i].sizeimage; @@ -911,6 +912,8 @@ int mxc_isi_video_buffer_prepare(struct mxc_isi_dev *isi, struct vb2_buffer *vb2 vb2_set_plane_payload(vb2, i, size); } + v4l2_buf->field = pix->field; + return 0; }