From patchwork Thu May 19 07:28:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 12854609 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 1F6D7C433F5 for ; Thu, 19 May 2022 07:46:13 +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=OcRMKPhIfbQVjaoGHNJ+Nq2Ulw10CeprxLPushcv1Oc=; b=OW9mTGPCoEUPBn 8p0MLcvFu5jurOaXjtrxtt7p7UQS6pw9qVSUHABBoLsVWOwVinPKQAU8cFox3vTuZ2HABJjdN/R2H 4gOwyMRptNEJNXESU1pNyVhP3HF2r2SmccKNo30UoeJO7S1VHt1y7vIw3pGm723n8a7YxKDcwGuzZ UKAbLyXHdFqbrFLIRNn1f4gPbW5Fai9actEKibgAZ5pmlG8tGCVrGy1H6+5Z6aN9AQuN5LbcqDPWt KrnX8v7cL3Acw2EqfHOEr6CP2AsLrdbP8g/ZxgmStCHGb9frroBl/FXGnVoi4Y/YAeA9S8fyk9zo9 K3omkK/VHjCazrgTvkbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nraqF-005cek-FE; Thu, 19 May 2022 07:45:03 +0000 Received: from mail-he1eur04on0616.outbound.protection.outlook.com ([2a01:111:f400:fe0d::616] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nraqC-005cbo-HY for linux-arm-kernel@lists.infradead.org; Thu, 19 May 2022 07:45:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oVekeRWEbXYn3NtR+SrYRoJ/UH5lmaSKRiPX23lH44vL37DGkbeLPc1UkFa799Z42UYGMDeO1wroSU08aJmKucv171fw+U4C1YMDKL2xGiBMMsMtYkHad4+ROtYA4ZythM8Sm4xv7avJ35ai0qZCUbTLH33wuWO9z7swT+5iXWWT9Qb6tbAUhwCJNPEzxWuCtmDaFjgMzFZckm+nG1hi1vfBNFAAz0cmJdnG8sHQ//IiABca0iphuS+5mYfoy30ZG+gw/fURuxSgtHHC9uMzZOD6+sKm18XAJM5sFesSiZ4q6ViiAs4TYvPQlYQFXQjAzcv9RXOGTssNMH8jck2VpQ== 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=MLKwwddypjZ3TK4G5eD2piVzqQBxuFtkxVn5HAJAB20=; b=XT0hMnpKQO4y0iSYIlQ2eIV4FdBrg7+CsqOdpW4Q+E4DX76KxtwF5O1deKiVcOR5EWX+FAyaUZXe9NcqDxDkNRL1AFIq77ul+C/2UJ+xmtf1P9WFLrOHL6/cd7AMJr3Ww4g6vmfEA95h0sXsltF3un78tNt1ZuMlfA5rfXpHdU/0hFpZeMWLAw6YFsjzzTwNyUfbI+GQ8rhIKBTPp++F6YngJKZRXcuZmpX81vriCF95N98F0yYba9N/WHGx0Q+cGAvZc16Vs6mHFd2zCZZGY9Ca++0shYiqeeZHPIaWGJb0Y8omB48NcG07nL7TzhDf5sC9z+DDQmMsfoS+SenM3Q== 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=MLKwwddypjZ3TK4G5eD2piVzqQBxuFtkxVn5HAJAB20=; b=XhHOm5MK94ZbH9uOJAy+dZhkgro685y57ofrZ3pdnb7rArjo7Efpx/1I30LIzCKPBzbLwuTK3d2KAFlJcDi5na6sF3UDWQ2nS95rn76XX7+3JlmeseLSXQrGhs9C3/VS0Nanu8+tU0OLvnSyBsMpwB2OprZkLYjd8EV52t+mD7Q= 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 DB7PR04MB4314.eurprd04.prod.outlook.com (2603:10a6:5:23::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Thu, 19 May 2022 07:29:13 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::bc48:7565:c619:62c3]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::bc48:7565:c619:62c3%7]) with mapi id 15.20.5273.015; Thu, 19 May 2022 07:29:13 +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: return error if format is unsupported by vpu Date: Thu, 19 May 2022 15:28:44 +0800 Message-Id: <20220519072844.31792-1-ming.qian@nxp.com> X-Mailer: git-send-email 2.36.1 X-ClientProxiedBy: SI2PR06CA0004.apcprd06.prod.outlook.com (2603:1096:4:186::20) 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: bdc43f3b-d9b4-4ca1-c186-08da396945f2 X-MS-TrafficTypeDiagnostic: DB7PR04MB4314: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: R48OG8s3juVJw1RoOA3LUZHyIb3qS1x4j5qWgedc7nK++kd9oEBV4nOHVYRc87BMXL5d7c1pwrgL3VyFWw4+T+IjRmihdeQIqOwCRvRLSwg1quZ7E0+kGr8b4lkth5Fe1sjyUFbtPQcv6wlxy8s+XtcFKI2LkxCfq5NaPRedgy6FAY15TJqscpvUUmYbC3MqSXEAUuQ6fW2GxypiTZTL+L1Q5Nz4dbFVqyQWMLlMSZWb7iIi9yC6bGH54rfR0+6HVA3GQiqx2vnnIA/estmiN/g+bJ3BZs1Y+DjijR05rxpNjBpXrUvtVUW/rlaD1CCHxby5eKlDYZgxrYWeDPf5z52MkOxOaS8QHIaCn9SAsTODL6fGdSfWl41W0dTDd8sxKmG9QLVI2cpHOVXIoq8JdjW5LwC8n17Wsjgza7K47LefL6M4S7vsFQ0yt/HUX/MJt8MjTnBtItFqfKZyqlKz0N+NrZ0/wj/ob+Mw+wRz2BJCSonx5CYlrREi9mAtNOV00sn4KK6s+Zrj4VgnQCFHDmwxdlZZElZwyBCtMrXpiNU+22i1gO2wZ+rSNb87YhR2GHXdce9bco/GE6nqv5tBILNi656SOmlX/4ctVcO5dYl0oAkaAdd8KeTXzuqE0nr4gtNZ/jJjFWjZi9TwGV262t/cgmeeNebY5Kfkbj+dDIrHLrzwa1+Meu58/8abyh+fdkuO2f7GXsOeu2kx59DWfA== 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)(5660300002)(7416002)(316002)(6506007)(6512007)(26005)(52116002)(6666004)(66476007)(66556008)(8676002)(38100700002)(4326008)(38350700002)(8936002)(66946007)(86362001)(508600001)(6486002)(2616005)(1076003)(83380400001)(36756003)(186003)(2906002)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5Fg8+DXUjldYCB7H06sE88S9KT+MFl6KD8Z63pPbq1aES2JMltAJDLNnTRD9QGwE77FgFFoq8BEf10iNmYLIhQlUhhnRT3OP9+DN79sj/dGhcXOiYjmA+mB2/+ftXW0eUdaV83W+ZKtuzvq/KAh7eJmCu6XbRcgI9HUzJQrPS/NuIB/wFzGk8BA0u6EyGqQtqRZaWcPNgn/6Ha6Db0AyJtw9SOEnYklrUrHpP3lACRrtyrl6ZiWJDU2Y/CwwcgE/gfym2GRXLVlY/5Og5ecQFqziK9E8UE4YZyrVtayk9aujfzay4yxB12qZM/DRSpIfPp6SY6SOX0bL1AFK4/n6Gt1MK7bGPG/9og3ju0d3WCtzcRWl7bvTbhGYFXPZGjBi6wsWAR1qtQLDIYlFRh8GwfgQjoZsFP0f5D8qFFbkGYG08IHJdHS0mIcvIeVBOCAC8r9WIeNkCm2V4av89HXQoeoDgBoaVAgIAAYwen9zRl0HufqBF1fQ/lExZOrHdd2aJu0uTYRveTdeiX2LYQyRRvSlmyqBv7NpBU94s2rDJWddN5yq24g+Vec5fNr3oIRR8Dz8zggdPvvo1EaMOxhBKeWxG85Yt7V6q0TuEIftX+KA6JR8fMMqIlZssPn8kPQilfMt4l2CFNY4W/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J1WYg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdc43f3b-d9b4-4ca1-c186-08da396945f2 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2022 07:29:13.5951 (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: yEH/cqlymmEtl3kJi0686nvKUm1o8UDvifmonmnqTteVxm1O2eELDFTEt/Qsg0VjaMpM9SFdvyAGHIU1QbHz+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4314 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220519_004500_618529_14DDB671 X-CRM114-Status: GOOD ( 11.28 ) 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 return error if format is unsupported by vpu, otherwise the vpu will be stalled at decoding Signed-off-by: Ming Qian --- drivers/media/platform/amphion/vpu_malone.c | 2 ++ drivers/media/platform/amphion/vpu_v4l2.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c index f29c223eefce..0930b6ba8c42 100644 --- a/drivers/media/platform/amphion/vpu_malone.c +++ b/drivers/media/platform/amphion/vpu_malone.c @@ -610,6 +610,8 @@ static int vpu_malone_set_params(struct vpu_shared_addr *shared, enum vpu_malone_format malone_format; malone_format = vpu_malone_format_remap(params->codec_format); + if (malone_format == MALONE_FMT_NULL) + return -EINVAL; iface->udata_buffer[instance].base = params->udata.base; iface->udata_buffer[instance].slot_size = params->udata.size; diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c index 446f07d09d0b..89b88e063e45 100644 --- a/drivers/media/platform/amphion/vpu_v4l2.c +++ b/drivers/media/platform/amphion/vpu_v4l2.c @@ -500,10 +500,10 @@ static int vpu_vb2_start_streaming(struct vb2_queue *q, unsigned int count) fmt->sizeimage[1], fmt->bytesperline[1], fmt->sizeimage[2], fmt->bytesperline[2], q->num_buffers); - call_void_vop(inst, start, q->type); + ret = call_vop(inst, start, q->type); vb2_clear_last_buffer_dequeued(q); - return 0; + return ret; } static void vpu_vb2_stop_streaming(struct vb2_queue *q)