From patchwork Tue Dec 20 08:39:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 88375 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1p7YAM-000qoL-2A; Tue, 20 Dec 2022 08:40:02 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233054AbiLTIj7 (ORCPT + 1 other); Tue, 20 Dec 2022 03:39:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbiLTIjx (ORCPT ); Tue, 20 Dec 2022 03:39:53 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2079.outbound.protection.outlook.com [40.107.21.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A67115F04; Tue, 20 Dec 2022 00:39:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KsyFXuOej+EwMgHhb6fsBhmC/ZY/enH/E4VJCj5yz++WGjicir64Qu5Dh9oTXFdCaVSsdOgGGTEvHBWifpLNzesyQ4Vz2GI3pYGSZMZiVWLOUTX2pmijDJ+FaJ8UOG6/YYbOtOJ2naXjnuFA5fCQNZ35Arlo21dzAiYeT8WmkTASNX1u8RabCoPVPmgCVYQ7E0j186TwGPKUG0g9c+itdgI0gdvb+lGuvuYs2r82FfrvhAt5KnEwRmSKhZbnSINrHZEW+RhSxp0vNxw875I6BL7f5EyQzXiEHg0F+0bAYIZf0KOd52GuF7NX6RVt5f2Lp2NRUWXOaM3PtKPTs77l1A== 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=whHUPORmun3BFMevsg7TwKmjp6JejX9t/s/Y9QImNg0=; b=ixMH2dRkQdPiPhNO76bZ36dIjLdfRhSD0SczcOtU0+dv9u9SewJ6NRHC/7JMsidIRbhs6w0vE7fufBppOptw84NOewN/f4sxVKgV56S2PmDr65jQwUeCbYPlQoWbP9Anaart7UL2zz3K9bXOOgvaoKVC/Aa5ZQEHarjYJ7AQxjqSjEr3FrY0+d8jj2IpQfMuDv8ygHIyyOzT8grZS+29/NuPheqB2125jQXJE6Z/isanf4LSXKSlbA0o3XZJ5bpq8CjCm+W3epQ/wrxMkvxOWBTDxsxhY4qEwoczSslG117VG5AhGh6lCcQVDsFGTCnZ0pcjHUcHipZ/Mr69Wijgdw== 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=whHUPORmun3BFMevsg7TwKmjp6JejX9t/s/Y9QImNg0=; b=F7zFSDo2Rbk18oYZkMuM79CXHg+GrKQB3jTIewpT0KoTsBsAaF0e7NGXtkXImKfiosW5fQ7NY2Yn1+iZifuSDbkTZ7j+uj1nD0b0DCwgKD0mECrUlfEgZPBQMS+rFQ4y7/wUKek1NEzGxvr8DqG0k8YjcHR91t5cjx95pnv/+OI= 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 PAXPR04MB9255.eurprd04.prod.outlook.com (2603:10a6:102:2bb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Tue, 20 Dec 2022 08:39:49 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3a82:42b3:f1ed:5c3d]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3a82:42b3:f1ed:5c3d%7]) with mapi id 15.20.5924.016; Tue, 20 Dec 2022 08:39:49 +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, xiahong.bao@nxp.com, ming.zhou@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] media: add RealMedia format Date: Tue, 20 Dec 2022 16:39:19 +0800 Message-Id: <969b6905c945a1cf0986a2188290ddf3c52c5511.1671525379.git.ming.qian@nxp.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR03CA0098.apcprd03.prod.outlook.com (2603:1096:4:7c::26) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|PAXPR04MB9255:EE_ X-MS-Office365-Filtering-Correlation-Id: 441ab82f-0718-449f-e270-08dae265c170 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ekTP+uGs2Ual3FH4orfCAGmr3YTRustcV22Xt8ifG7jSTL9SeswZwgt/boO7/ZH26bVaUsFhxzJ+jXtIlrOYrhsLrOm9HU9fjrp5H9lZHa/JASkmtQTfydbUj6jSaPr7gY22yvPMvd1S0ryrRLTGL44FibHUTMrWDE+7dWWrS2RWGzx2ZDR3ZVbp3q0kK1hzcsdj7XKAMQeQS6dOZMv3Qsczlk1qr1giQRGYXl7q0RqTMavUnjtXKkRwMDKz9PW+uoRkoesjYvB9vmOTBRoK4cxSoRdY/nCyV6k/pvpxyoEnIjMHHdXQHa13yxE8lzgn7N9uJdWV3iT37BnapYJqnWDm4E8huDB5nxipPuoZ48E/m7G6i4RaLCoEu2Xv9T0wplARaGXiwjceCvxkrv8jJl0+uCEQfBV0IZ2c1NR7DHwObMDa4P+l9Ix8cPIje9PAUGdTBlhmbmFVc7OZvCmwDgFmdjQJdOjJdOGndbzVqhybbsw1dS6gfhVUi2sCrxMMA+oYc2DxWPvxseSdGgwsS3iIBKVH04SzoMt4SFnW2n4ivvl+JF9uvtAVyXcZNtgBi7QWmITJT7cuYaVXTMbGvMvntpuqG5nAFzwyPsxHU796vF23hEAAKlFd6MxOISb9uRoOcCubk371kAnVGfD0qwWoHmV17OLC/zcBx1c5A86ECDUvI0e1vJ/MttVnazbjM1YdSAtKYfB08BBnmfJxFw== 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:(13230022)(4636009)(346002)(39860400002)(366004)(136003)(376002)(396003)(451199015)(5660300002)(7416002)(86362001)(6512007)(52116002)(186003)(26005)(316002)(6486002)(44832011)(36756003)(6506007)(478600001)(66476007)(38100700002)(66946007)(66574015)(2616005)(38350700002)(66556008)(2906002)(8936002)(4326008)(6666004)(8676002)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l/PznE0gxOMrTDNb8EIvNJUs8mJMk2VPvHX+t7FPGphzA7RfnOlje0arsIdMV2yFIcsgDam5Zij4CCGH4IcxzpkM9JNEvaeuerU1zK7un7ta+ysEr20z3FByjKFAnhq4y65hFffrvtN4ypKA5KVmySzGCgwWJWhgiZJB77xGvoCbc8V+WneFciSqkLfi2TxGCxyOM0thTj26oVx1L3iERNg3aOfc4nYEBQoHeFEr7UeN64rkt/KobK52TFsl8vCEItsUgoN/tsZ7mXczhnsNatbRF5fcv1otTj3bWSHPtpUW1zvlu0DrIaXBnt2j3P1q/mh89IZX9biRvVO8vMb/0FuPIJRgEKcA6OqrzFO2nzjvNF+PMj7vKYe1jQAHNqfTmrOuxnDnHAU20K12uHwBD8VCVUgj8+w2CQ1rLFG7wXuO+epOoQ0KMQvTSqJ3nB9JKe8SbhKxuGqBsZO9MkxnJGYUr9XrhhXITpZgS9u6zNFou3a5pyvOCifw80yRN3J7WZXeWkcj9UJh3ak562lqR2YamQA4Jd3ghAHt39TYmBZQAitNVH99mZq8K6kqZtuZj7PVGC+QMmj3r+zxecvUVPI2bRLtdD6U3bOWqMZ5nWsK6P+Q+FVNJk20FLk4SKMGJKeiDmKsatddZq0EamkMOafSrqTqs7usyL8hD6PZggRL5cSLs04D2+zlhBLfxA+GNL9jWyY3yOZSzsacDoZMklLOMl/lIQGb2hya8akJ+WpoFgX4SF6RUFqiDZe85CkH+3X1fAAiLxBYlaxzSHwOC0WMbewQP5BnCUUXXglPYRuUGN6SXzO6dniFd0f3eloaAKaWXBPZhS79FYE9AjjFe10IWABtKZYfpf9iDJpvWe9yAm4JhGVUIO7zUH5+TXopEHhOfHqQC7+ImAWnPv4FMfcUBGdzx/Voy/3w7/KRYwlf1EN4KDWyPvHQ23R4VH5TIjHxXeqbyrillqbAv7JGxya7lrzAluQuBD8ZQhLGg6jCTOpsxO0pn5e59aUCXbTiiOnPbOHmHQqnvKajQsSi082uXpYODgdMHqB+HzNvppqzMlT4vNkUahIepBOsCEJIJumuCwq+FrE1dF25VbY1eSaqq54HSuTvmhnyiWPitoD7LWw/ecESUnQT2npRKbarBwXV0TemJa5xYZE5t1cjYsKBTDFlOznfQ2jG+mzkrADbDASI8LXyLZHw155vIvPU0GTC27wAnJEGkmpoI/YZ+COVgeu7BOqlBryIiCoYLBWTWLVK3V1c7ZkZVa4jk5ajVvAn8vhS3Ijns++El0VXfnL2Dexdemn+B93pcRLD5gHNir7cx02/J81GE8gep/Yf8Q5DlcsV2FpZZj41tCMJ4M3GDvLw5Br6puJLYfXLYaRLtYHUVIZa2jJeMK3B1X1D+UL5HlodUDeILryHfQu773OsIhJ5l4uKRXAjAMEeQr1O3TDfzdp+DlsydLY+zzhIlpKpW9GKHwhVGnl+qdFLiMKiWnTa+FY9QBNDr0G9Sllc0TlgL9PoRel48g4zUx5AsEiKxxQNbtXstd2O3Sw8HJ+8AglIjVk57KnzNK3z4Xy0JwXZg20dIS5BdxtHRnfX X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 441ab82f-0718-449f-e270-08dae265c170 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 08:39:49.3196 (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: a19TAyWtwCF0ZVtxbFmiqJ4mxH0YVhenE8+c+LcQBV7ooUDZmzaB88xHOXKAh3HCeMU0ZX3n7AEtoaUfMGoVdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9255 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 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no RealMedia is a proprietary multimedia container format created by RealNetworks with the filename extension .rm. RealMedia is generally used in conjunction with RealVideo and RealAudio, while also being used for streaming content over the Internet. Signed-off-by: Ming Qian --- .../userspace-api/media/v4l/pixfmt-compressed.rst | 11 +++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 13 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst index 8794b92fde36..31ba2c00091e 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst @@ -237,6 +237,17 @@ Compressed Formats Metadata associated with the frame to decode is required to be passed through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control. See the :ref:`associated Codec Control ID `. + * .. _V4L2-PIX-FMT-RV: + + - ``V4L2_PIX_FMT_RV`` + - 'RealMedia' + - RealMedia is a proprietary multimedia container format + created by RealNetworks with the filename extension .rm. + RealMedia is generally used in conjunction with RealVideo and RealAudio, + while also being used for streaming content over the Internet. + Typically these streams are in CBR (constant bitrate), + but a container for VBR (variable bitrate) streams + named RMVB (RealMedia variable bitrate) has been developed. .. raw:: latex diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 9b5b04b8aa69..a4d12eea7fc5 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1473,6 +1473,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_FWHT: descr = "FWHT"; break; /* used in vicodec */ case V4L2_PIX_FMT_FWHT_STATELESS: descr = "FWHT Stateless"; break; /* used in vicodec */ case V4L2_PIX_FMT_SPK: descr = "Sorenson Spark"; break; + case V4L2_PIX_FMT_RV: descr = "RealMedia"; break; case V4L2_PIX_FMT_CPIA1: descr = "GSPCA CPiA YUV"; break; case V4L2_PIX_FMT_WNVA: descr = "WNVA"; break; case V4L2_PIX_FMT_SN9C10X: descr = "GSPCA SN9C10X"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 262ef10cfa02..a7a7969ae4f8 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -740,6 +740,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */ #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */ #define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */ +#define V4L2_PIX_FMT_RV v4l2_fourcc('R', 'V', '0', '0') /* RealMedia */ /* Vendor-specific formats */ #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ From patchwork Tue Dec 20 08:39:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 88376 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1p7YAP-000qoe-FN; Tue, 20 Dec 2022 08:40:05 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229500AbiLTIkC (ORCPT + 1 other); Tue, 20 Dec 2022 03:40:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233115AbiLTIj5 (ORCPT ); Tue, 20 Dec 2022 03:39:57 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2049.outbound.protection.outlook.com [40.107.21.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1DF816582; Tue, 20 Dec 2022 00:39:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W5+Itfd4cc+0Yz4JYt5Wkwz+i3MkP+VuhmTHPxoq79aKZtFcmXB49v8eAJktj2AOG+vaTulNM/hb09QO7G2dDljXxMWnTUQhXho3OsIuZPPlyysOGP8LgPxOcDlZ4t+73WRfqRQYY2JLLzyF9hEkZJCx6PwU6avS694y6ToPE4LZZho52IV6rXpXof7gYkwq36MmKoBG/Tnr/mECzpBhTqt9fH4ylJrS/taggdm9Su3Rr2t89MQmIMh7A2SXIhc7dOLatz4x7R5t/Y7Aufv80w4Zo3NVTEf2wSF2KzEITqQYR6B/j8OBhrAmEfWr5QFMUbAWq1Rp0COAeYs/IkDDRw== 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=CgSY55gUz2N+idyDtg+l8a5zVEJNu4gnZ9XzReY297I=; b=Z4HMJkTk7gl3gYoHSMGvMss8ss3d2UTldVdEVpuMs9zi6esDHrddzq/BzlE8uoM3GeYdDlcalhtdOgIHYLih1omRBrIq9xImcuQVGh9N4nAJuCxtpRK5qFs3HVdVZWtZOdSynIabuB/Ov16HudsF5ASqjJKwl6tgwN5MNL2t6RW071+eVDXZnNbwUMJFt7dQYTuMgAcf/9gTmNAAOUIDV11iJa47vJDMaEqHwz1U8qS9fGg/2ZSWISBlt58cm+FShd2ZokyfRms95vfy0Kd5kncGJ3w689f8fBi8tDuZjKv8VEL1Ve0jx+rqCznRLGnKmWS1NZTpH6qlMyCZkz/9wA== 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=CgSY55gUz2N+idyDtg+l8a5zVEJNu4gnZ9XzReY297I=; b=CZSSx1GZ3jENuIj3xGNE9whZMwy2ihXlsPGOV08+tdWS2C3e7WPfMOCRTV5vxDnCAgnTF4vk6qN2eSKZzYGS9Y0AkVgMlG1dKHb5GdPCO9VEfPItemuYruxqoza1pH6IMAYP8H+yb09Db6WHT0k7SGzPcgJcCQc51rqm+a/juM4= 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 PAXPR04MB9255.eurprd04.prod.outlook.com (2603:10a6:102:2bb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Tue, 20 Dec 2022 08:39:53 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3a82:42b3:f1ed:5c3d]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3a82:42b3:f1ed:5c3d%7]) with mapi id 15.20.5924.016; Tue, 20 Dec 2022 08:39:53 +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, xiahong.bao@nxp.com, ming.zhou@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] media: amphion: support to decode RealMedia video Date: Tue, 20 Dec 2022 16:39:20 +0800 Message-Id: <90ea729efa90529e47f0bfbcf31f6a0a9b00d796.1671525379.git.ming.qian@nxp.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR03CA0098.apcprd03.prod.outlook.com (2603:1096:4:7c::26) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|PAXPR04MB9255:EE_ X-MS-Office365-Filtering-Correlation-Id: 07272d81-b33f-40c4-e5c1-08dae265c3c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FlTU7G09fixI6B2NEHBfu098+RzMgO75U6jIcynJEKkD75eRg1Ji77KMdc2pnpjQBp7AuoNkwkTXARdQPgmVq5Fm6qRPKpdcdgl2dF8Bekawq5Zo6oRmqoMDcayCST7+h1AOJrCZ9d6LWTlSUe1qWZYralntVYLxBEjq8Fgh9J4/p41UTskQc0TYHTZ1WAhxMpyCLlgXTRGh1oAvLdh+gm0Xjwb1yQ1N5z2RF6EA6H2AYfY7lOTbebXSGTkkr5VDyeKxLUxGHWlQlTN4vY9zlmjsoJ3EcLUnru9vdcSX/chp3mn5vHFWOnYbysZloKB/O54lWyursEXmbgypERZ6k2M9CC6rN/pKEBZ6tsRsxHc85PumFQokbKhN7PE2sZEkGXjchkp2czU11Irjjb55+Q32xdKD5EzxrzGyQ83LKGZRm04Gab1ElcGJC7ot8RQy2OR/BF9Mmh5qX7EU1aiV8e28Ev2JFgRtACb1HgbsXYQ6URzkLC+4iVp8dhAfSjNw1ubO7xMwGngnOIeQcrgOSyxhwKZMnMQGTk22i8WVCeL1J99gby8CD0EHHM7rk7jyWEzpVakVWA4t8d+6h+LuQCb5VYqxsm1g45CKWtLDKhB0CTthNrwB7tmkIk98lOBYYsRKV3CkC+EDQJP/L7YbW9fs812en+0Or/t119iwHCAafxTkXZfhBDYrQLUYSbyl 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:(13230022)(4636009)(346002)(39860400002)(366004)(136003)(376002)(396003)(451199015)(5660300002)(7416002)(86362001)(6512007)(52116002)(186003)(26005)(316002)(83380400001)(6486002)(44832011)(36756003)(6506007)(478600001)(66476007)(38100700002)(66946007)(2616005)(38350700002)(66556008)(2906002)(8936002)(4326008)(6666004)(8676002)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Nauq1CM3t78JcRq9+wFGoqJ4bBO0PMgxeVEAPjm+rjokJXn/m639+iHbLduNpJ645EW5PFpG4LQAU5+Jm6q2KJtnB5ocatUr8cc5pjokhEQK/1BSFeiHqG+ORZ8+DKyuWW+fEaZaiD2kTX6zaGzkz87X90+mzQvVJI/qnvpitAdMz+ah6GYXLeN5w43IYASs/RHf1oeBMpymNZ7Etaxhh2aPPE07/C8YP8Nj4Q4xirqkI/Z0fHe7onspdyc+xp6kR0e9YyVMhQ8yppOSJI8bi+TcY+UDbXM6vgVH6bGJ7azQz9nWISc1xatoJwJwLwq+EPOjHzDhpld0nSnEIKCjPiYdBvQBqsviqrIEA9gHKNNHGtpj9gpXhCvIhofvcLGnKgOQFCDcmwdtCTZsMig62CbyNkSsQKzsK+vebxjdpJ4936GB0Jc0J0fx7YzSV8oYeCKwNYHQuYWaGqGByVfRkSrU+rW7dy8a3xW29BIfFUOdXPenEQo456EN9OY1MPEobG88Mpg72cCo6AYZvEhREa5SUJ43DCYIHdgZG7mzLpPWfXI5WhiR2+3c8NepHgMbqnJdJNN/YGH3Zapblsv6jCkJ2Hl7gQUvy/g07NTd6ONe67VOqUECIUJ8RXna820HIwLQp+WjMdsaAE/Ass2ryfgcNp3xbapXb46lK+/Z7HXAELJFC4DYJTroV0sMJ5NLC35PdHaEk09HPbDjfhHRCUB3txO4M//pJEYTqwscbZjCSJw4tcgBXqcH/bGv6POmtSp30StlfbGRwRnoYpbinhYxD4nT8MJahbweqFr99in7B3u0cNoWbYjGPrDgfAaR9miNQud9azRTinlsMdCxWFjVr010mbEuKClKgv8AsCLZGrR6xUvgU0lljWa+9UNkjJvS8LBWX0/iJaer1lmFhLzWTc+ZtLRdnuRr8cDq+onQ2c8cIMK4s3fLVCxOEvIsmcntBJ40TV2hYYq9i4SIb3LndwQZPd1KEDEeaL2J+EYQ5n2frvTqU5tAzdt7v9ShLe2XW2xTLFB8k3DEKeY8WVDj1diAukUaEUj22QM+k7hek0KWE9ZX1cIIdxGycV0PFKVPpgCs3IsnF9wyOegnVhCGMW5RocLF8nX1e+aVOlQpCT8/+9dDwG4i8ezJMOG7tCn2dBPeeeNEDb+d+bGyqB+6M4I+/n1tT6wH7PHmIcUs/BRYMnFeosWeKgoThXqmcQpvWKpA3qDLQV8AKzhRyJQh6Fql4sNbkETI2V5eupzmlE8ZXLWS9CaWsj4RpJ89OA2LSk4+FCgqqNzczOaIra/4UAqdf0PjWhn61pCgMBIPBuByAIIM6vyXPahgd+3UiaonHGcYof5ikmXVJRENoLReCHr1Q6FJbX/G71O0xbx5TbIhELji5xREtlTkbQJy5n3PBgcjPOhY3x/TpxLDo5qUG7RR4gzG0EF6V4E79CLoK3fzSwSUKOopHXsLta08y8GjK/PyNbi/Pyz/3ZosAj/HzhEN/wTpIiTMgzq97iQ9yFXmDMG2hcNwOhUd50iEvzjJsrxGt12CDypu+llUnqD6jiJ9PpNZPHOLyMswwrQkTk7iB3y4QLhcr/xxazwN X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07272d81-b33f-40c4-e5c1-08dae265c3c4 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 08:39:53.2100 (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: tJDKzhudf34hKsqhijY3ugmO36N5YCGHyAK9L8P+YQN5ALhf4CuqYcWkT2jL3w5NJZeJRAGJJmbSlqVDVpJ0bA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9255 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 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no amphion decoder add support for the RealMedia video Signed-off-by: Ming Qian --- drivers/media/platform/amphion/vdec.c | 7 +++++++ drivers/media/platform/amphion/vpu_malone.c | 19 +++++++++++++++++++ drivers/media/platform/amphion/vpu_malone.h | 1 + 3 files changed, 27 insertions(+) diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c index 09304b96f40d..7e47465ee749 100644 --- a/drivers/media/platform/amphion/vdec.c +++ b/drivers/media/platform/amphion/vdec.c @@ -172,6 +172,13 @@ static const struct vpu_format vdec_formats[] = { .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED }, + { + .pixfmt = V4L2_PIX_FMT_RV, + .mem_planes = 1, + .comp_planes = 1, + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED + }, {0, 0, 0, 0}, }; diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c index 67ba637c4c7f..6e3626b74c7a 100644 --- a/drivers/media/platform/amphion/vpu_malone.c +++ b/drivers/media/platform/amphion/vpu_malone.c @@ -68,6 +68,8 @@ #define STREAM_CONFIG_NUM_DBE_SET(x, y) CONFIG_SET(x, y, 30, 0x40000000) #define STREAM_CONFIG_FS_CTRL_MODE_SET(x, y) CONFIG_SET(x, y, 31, 0x80000000) +#define MALONE_DEC_FMT_RV_MASK BIT(21) + enum vpu_malone_stream_input_mode { INVALID_MODE = 0, FRAME_LVL, @@ -478,6 +480,8 @@ u32 vpu_malone_get_version(struct vpu_shared_addr *shared) { struct malone_iface *iface = shared->iface; + vpu_malone_enable_format(V4L2_PIX_FMT_RV, iface->fw_version & MALONE_DEC_FMT_RV_MASK); + return iface->fw_version; } @@ -563,8 +567,21 @@ static struct malone_fmt_mapping fmt_mappings[] = { {V4L2_PIX_FMT_JPEG, MALONE_FMT_JPG}, {V4L2_PIX_FMT_VP8, MALONE_FMT_VP8}, {V4L2_PIX_FMT_SPK, MALONE_FMT_SPK}, + {V4L2_PIX_FMT_RV, MALONE_FMT_RV}, }; +void vpu_malone_enable_format(u32 pixelformat, int enable) +{ + u32 i; + + for (i = 0; i < ARRAY_SIZE(fmt_mappings); i++) { + if (pixelformat == fmt_mappings[i].pixelformat) { + fmt_mappings[i].is_disabled = enable ? 0 : 1; + return; + } + } +} + static enum vpu_malone_format vpu_malone_format_remap(u32 pixelformat) { u32 i; @@ -989,6 +1006,7 @@ static const struct malone_padding_scode padding_scodes[] = { {SCODE_PADDING_EOS, V4L2_PIX_FMT_H263, {0xb1010000, 0x0}}, {SCODE_PADDING_EOS, V4L2_PIX_FMT_VP8, {0x34010000, 0x0}}, {SCODE_PADDING_EOS, V4L2_PIX_FMT_SPK, {0x34010000, 0x0}}, + {SCODE_PADDING_EOS, V4L2_PIX_FMT_RV, {0x34010000, 0x0}}, {SCODE_PADDING_EOS, V4L2_PIX_FMT_JPEG, {0xefff0000, 0x0}}, {SCODE_PADDING_ABORT, V4L2_PIX_FMT_H264, {0x0B010000, 0}}, {SCODE_PADDING_ABORT, V4L2_PIX_FMT_H264_MVC, {0x0B010000, 0}}, @@ -1001,6 +1019,7 @@ static const struct malone_padding_scode padding_scodes[] = { {SCODE_PADDING_ABORT, V4L2_PIX_FMT_H263, {0xb1010000, 0x0}}, {SCODE_PADDING_ABORT, V4L2_PIX_FMT_VP8, {0x34010000, 0x0}}, {SCODE_PADDING_ABORT, V4L2_PIX_FMT_SPK, {0x34010000, 0x0}}, + {SCODE_PADDING_ABORT, V4L2_PIX_FMT_RV, {0x34010000, 0x0}}, {SCODE_PADDING_EOS, V4L2_PIX_FMT_JPEG, {0x0, 0x0}}, {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264, {0x15010000, 0x0}}, {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC, {0x15010000, 0x0}}, diff --git a/drivers/media/platform/amphion/vpu_malone.h b/drivers/media/platform/amphion/vpu_malone.h index 02a9d9530970..c95b53629199 100644 --- a/drivers/media/platform/amphion/vpu_malone.h +++ b/drivers/media/platform/amphion/vpu_malone.h @@ -41,5 +41,6 @@ int vpu_malone_post_cmd(struct vpu_shared_addr *shared, u32 instance); int vpu_malone_init_instance(struct vpu_shared_addr *shared, u32 instance); u32 vpu_malone_get_max_instance_count(struct vpu_shared_addr *shared); bool vpu_malone_check_fmt(enum vpu_core_type type, u32 pixelfmt); +void vpu_malone_enable_format(u32 pixelformat, int enable); #endif