From patchwork Tue Jan 17 02:31:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 643613 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95CBBC46467 for ; Tue, 17 Jan 2023 02:32:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235331AbjAQCcX (ORCPT ); Mon, 16 Jan 2023 21:32:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235286AbjAQCcV (ORCPT ); Mon, 16 Jan 2023 21:32:21 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2057.outbound.protection.outlook.com [40.107.7.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A45924130; Mon, 16 Jan 2023 18:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hkvjwNWN8G+nhgS1zrbERCG3rvinSFzt5SaBXyqm2Bz5YeDvmnBVjodSm+5QLbBl8alqCG7zzXHxQ2f+Q8gzisgGGq3XXONYm6r7tko9CibWRljuPUnJV1TtbQmfU5z15OEqQ1A0hrqZDB1qasdnpyNJJ0aFLQER+VitAKueSaSkZ+wjbvwCLm0gtJP/cK/yZHi2J7LynFB2hY2XKzLseAVcG7+mrI07LzTngQHqAQrbE2tBX0KOTpdrHxM2rbn0h9NOvutR/WKAsKUAHXy9CFzsqbHS6lYlbM7z4lRHKDiIx1rHyoPtYoaLmwBRLXmBaIddm89yAN6HJTdz4XD+/g== 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=Tyha0VYLVYYL61gpGycKJuUWdhgHBy60gc3/TUZI5p0=; b=XZI9GJi8zWotzJcv+ZQPr869iRGKs08lm2XyNF7OhV/wzcHXJs80be+QuKAUTcPbf9EEFTuBoicTMp3pNEcvH9dpo9Su052sB+ZiJyIE5fV5ijIk0RxkUk18IiwVz0RMVPd0Nqcl12GSUr+aM5gWHauch0XL5V1oxgFIHTZbx6bX2lf93axE9HzdnUs9c8brVRrdBRyGbol8ppzaOXbtPRCqzIFJjSwmaZqadQWMv8fkFm73sT/BZ4x3wjYDrtOoJbfI5vxRD/Fx8/2EBuDGs9Dsw1m0nA3slsP9GhUTNU0XprMMx36kLcOVsaFFF+yfb7p77jS5D6Zdezeycd9zlw== 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=Tyha0VYLVYYL61gpGycKJuUWdhgHBy60gc3/TUZI5p0=; b=BfJYA81FNIUrMVoUiZ/FNshmgrP38yecqccJBMNVj6fnCsemJ9DE1XZ2c6A17A0tBFfnhRT2nNplfzHrphjZ9qtYgKO6GP0pleU7hu6keAni3skVyxU+ay9aFK1PCBHHhZpgPIbsxotFBK3hsHhQO+UtjMQVgt9tYYykGxwbPcc= 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 DBBPR04MB7786.eurprd04.prod.outlook.com (2603:10a6:10:1e8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Tue, 17 Jan 2023 02:32:17 +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.6002.013; Tue, 17 Jan 2023 02:32:17 +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, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 1/2] media: add RealVideo format RV30 and RV40 Date: Tue, 17 Jan 2023 10:31:54 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2P153CA0028.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::9) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|DBBPR04MB7786:EE_ X-MS-Office365-Filtering-Correlation-Id: a8ce6366-015d-4e77-2e28-08daf8330cff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KKYw4NwOkSB4ut6THyZBFY1vuWHLaaYChErMrn3FFplyeXah+pBYrv3FQaYxKIw6d+O87neU1Dfnc93xG+n2jO3B+GLkdc05/YT+ajT9iHjvXyPN66lmXECeAx3Y+cftKywUj1wTJ3xjf14YZJY6YjNAL7Zyjd2742A/KxxvAKLyzRHxBVOvPq+JSHGsMUjM0xYlXwXBeKPgaHM35lCXZvFWVjh/4PyV3madx4OrPHBNDcgVc6sLZiEuNMAMvUonNKAVfhcMKq6f4RWKt3K5+loliJUxaVMyNbKzS71LklZyAcmve7E/hif3mCAQFP4SfyjoWAYq2bN7u+qiX2LIfIhqEXWvJD6e23FA35ayHE/2wXYvs+Xi4o8Rklx3R9p7i9uLPMEqSCpEbQtA716zYn/r9vdVhaatvGIppDf2nk6r9rlq7k4i7hInNWhzDbGx2mIejxZdb5PHPSV59rpHVi7qQtqQTJ2aa5lW0LMn+3iF0AhTz3qIglsw6HaNd886xG2yvBc6bsoXMJHYjccjt52cBPZnb172MrHRe8qD7UsXfWBd8VmNGF2kJ9GxofpWzgbb9WOPjxXJropXhvAcVJfj3nLGW7TF7yiM1pUtzGFFHfOECeos+S7m6TlZK4MzGcLZ6rUYOfgsC8KiFSZSifEE7iO8Z7Av+eFzqQR7WzGRaXflmZKK3bXrHVxqf+/1 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)(39860400002)(376002)(136003)(396003)(346002)(366004)(451199015)(86362001)(66556008)(41300700001)(2616005)(66476007)(66946007)(6512007)(186003)(26005)(8676002)(4326008)(36756003)(5660300002)(38350700002)(8936002)(6666004)(478600001)(52116002)(6506007)(316002)(7416002)(2906002)(38100700002)(6486002)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kuXZXSYcn3CjrCkUfQltUf7eFan4nW/1Ly3AEtwlx3vvcdxEg8zsNAmyQm0BJ0Kq8betnYYpIkGeuT7mmoV8NEPhB2hhP5cvEO5Y5sPzMAudxjJ7Fl1u5ggNrdgmGOZqjdkpBktM6urkStJH9az2WfB59yOd8z8yzNf6s5vG8OoCWvuCI20+yZZmJV8j4vkvLK5di0lmCZ2d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2ZUjE474BnyE0MLNaLs5gluhkFst+vZ01ClU+1XFIPU9La3B8afNo2NdpDyWCdn6Y6J4rP+jQkHAU1XgA62zv6t8zUi4euKlx8imdmtFb0MJNziIpndLipOpXGxiVsfUNNJswvL5aJOoNEWVTvcbC9lvn5GQ2Hmxaf2xRWRNJPVATYsB+sFpEHpTAtsXWkyY0kUFUuzCj0OAPTr4gtya/dahaNzJrtxuEKUqNWWTB8lKVcvFwFKSdg5GPU0YIfOQdaDTtWVstMDPUoXpfzyo5GYc+nIhagj3IJUh2Kvre45dbGfR+1EYCf4/09QDdkNm X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8ce6366-015d-4e77-2e28-08daf8330cff X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 02:32:17.3604 (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: Ua2wmvzHWuVHMoFzQI3DXWXEMVqf2hhZbJcLjIveIt+XLjKSwQtUZ/1npOlcY5JneMYLkHsJQIRKh8xhcJmaIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7786 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org RealVideo, or also spelled as Real Video, is a suite of proprietary video compression formats developed by RealNetworks - the specific format changes with the version. RealVideo codecs are identified by four-character codes. RV30 and RV40 are RealNetworks' proprietary H.264-based codecs. Reviewed-by: Nicolas Dufresne Signed-off-by: Ming Qian --- .../media/v4l/pixfmt-compressed.rst | 20 +++++++++++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ include/uapi/linux/videodev2.h | 2 ++ 3 files changed, 24 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst index a0230f357680..06b78e5589d2 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst @@ -237,6 +237,26 @@ 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-RV30: + + - ``V4L2_PIX_FMT_RV30`` + - 'RV30' + - RealVideo, or also spelled as Real Video, is a suite of + proprietary video compression formats developed by + RealNetworks - the specific format changes with the version. + RealVideo codecs are identified by four-character codes. + RV30 corresponds to RealVideo 8, suspected to be based + largely on an early draft of H.264 + * .. _V4L2-PIX-FMT-RV40: + + - ``V4L2_PIX_FMT_RV40`` + - 'RV40' + - RV40 represents RealVideo 9 and RealVideo 10. + RealVideo 9, suspected to be based on H.264. + RealVideo 10, aka RV9 EHQ, This refers to an improved encoder + for the RV9 format that is fully backwards compatible with + RV9 players - the format and decoder did not change, only + the encoder did. As a result, it uses the same FourCC. .. raw:: latex diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 9b5b04b8aa69..0546b00d3fc9 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1473,6 +1473,8 @@ 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_RV30: descr = "RealVideo 8"; break; + case V4L2_PIX_FMT_RV40: descr = "RealVideo 9 & 10"; 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..b121154a6e24 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -740,6 +740,8 @@ 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_RV30 v4l2_fourcc('R', 'V', '3', '0') /* RealVideo 8 */ +#define V4L2_PIX_FMT_RV40 v4l2_fourcc('R', 'V', '4', '0') /* RealVideo 9 & 10 */ /* Vendor-specific formats */ #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ From patchwork Tue Jan 17 02:31:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 644500 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 984C6C54EBE for ; Tue, 17 Jan 2023 02:32:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235364AbjAQCcg (ORCPT ); Mon, 16 Jan 2023 21:32:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235336AbjAQCcZ (ORCPT ); Mon, 16 Jan 2023 21:32:25 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2057.outbound.protection.outlook.com [40.107.7.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CC53252A2; Mon, 16 Jan 2023 18:32:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ASv03ot3JFHPromTMc2iS63ZWUrDYCklfiLbYnfpODHaEFZfL/Y/hPUdtszCJ61aDV+uhxa19FH9KsDAkz+Zr2KdGtEulYtDrMrKVIKGIkj+oEZIDMwSZ/W2GkMyKUffmjfFdB3dafX55dPrY1tdW9gwqOEXq74vv9Fkmrs6UxnjWNmhzGigVfi7dNFBACDn97MBdRUX0dQ4H3mLc/bJcdqQxobR7zyb9qrShxT05TKaBjT1ilURE6aYl3dC6eD5UwbJDVQRbh+Ms2+EOCcTheH7jHzBOPtGVVyXEPN02qFPP816Letbw9BHfPLZ25eW1DmmYGLpT3JCul0m+2NW2w== 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=OZd/pf9Nctz2lcb09rfma/BLcXqoUAi2b/OPSEzICU8=; b=AAF+fh76kQF3KVYF9lRju2vlUzfL5SYYYBzFRYZVBagM35vO9RjzEpUZygzJmaPT0RscJ5CZUuv/yt0cV0iS3crzdy7TIh32az4Imli4xjZGCz9fPEcXI9m6A55PdAOXqYhwCLj3PSchzWRsuaThxGZCXXfIyoOhUYXqrLXx7gq17KwH3wLyeOLS4H5ymlX93o4TyHb3YF3eLV6q6jDUVDifPuuk1MxU8onkztzph6ghJFZFYEXQKjZVVn+xJenATFXtkSfvu8IVsmT7Bn2scax3KfcHxUMOLGjPqWkWLRyCJsjk7qnc5httdV9/N9P6jBbDS/FhYQw3+9oDbzGeXg== 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=OZd/pf9Nctz2lcb09rfma/BLcXqoUAi2b/OPSEzICU8=; b=QR1yLyjyDUve6CWf9OvsqmZeJE7YM1qUPlW/S3TsfXLEncJRwd/a9RXolP/yk/3c/Ymfoqgj5HNspIpBk7AsQWihaDqE0ew3YbqPOXf5s5zgeuqBgk6q5UvwyMQNqGDiOWpjF5w1Au2M2oyGrSuEHfiXjtqyRMLJ9L7feIbWe0I= 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 DBBPR04MB7786.eurprd04.prod.outlook.com (2603:10a6:10:1e8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Tue, 17 Jan 2023 02:32:21 +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.6002.013; Tue, 17 Jan 2023 02:32:21 +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, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 2/2] media: amphion: support to decode RealVideo video Date: Tue, 17 Jan 2023 10:31:55 +0800 Message-Id: <9b8c369d9f303c500a1ac20ae2e8d56b99b127da.1673922423.git.ming.qian@nxp.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2P153CA0028.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::9) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|DBBPR04MB7786:EE_ X-MS-Office365-Filtering-Correlation-Id: 974cca19-2a64-416e-9212-08daf8330f74 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hzDxtiQ7BuuyPj7HVMZAR3WDJbNRYJEysB5pfMgp9vNHoWIviAJD9brG6g0DMJRDOa72678XwUYsBw6JJ0D9pvAfWjiZui5qCCSfganUwxA+uCAk1MsHgOr1+K2LMDocuVMU/F3zOxricXXPn5lGvkTuOPWzCQ/urSVlpVp684A3K8Thkj+AaXV5FqLahIx0cSKaQ0yxM0p2zGWXeuo+hLJjyFJ6KY/z80BqHF855tm6GowCm4kslwVmC21DX/mLaIJNIOA3EEEzQwUbk/xirAyWXVeEyC1vh7mYCtCzIijrxzA8dVYbmmgqE+b8wQ2A9ezawalmSejuGrIhAjng8VBAYHNw73eLRbQ6GPXO5oOMEUbeGehLDA8YTwVaFdXUkNaGxUoR8Fw12/VIhvhBxH1lWn/D+GNglQtOyYwnSiU5u6JDwYHNonhZoJK1CLNINp0QWf9XpiVdzNHtUKe0AFs3fCS141zDc3x3Qhpy+6ZbH7tgWvGRqGyw4pS6cqxb0fGWDMnxi1Xqh1N7+LWdIDfZAnXBf1x6HQ2cNPA+ruA7PqpRQV6jQEdq3nU9X1Ilnq/9z9KHBMQoRs60fXsVrWGaDIxfpkZBp4p7QzjcJDPWbONx+rOmSvsvEvyoea/CB6/CVkaMgsiEPkNS+l4uAzSIWGkqn660OlaJ6Dy+e6WTlN3iKShhGcOHmwMew7sN 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)(39860400002)(376002)(136003)(396003)(346002)(366004)(451199015)(86362001)(66556008)(41300700001)(2616005)(66476007)(66946007)(6512007)(186003)(26005)(8676002)(4326008)(36756003)(5660300002)(83380400001)(38350700002)(8936002)(6666004)(478600001)(52116002)(6506007)(316002)(7416002)(2906002)(38100700002)(6486002)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1R9RGvp2JuqfbM6wkqwxWIhgRUs/YPVh4DMvX4mYOUArfL1JDUHNkrfyTJJ8TgAfmzTYAMYFYvie29b3nzARVcKBNDnWHCf7NkCZrbqGgTOLQm5UB1tSSw/h45d1NrpsMIW+xr97spDIB6PlowS1JyFA7YGhcdSr2XM++uxJGnGDWfpxSouS4bMPL1rLc9hykynIhyFmVgZeSyNF9E7dJObQmrg7uE14F3y3lq/k2aGnApFtxRdwvkYRkukY4WIBetNO88caM2Loy7vonK6RRrIJmF5ff+XJm0/53Q2snaThcSA2t9LKkzGSjUAGRO9hi4e8F71rsT/9wdaZSoPBxG/paTpiH27C9IHNXj8t0hCES92OthwNX4obAtji9USj/DtLknGEuTbgQODS4mgIHRjyOVZ8/BM79d0dVWegdVE4kZJ5N2EfB5X6PIIGU/Bwy2yJE15yOTyT7Ny5PO8kPKr2jQ7hHqCT4jYdq5g0Z5zcf29zKQ2fsN/g4RQOsvSgIMDfVAUPukNOGAhnBuK5O9dUYXhO8hLF+MzHRDNeS+onQsRy/hYHIcUH+4aGZ4qlr+2gD1hi4ehjoYkRPuf3WAjSyzwNfOtbCqfXpWln+QUnPYCz2+cN4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B6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 02:32:21.6102 (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: 0eaDY7EBjJV6aRfkJjfvezpsQZP6GI4RXPCLh6BGktRoKFKopq0yFyu04Tvm9y/Ous9HTiVrlo1GwvCEAHDO3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7786 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org amphion decoder add support for the RealVideo video. RV30 and RV40 are support by amphion decoder. Signed-off-by: Ming Qian --- drivers/media/platform/amphion/vdec.c | 14 +++++++++++++ drivers/media/platform/amphion/vpu_malone.c | 23 +++++++++++++++++++++ drivers/media/platform/amphion/vpu_malone.h | 1 + 3 files changed, 38 insertions(+) diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c index 09304b96f40d..03477998b9eb 100644 --- a/drivers/media/platform/amphion/vdec.c +++ b/drivers/media/platform/amphion/vdec.c @@ -172,6 +172,20 @@ 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_RV30, + .mem_planes = 1, + .comp_planes = 1, + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED + }, + { + .pixfmt = V4L2_PIX_FMT_RV40, + .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..26039741166a 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,9 @@ u32 vpu_malone_get_version(struct vpu_shared_addr *shared) { struct malone_iface *iface = shared->iface; + vpu_malone_enable_format(V4L2_PIX_FMT_RV30, iface->fw_version & MALONE_DEC_FMT_RV_MASK); + vpu_malone_enable_format(V4L2_PIX_FMT_RV40, iface->fw_version & MALONE_DEC_FMT_RV_MASK); + return iface->fw_version; } @@ -563,8 +568,22 @@ 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_RV30, MALONE_FMT_RV}, + {V4L2_PIX_FMT_RV40, 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 +1008,8 @@ 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_RV30, {0x34010000, 0x0}}, + {SCODE_PADDING_EOS, V4L2_PIX_FMT_RV40, {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 +1022,8 @@ 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_RV30, {0x34010000, 0x0}}, + {SCODE_PADDING_ABORT, V4L2_PIX_FMT_RV40, {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