From patchwork Mon May 9 07:52:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 12843110 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 B1CDAC433EF for ; Mon, 9 May 2022 07:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=kxF0DTE8/cQv4MRCiy1XdlXdm/6iFpTtDcUbsUg1j90=; b=0fI6wNTM+owCvU Vss/N/YVIEL2Fg587PLOiiGJTKl/QwAHxYRsL10xicWz1hkv/MM73jxNuJXZ1mnSiEuliJtsybY4z YUEIvmbcsY1V/FFq82l5mTRsS+kpYTVzIG9UX28BzCchSsCJaAPPlL7kvl8jdvb34jzNkZhqXdmLM vQ9sf7wqJA7AyiDX/P5edSWSIU9oiA7Jbg6UQJ6Ol2xmIUq+bLZZh5wbl4j23pHCYoZ28cnEqI86W 62Sj+JX/FRJAn6ciYpKECK3vnhyqjvypSVnnjan+2LughmYwrPgwsJKIrbrKdU5zrlBWeqgQ5eQ5r SK7qEp68XeBO8kUMoFBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnyDo-00CzmU-IN; Mon, 09 May 2022 07:54:25 +0000 Received: from mail-db3eur04on0604.outbound.protection.outlook.com ([2a01:111:f400:fe0c::604] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnyDD-00CzV8-I0 for linux-arm-kernel@lists.infradead.org; Mon, 09 May 2022 07:53:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UTfJI9aYr4kuujjjwoG6kejvioF8uuAxAyLsD5mfo0uohnDlvuqcCc8pofiTXpvx21T2Wj7XduB3+29ZG8pgVj+DydRrLuwLrfNEEJjy/HBIrdmA+pO0oMB3CSp6D1pyfB++Irh1Bk0sCYOR9jsilJ2Wk22W+rh/n0paJzKI7E1cTBwCfzpbtl8fuUhaLOLCOshgleR5cew/6hO5owPLpgkYiD8Q14sX8rksaGL2rlOCTfiN6UEst28JL7/mkZQFvw1sXzAPcNZSXa4lQAHCkJTNXcGY83T9QYXYvWF+sV27d9JzECA2Od/AA+3FF5twzxCZt1/GUgt9ipKE4UhZ0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=FFer5QZPSXXzyHY77JHH2MsdpW5Hs8IX/taIJg8Y0s8=; b=cFF2p2ziGceGS5j5wtgGKedc+i9jKkplJhaIMRwbwR15hVyUsTx5xaHdhMqN4ghk644/zqwP7jNmY+CzXcbRDH40oSl67q4+Agbh6YAJkxLFohelvoJD4VYc0q1yUH1+a4mOYB/MdtQCaLLOUi7e9s2rJOHnjw6Cx7e0IA96lGoxe2tqeLfACYaUImNfMU51aKyq3jyZu3ERJZvUYG+DzxN6S0Y+DOoXBbCV3JwdjmqEff1VeVkr1igHmBLu7pDvsaBKP+m7ItxFpkPQknTFll+YFc+canLy26OG7/5fywKAOkRwoujoJUXI0jBqwXX2PgfMPAfkDO1f8L71U6/tOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FFer5QZPSXXzyHY77JHH2MsdpW5Hs8IX/taIJg8Y0s8=; b=Hw7oAgj8Img27ZiBF6i/vJJWZH6QEz2sDwvj/cikYN4k4awH/gw7smxYhs7I1GcCGy5HZjE05trQaYEdve5lDWBozmzRi4wfQ6E9bLBwILgQSdsYWo8aJvlptpFOOtnpDLZFK1cHtCIvKiHe4BnDTUxUBwXcwzqmDtmJcdvdhEY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by AS1PR04MB9504.eurprd04.prod.outlook.com (2603:10a6:20b:4d2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.28; Mon, 9 May 2022 07:53:42 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::ed87:b085:802d:2390]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::ed87:b085:802d:2390%6]) with mapi id 15.20.5227.023; Mon, 9 May 2022 07:53:42 +0000 From: Ming Qian To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] media: amphion: G/S_PARM only for encoder's output queue Date: Mon, 9 May 2022 15:52:25 +0800 Message-Id: <20220509075225.8031-1-ming.qian@nxp.com> X-Mailer: git-send-email 2.36.0 X-ClientProxiedBy: SG2PR02CA0063.apcprd02.prod.outlook.com (2603:1096:4:54::27) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d467045-69f7-4cb9-7cc0-08da3191090c X-MS-TrafficTypeDiagnostic: AS1PR04MB9504:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jF+nq548pvSMZw2zV6lw41LNSikur059d8cDNyjJAoQjgAFCxmN54oIvdOUTPr8NBc3E7B8uloBMRhmkX8MNSt+OAnmy5tpCoedspL2jMXSbMsjwcxKsF+ent9H1u8oOIJ+ABdlis94GflkGUdo4oV5FFFVWgtAmaDNw1y6OiVk7YPoMVlSK9OtFKam09FRtfEWZXYtk10elFWHH90kYZ9dSbtrFJvzo46wYL/3ebI6wwWZp7ENEIsztODPlPJRKFWaZdA1S71j+ftpCccUqZKtNI21741AktOoctY4IcO6NJ800qBLxNNTKut46GbkSDScG1+TI3HQc4yIThrS+rc66VNF8usDMfMluWx5mk5pUPjiXTyPeakRB7K+P38Nj7kb4qsS2mMVTVgue6FX9PNMht27kX6UOueAgy3kS7G1TmF8nft1OmcJUuyIPGrCuwksw80RrJzWwEvnDBxczSe26A/o9qyaJJDp3obBJLT1L2dwxGJ6Z1eldkqmib58IjnthNiOK5ysZ8JHsPySvB9/VeprO1vbl+J/Pna9k1Z0gsPzY1maz/+ekwWOU4FDiH7ocqKYkI8rCIf2e0biZWq1BUlZQE5JEl8B4SxBAH4zRlzeF9DGnV99bTYJ7drtB2pqQvPocvm4LCITe/luPO8RdmZCOV1zLluH15K6frQFYbxuV9pG0eJLwU5GGn6zg34/LlYpL/NoWGosgdWlH2A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB6341.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(26005)(6512007)(38100700002)(36756003)(38350700002)(186003)(6486002)(1076003)(316002)(66556008)(2616005)(66946007)(8936002)(2906002)(4326008)(66476007)(8676002)(86362001)(508600001)(6666004)(6506007)(7416002)(52116002)(44832011)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RRUXLUjTNO8NwCCGAqB1JwDm8hy9cKujSWIfw2plZdBZbnFabbOx/q3DQthwHAVDVEEfzWSXgvBBPbrJ/tsYQTv+zLwfdVvkzRZDJIh03bAO3KWAq4c920jaOdsuG8C1FaPLs7SfkmkiLL1VWNBsYArb1MHgF85Y2yLupMqpxA0zZZ1REA8OXeDRvAEUEYUoyAL7EKVRLfwpFLoCrM85Z1TAe3huEyVMOzO3PM5vg+cISoYF9mFKkaL+a7jbACiGv/hmkqcRnhHEw9volvC6v5T+THVy73NPlpWMApF3w3hFLUwO2/vGa+AV762he20ZCuCpBN+a8S1pVxCWuJoTrFh3D62glNGhtEIlc/v7KRGNdjSYf4ZMEMQSRaUZijU8aE6+MIcnLnGyajatpj08WiW9HE3I1Ib2d+lFa7g6iBmpMY3YMsYsZxDp2O8Nr8vnDfjAxm0CXv9ZVLrUOsvYZl/W5vxCLUqVpR2rMpdC9YGUH8K3fS6rGHzXKa9XG502Y+w37kdGTsodBaiAAoh6D9hH0qtCw4T3qTFeMopRCI7E7OG+wj1Qir9AOcTy5nQG73Qq1pAm2YvxfuUN8pbV3yEZzCNE0/N4oTwUt9ERRmjKh8T35fqEallHR7ahNu0lz+IqlLj3ctJvE6e8C7tA1xmYR19fmKcbZLnjrGYuyT2ybCWq/yuFmqoEZToGB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1d467045-69f7-4cb9-7cc0-08da3191090c X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 07:53:42.2084 (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: A3FSZVOMspERu1opO0hik0h1PW4NYWO7T/U5tuK5Cqp/zed6J4go2tGnAQkZ3NvOCEb7rgNK34sN9d7Xp/gdRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9504 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220509_005347_867519_08C75F89 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. 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 G/S_PARM doesn't make sense for the capture queue of a stateful encoder, unless V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL is set to reserve hardware resources. Otherwise it will fail the v4l2-compliance Signed-off-by: Ming Qian --- drivers/media/platform/amphion/venc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c index ba9f49cca155..43d61d82f58c 100644 --- a/drivers/media/platform/amphion/venc.c +++ b/drivers/media/platform/amphion/venc.c @@ -283,6 +283,9 @@ static int venc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *parm if (!parm) return -EINVAL; + if (!V4L2_TYPE_IS_OUTPUT(parm->type)) + return -EINVAL; + if (!vpu_helper_check_type(inst, parm->type)) return -EINVAL; @@ -304,6 +307,9 @@ static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *parm if (!parm) return -EINVAL; + if (!V4L2_TYPE_IS_OUTPUT(parm->type)) + return -EINVAL; + if (!vpu_helper_check_type(inst, parm->type)) return -EINVAL;