From patchwork Fri Oct 15 08:21:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 12560653 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A82BCC433FE for ; Fri, 15 Oct 2021 08:24:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 920FA6115C for ; Fri, 15 Oct 2021 08:24:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235376AbhJOI0U (ORCPT ); Fri, 15 Oct 2021 04:26:20 -0400 Received: from mail-eopbgr10082.outbound.protection.outlook.com ([40.107.1.82]:31998 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235308AbhJOIZn (ORCPT ); Fri, 15 Oct 2021 04:25:43 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=awKNHh8aGC3C9XevbeRnz9a/QOClBNyHA2cUO7RpBwy/AOOpIggOfsfC7erxURRXDKW7fiCNnKAmG1TGXxglR3cZkdwRIpFAnhZ8I+p+bKHNJL6nYiYf5W9kdcA7ngVdURQ5w7ZW3ZKLyI0t7WYMGT0B1CuanX/W+HHZWQJTpUa+zWIvna9R1WSn2Fh2LCvNsKdN/zakbSAENSCf4Zqkp4a0ZyOY/SiBKJsoY+80PqgoSpoCAXHj6KyjaW/TyR/v6sJLP8Wj8MrCPNAa3GFOBke0376yhqxVSxdm0c63QL/12Pv0ZyFsadZcmOF+UPqfPMITugrEojRgD4wU6jIvUA== 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=TkA5BDzuVm3hGAYRVh5eL4H4ij1Lxg88124qDM58R4w=; b=BYNbwm75DemkMjgHsvmi04K6ezDk6/rB6jG/CvN7tHKIX6iSu67olwdOq+4sAlrAtuN3INR52FV4Tzs2goRRi9HKaA9w+hwD6Yw4ltdzWEHR2rIYk7fyviblVcvvq7eeYyLR9irCAHWBPIj3nBSpbczoh3xMTOPcMVejS2yzSp62bbx/aDV4ZTAjTV1zO2SJUui2IdO0TWimPHs/XzTJO6K4hlolvY/SGMby7nztEZPNIhspJDuheZx4RwP95wQjGt0RYavswxF03au2IQy2dVYfcCis6BUX29yy7CScOR3EVICvy3Fdm51BwDt7BXzRCWv6ZvvYFYk2loGtEuESXg== 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=TkA5BDzuVm3hGAYRVh5eL4H4ij1Lxg88124qDM58R4w=; b=P2PUQlTSbIXHfs97nzXGIMIP0i1ROTO9PhcXLEgmKcPXWjONjLBSzs5AGHXaykdjkQ2XpdPMw12fA03PpswI+LwqdDio1dclpuoK5SCNDBkd+5gkM2Yodtr406hnEK+J6KoN5wqgZit3o3Sh3HpeR/Z39KJghZ/3DmnFXyvutOQ= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by AM6PR04MB5750.eurprd04.prod.outlook.com (2603:10a6:20b:ab::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25; Fri, 15 Oct 2021 08:22:57 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::fc3a:8aea:2c92:3886]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::fc3a:8aea:2c92:3886%5]) with mapi id 15.20.4587.026; Fri, 15 Oct 2021 08:22:57 +0000 From: Ming Qian To: mchehab@kernel.org, shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de Cc: hverkuil-cisco@xs4all.nl, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, aisheng.dong@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v11 02/13] media:Add nv12mt_8l128 and nv12mt_10be_8l128 video format. Date: Fri, 15 Oct 2021 16:21:51 +0800 Message-Id: X-Mailer: git-send-email 2.33.0 In-Reply-To: References: X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 Received: from lsv11149.swis.cn-sha01.nxp.com (119.31.174.70) by SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Fri, 15 Oct 2021 08:22:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c91d82ed-fd1c-4dbd-742a-08d98fb4fe30 X-MS-TrafficTypeDiagnostic: AM6PR04MB5750: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1CJvykYbIrxbXAEOS2qkxK70OXzh3aeGBmE/HfRzrU8JWz+IGv+3f06+anntxC1MrHPxtsv61LcDqrM70cL46IMBXYdBpydJb5OFsWU4TG7becNT5IsAoIGYUSYkuqPLqDLfeeWq+KRpgtGN8fta9KMIu/RvpH7VI0AEfoD/WUFB60Hf6Jog+ipVTIc6uLfaVXfkpN3d1zMsgL7UK7u7olV1qiFxdpAjab3beP6+QBw6HPr0whaIjktbJsSWmQQLK8TquyPSe1ZgDmiW+WAI1Oz2AMq4dC/RzpkqFcBCSzKyjxJHzmxb9LKTwsjRoKZwby9A9/6IW5NjGGLKj6DmncmzL0nwQdvs6ic3FlwSUYd1d9j5xlRJKgCjyN+xuD62biU/z3IqlcPwx602Il3lEldC/exJTT1MSEZEJh/bbjr9P70nYVlbhPJOZXGiO4/oFHPImPkS68aYAFAJI+Wc+KR35kYC0PHZuGU1FirjHPwVOsqzpC9007qKYKt9cZmk20fhCbDcLCXNcF8X2bc3XI3zVPHLiKPF4CNbsVqar1JGofVewF4uj1Hvtu7WJKl2B5k4xJBDh3I0oGL+97bNbDtFEmCD6BVYK5jAtCm35SVI9lj6ALGQrp1nHNrNsCHwjE989xV/UzKsH+nscAAIxWRMEU7RrEbF7iDL4T2EKSscD5W+x+tzb+YRRxh5N3xZIq4DWrOyTPMygcCmXAoBqSi1C4VY4XUY/fc44wrgima8hdGisCWm653YnZU4XIJRzHDaUWpL3H4yIHm/v0Y7AWgL/1q5pSgH33sIpJ8WO+M= 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:(4636009)(366004)(6486002)(66556008)(66476007)(7696005)(316002)(26005)(66946007)(2906002)(4326008)(508600001)(966005)(8936002)(2616005)(38100700002)(5660300002)(44832011)(36756003)(956004)(7416002)(86362001)(52116002)(38350700002)(8676002)(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C7lvn2ugE8Ankcff/I/bpnq3fTfFIXv24UNPDDivF33vkpK/0By23U61uLYjN7sxacEQwlwhZb8eU7+5fX8tQo1dxnnvRk+ykqCqdhphTrmbQraQkxhfAiDxi8jvHhOh/M7x1YkycsYTWrrApUCF/DEdlaSO2uH5XKrspV/ZED/hqp8KBXbL/JNAjmmy3/zVzAhugfyEsHG9YAqoHiyQ4P/osYRAuZA7lsQwj8zFbRanNQp0+vcYxsyyejwBs//zYFxu82d3bbdDRko8QtToyhnUKvoKARtIRXzsPvZf8FE1rfXoWboQ4oud40kkBFFDoeH5gIhzyGyF1Xvt2WCJsLU1AuPlJhC52eO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c91d82ed-fd1c-4dbd-742a-08d98fb4fe30 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2021 08:22:57.2848 (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: i0SAxkWRbO6y+d1ylQHHC8S66fV93pKq0mTtu46zptzNKarPipOlHBuqxWoh9hpjP0yJDycDGbISOcAWF4ezVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5750 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org nv12mt_8l128 is 8-bit tiled nv12 format used by amphion decoder. nv12mt_10be_8l128 is 10-bit tiled format used by amphion decoder. The tile size is 8x128 Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng --- .../userspace-api/media/v4l/pixfmt-yuv-planar.rst | 15 +++++++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ include/uapi/linux/videodev2.h | 2 ++ 3 files changed, 19 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst index 3a09d93d405b..fc3baa2753ab 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst @@ -257,6 +257,8 @@ of the luma plane. .. _V4L2-PIX-FMT-NV12-4L4: .. _V4L2-PIX-FMT-NV12-16L16: .. _V4L2-PIX-FMT-NV12-32L32: +.. _V4L2_PIX_FMT_NV12MT_8L128: +.. _V4L2_PIX_FMT_NV12MT_10BE_8L128: Tiled NV12 ---------- @@ -296,6 +298,19 @@ tiles linearly in memory. The line stride and image height must be aligned to a multiple of 32. The layouts of the luma and chroma planes are identical. +``V4L2_PIX_FMT_NV12MT_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores +pixel in 2D 8x128 tiles, and stores tiles linearly in memory. +The image height must be aligned to a multiple of 128. +The layouts of the luma and chroma planes are identical. + +``V4L2_PIX_FMT_NV12MT_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores +10 bits pixel in 2D 8x128 tiles, and stores tiles linearly in memory. +the data is arranged at the big end. +The image height must be aligned to a multiple of 128. +The layouts of the luma and chroma planes are identical. +Note the tile size is 8bytes multiplied by 128 bytes, +it means that the low bits and high bits of one pixel may be in differnt tiles. + .. _nv12mt: .. kernel-figure:: nv12mt.svg diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 31d0109ce5a8..4c6480fa29e4 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1388,6 +1388,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_META_FMT_VIVID: descr = "Vivid Metadata"; break; case V4L2_META_FMT_RK_ISP1_PARAMS: descr = "Rockchip ISP1 3A Parameters"; break; case V4L2_META_FMT_RK_ISP1_STAT_3A: descr = "Rockchip ISP1 3A Statistics"; break; + case V4L2_PIX_FMT_NV12MT_8L128: descr = "NV12M (8x128 Linear)"; break; + case V4L2_PIX_FMT_NV12MT_10BE_8L128: descr = "NV12M 10BE(8x128 Linear)"; break; default: /* Compressed formats */ diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index f118fe7a9f58..9443c3109928 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -632,6 +632,8 @@ struct v4l2_pix_format { /* Tiled YUV formats, non contiguous planes */ #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 tiles */ #define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */ +#define V4L2_PIX_FMT_NV12MT_8L128 v4l2_fourcc('N', 'A', '1', '2') /* Y/CbCr 4:2:0 8x128 tiles */ +#define V4L2_PIX_FMT_NV12MT_10BE_8L128 v4l2_fourcc('N', 'T', '1', '2') /* Y/CbCr 4:2:0 10-bit 8x128 tiles */ /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */