Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1190173iob; Thu, 19 May 2022 00:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKKDX0y8fmHzJDA5Si7Iqt+Vm5kWPsSeVg7k2A+TKFXjBKgQ8d14aVpaKafQSH8TfwXQcu X-Received: by 2002:a17:90b:1b44:b0:1df:b831:3356 with SMTP id nv4-20020a17090b1b4400b001dfb8313356mr3908059pjb.73.1652947145822; Thu, 19 May 2022 00:59:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652947145; cv=pass; d=google.com; s=arc-20160816; b=bkLPJ7dIsXpTQt2S0lkXqUSDdGNAuSmqPaSm1+zt72u8Ly9QLyiJqbA9mmfRA0OqCs RfTfrPca2CCs3TrxZ9CzeAXYkRAnNyk6/r+SHf9YRmNzfwVrTJzShRxvg4lFi8wb3hw/ e6vEc/a2orS1IHuz2yn93eSBcuRLKDE5EOq6A/GBJiJpCD+vjs7EmFCwZV1pl1M4q4eN SPKLZCtnuyDQJLFUt3LanJbx9BkcrgRH9FW7M09YgPmOPHWvevunc1IxDsjSJqWFPWOw X73EoiCgbi39NAC5b88gGw38RNHAL+z55WHHm0u8TEwEVYvlY5X5P0pQtP1RGuApjsbs 874w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=MLKwwddypjZ3TK4G5eD2piVzqQBxuFtkxVn5HAJAB20=; b=EuppUEPAbFQogBK7i8O8Si8p2bm1ng7Rviq41jxjrUdqleIxOpgQTYHe2NsF2F2RRR 2XxYGMwqlwl0C5FrJnXAavNZ3iorW2C4Gl2ZwxHqt8hrRfvNhgFHc9O8YBay+cUs7AK0 0d7ZZveTELoC6P3MaNcbqZh36TdNcmXAJ8kUqI4lVcT386V/T7YmtNXFRbHjN8GQTq/J gssuwxWhn4hArQW/4OCsy0u8y6Um4eL1Y0bgog0ZPz9FbjaOdaHp2lertqy0ravsm7w5 wu0liXgL+zfqizLnfcykU8UbC8hsnjiMSVgnBHRR5gIfdBzqXUm2QNHOc9QNVvrc4sOz 3hgg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=XhHOm5MK; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be3-20020a170902aa0300b00161574728dasi6326801plb.493.2022.05.19.00.58.52; Thu, 19 May 2022 00:59:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=XhHOm5MK; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231144AbiESH3a (ORCPT + 99 others); Thu, 19 May 2022 03:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234693AbiESH3T (ORCPT ); Thu, 19 May 2022 03:29:19 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70073.outbound.protection.outlook.com [40.107.7.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C9318B0A4; Thu, 19 May 2022 00:29:17 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?5Fg8+DXUjldYCB7H06sE88S9KT+MFl6KD8Z63pPbq1aES2JMltAJDLNnTRD9?= =?us-ascii?Q?QGwE77FgFFoq8BEf10iNmYLIhQlUhhnRT3OP9+DN79sj/dGhcXOiYjmA+mB2?= =?us-ascii?Q?/+ftXW0eUdaV83W+ZKtuzvq/KAh7eJmCu6XbRcgI9HUzJQrPS/NuIB/wFzGk?= =?us-ascii?Q?8BA0u6EyGqQtqRZaWcPNgn/6Ha6Db0AyJtw9SOEnYklrUrHpP3lACRrtyrl6?= =?us-ascii?Q?ZiWJDU2Y/CwwcgE/gfym2GRXLVlY/5Og5ecQFqziK9E8UE4YZyrVtayk9auj?= =?us-ascii?Q?fzay4yxB12qZM/DRSpIfPp6SY6SOX0bL1AFK4/n6Gt1MK7bGPG/9og3ju0d3?= =?us-ascii?Q?WCtzcRWl7bvTbhGYFXPZGjBi6wsWAR1qtQLDIYlFRh8GwfgQjoZsFP0f5D8q?= =?us-ascii?Q?FFbkGYG08IHJdHS0mIcvIeVBOCAC8r9WIeNkCm2V4av89HXQoeoDgBoaVAgI?= =?us-ascii?Q?AAYwen9zRl0HufqBF1fQ/lExZOrHdd2aJu0uTYRveTdeiX2LYQyRRvSlmyqB?= =?us-ascii?Q?v7NpBU94s2rDJWddN5yq24g+Vec5fNr3oIRR8Dz8zggdPvvo1EaMOxhBKeWx?= =?us-ascii?Q?G85Yt7V6q0TuE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us-ascii?Q?kHlSAmS9AD92VGU57yY/0E5enA1C1UimnBCcgW95K8nccJakbt7QD1VtaGEJ?= =?us-ascii?Q?BhM0wB02d3oMBRIFU40FOmhdvmTrIakgzbZLEx5wyTT/uGbW0TBDB4j/+Ca/?= =?us-ascii?Q?wmKnYPmIYcZAMn6yChKVYtmzDNFEn7lA709uNe0hu0MhT9Rbk61fx+/b2HXw?= =?us-ascii?Q?yoyWBu7MxWfmRiZgsvnGi++RO8XjOvrd+D4aln7TL2lk2TyLTNcVuikxQo0o?= =?us-ascii?Q?1SfSXJ1WYg=3D=3D?= 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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) -- 2.36.1