From patchwork Wed Oct 13 08:27:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 12555087 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 0563AC433F5 for ; Wed, 13 Oct 2021 08:28:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE8BB610C9 for ; Wed, 13 Oct 2021 08:28:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232147AbhJMIai (ORCPT ); Wed, 13 Oct 2021 04:30:38 -0400 Received: from mail-eopbgr80043.outbound.protection.outlook.com ([40.107.8.43]:42126 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238479AbhJMIag (ORCPT ); Wed, 13 Oct 2021 04:30:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FMFr2xXBnBFopXIw81Guns/f3wL4HxQIPuanMkLnROstv99V2Mn8gts0d7dSuS2lfZ/j1FOpQFejNl2mwp6qP3qAH53NZJGpm/6/Ani4UzDpEX/GvmHTgcJoV5a8kPPR7Wx77Vx0BtLd3ijHzwi7lUuT7uHHEs39JiH/BgYNeVm0gGM6C5GwyC4HMQeD7l4AKPXvbj2ZGxs5rI10Y7pLCVaf30TaNxk9drDk3z4kHR6BhhiurWbJk2Ve3DP2gyYjHvTJ7OiRk4qVPgfYvUQ+ZOEXB8LuhjoBA3oGBYtbpmmfRDd7FCv6yytqxyHJ28XjeCEi4RBP8plBwWGPhZ4OZg== 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=UP7lVKKdGa1I1paV+ia5cZ75+Ax2cyTav7iJ6jCDMh6KNbLm284GM9ifUK/bGX+B4bhx6gdptaO8l9PtbUYnH/4YH9S+9FZ76xeTEQztvFRZOPDCOm6rWqMXbbJ65B19+c1Fsf2fyfoLnDs1SeG7/aVvCgMeJxIfSQM3a531ThYzRjzuSnf+0DjVLv3m2FuVKNeZ9oWhnYMkQ4NU+dh9KvYKgeOsPPCe/SRk79+X+Iwk+ILMsnOFNc9mx6kzxOXsvKJu2SXKPqtN7X7khYSdqVCuAYSDCtWSbyX6korh4nSO6L5bjSOa1UvTk9ImDeTx7mw/72uAr3NkV13rFKQx+g== 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=pBrks1nStvPs5SNmQRKaqSnUlEyoQEIv3LquGFAP+0i/78ziCKmIrfaACr+SAr5LztEz7grlOVpUQ6DOKN62XU5MBfNZ8aYhEOusQw3m008+MpsmampO9zoBnmVwNQ6i0oNnokuksU+wsnff9CKzwBPQR9gliByCn3HFKm1VDRQ= 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 AM6PR04MB4789.eurprd04.prod.outlook.com (2603:10a6:20b:7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25; Wed, 13 Oct 2021 08:28:31 +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; Wed, 13 Oct 2021 08:28:31 +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 v10 02/13] media:Add nv12mt_8l128 and nv12mt_10be_8l128 video format. Date: Wed, 13 Oct 2021 16:27:18 +0800 Message-Id: X-Mailer: git-send-email 2.33.0 In-Reply-To: References: X-ClientProxiedBy: SG2PR03CA0121.apcprd03.prod.outlook.com (2603:1096:4:91::25) 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 SG2PR03CA0121.apcprd03.prod.outlook.com (2603:1096:4:91::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.12 via Frontend Transport; Wed, 13 Oct 2021 08:28:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a49822a-09d0-4ad7-7203-08d98e23709e X-MS-TrafficTypeDiagnostic: AM6PR04MB4789: 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: sCKa5ad5OZ7BfWIsGziDyEAU1yPJmnohl364CnvHrJl99PCtwMreorT5/l2P8s5QXqONjbgqwF2fCsb2iKmERjYGjdDTmJGZtBXBdqdQEiQ2xjqGuy4E86apzJdQJtL0bHX/mxjT+0eEqQwscVvYuO/A9XcTo8r7TMXNbDFaUKT8WZSPRmezrpYJzYaJ4BtOOyn0jSWFE54dJLwihzjCA1nZ8DhnynbD7OM7FBp/SL4qt9FMTQSBqUHp2dctXjDPwLPurPjB2nSp6+OWhfeK4X+/uy4Kfwoyht5F2V11iJuv0sf6PIozqPjaSlEOLM2u8y9eEBCxHYAQxXB6oX6RhJLXm8bgG7X+6r6xnqphWcKkEid9eaXnX/nXm6Ahj0I3x52NQyJHfRnWSbj30yJY/KIfDDgSN0pvouwRtOPByl+3DRP+Ch1pxM3gfKtEin0FKvfkPWEax79trEHOpN7UsGUQO8yxtKczZkgYgZ11YKubqehzrfvf8Qkgv3clHKuQyhGuKmadBTlR63+gUEc4IgEA3bMa0nJA99BKmgkm1/gRPkykuKwuFRvFgKDPDIH+IzuBmGk6GAWq885rHFVpp2IaCsTRUG3wPiIi6wpk+hU5mR4ibCrroaavQEONPFoRApaBpXnmhvjs0Dz6Bg7oaP40tTV7dnv+RDpi/cEmEiIPS09sx+UYO5jTQhu6jvX5XEkm6jmKV5SWvagOrSeqppiGvAPavtpD1UHVzhhZ5SMgrMSy0m656VzdCD9oUyQ985vQh/4sBF8971dAeEFfAPDo7t/eqPmgXi81igcrXMs= 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)(2906002)(36756003)(186003)(966005)(2616005)(66556008)(66946007)(26005)(956004)(66476007)(6486002)(44832011)(316002)(7696005)(86362001)(6666004)(508600001)(52116002)(8676002)(4326008)(38100700002)(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Vq1w1rkJ/DAEalUA0cXMoz+4S2UeH0EK7Uv1M8fWCsnynC5ux6lBbxgX0yDl5V8TnXWJe8au1GKruEIJdMQE+cqEAoKMCGrki8jxmflC2el9gqrWC29W6K0b6mj73lAtVKDsIbg/9GTJQplwGTU+8hcgUSMZGGjn062dj85L31oKQcYTaMc73CP98Bnqp4M19FGXXwMQv340SYbSTjaHVgoLmXJTJ/K65PnuH8BBobjt0OQ5VuO4mvnh1vfOLHTdIr8J/DDsfxqlRwYIB9WauX5YDZI3RjLtV+Y3MIc6wKdPoqsvcREn8kpbJiLws7dM3Rv73PV4IO6Qcn5QGkQShNgYcl9+VpPRLD9aX99PUVBFCHJO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a49822a-09d0-4ad7-7203-08d98e23709e X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 08:28:31.6985 (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: T8d6myCjPHntH1uwnPkIQyYDqPSHZUXPPsIqDSnvMxUMdUXZI2zE88xokFFSl3bABQtAJswFZ1fbU7pAT0fTlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4789 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.. */