From patchwork Tue Feb 14 10:04:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 13139792 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BF41C61DA4 for ; Tue, 14 Feb 2023 10:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/pgTcNAkzKf+DK0WUmC/GNyRPR8Vys3Ggbb9QlhB2tA=; b=M6WO1Md6V88VOu ItreW80CXCmC3Q0DBl4jwLMkwKR/7BVhdfdvkVBm6OjSwhdh4z75SNKJiUgg/I18EevcvEbShqIIG QS/xgoCdr7zxke3JcTeMIzhlOw7r2J8kpLfS37qhu3H5LmQ1BqL0WmmE5R3sSpahvBr2wtDjQvdUX l3uf3qU2ZEA+aRwyrVnQM/I5Vk+AqqOfi47WgUyUC0T6Wf4xZhIpz5MN1gSsLPiXAbKJsOAumSRyp 8nZd9cvG8wNYabfuEtdLxf6b2UyPzZBdR1AD60M8/JzXSO0Bbu88AMW/sgQQ3vuLCtVQRWPgTDgIm 2CGtbyRkoJz5mSZulaKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRsCQ-000t01-OV; Tue, 14 Feb 2023 10:06:10 +0000 Received: from mail-vi1eur05on2060a.outbound.protection.outlook.com ([2a01:111:f400:7d00::60a] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRsCB-000skM-Cn for linux-arm-kernel@lists.infradead.org; Tue, 14 Feb 2023 10:05:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MF24CDDpUFkuKATik+KbJZhqwR9wPJnXcLYI+BYBazQBVNN8Cy347vZrVXH/78xyxzfbG27BTVByjSMvfVw2kT8Fyvac6fpa9u4oqtCD7oJGFJvW3UGtOKrRDokiA5ljs5pdNUDjlubE8Fs9A0OIeSRXlXlhz8ApqodOUHPVOSU1MpXyIY3lywb4Yf6Wy2ypBegQY211A/OaWAQdf0Oa33EaIBtmyORc1fZ1mdzICBxxvPZgNgfrIbgOxSb97SNwodNTY1KuVsU/yDsO0OOhD9aCYv1U6950aumO3HK3/HHvelJTa2F9vfWneB/D8HTBxzEGEgthHTbXIO4UvmA6Sg== 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=X/gvrBgcYfBMiPuYaztMA7JJWd8ZL+CtVG3h2U7bgMo=; b=bT9AKkBBs1vodJBJSN1WPu4JqmynKTPWD6NZbPd9s/8ylZe6xq+ByeO8Dp6mtmJl6gEzx9N8jZjo8YxpscH3lL6l2IWcg4//DAvD7sqYhHdF2DUIFnsix/4NnPPyQpO7To5ZCrK7GcTL50xKQ7oU3DfXgprv4Lt5K+OUD0KlCOaaOgyVd7n44bvPuVqCYSLdQC164E8UoXkXBtUYV8qwHzq6x0kP8tJdMOD71nAJ6cQyoBCfzu4heRsLXU4tB9/DIlX/hj4Ul1gbbRTUKzJJQPGy5wngUTeFcPNY1HgHegLht2cGxjamW2hJj1twQmxooQfM78UoMlp6vycyCKO7mA== 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=X/gvrBgcYfBMiPuYaztMA7JJWd8ZL+CtVG3h2U7bgMo=; b=LuBtFsVciGCOsPLA22NqK7TUeKA1EzB0y2GgaCREdI40r1YHzw+nzNVp07CA1LmAWtOLH0eQcSgL45tIptJiFEMpBmPd/GvZdmmuIPL4ukvkrze1EelSV2dE6QK1Ms9qzt/NkXAEbzD6EAbyxX6X5XCZ/k4hpjWeEcaGa6H5QS8= 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 PAXPR04MB9204.eurprd04.prod.outlook.com (2603:10a6:102:227::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24; Tue, 14 Feb 2023 10:05:47 +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.6086.023; Tue, 14 Feb 2023 10:05:47 +0000 From: Ming Qian To: mchehab@kernel.org, mirela.rabulea@oss.nxp.com, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, xiahong.bao@nxp.com, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 01/10] media: Add P012 and P012M video format Date: Tue, 14 Feb 2023 18:04:43 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR01CA0035.apcprd01.prod.exchangelabs.com (2603:1096:4:192::13) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|PAXPR04MB9204:EE_ X-MS-Office365-Filtering-Correlation-Id: 6681713f-2dd5-4c61-9c89-08db0e730afe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BS7eU2nd3x8Y9VQe7D/N0UZH/0XW6RNN4kvQ4LW/PmzTj6FPH9CH1+XnyCpOUK+NTYR/shXg6of+tDw4+74OLUqP3O9UVqGyL6D1hZe/0uTsazN2ysnIoKziebqci6e2MSG0+pfCOE2LzyDwkifgaZQBrWHpJB5L7m5hO++2DG63CLBmw6p6C0BeUfOAIqkqlJZw9m4wKCChDpDYDj8u0zfizqGY+P2HvtIF7O62oSJR3xjVq7t7//GMWQ524H/XVI2t/HcTJvOm8br7vNypjJS9mQxs1hGzrtLV945kKxV3k6WhHDizuvDXUrXvQA4wkQsuuSX9PwpXci8iAxfDBaMVwYMTi0Tl/13n/rXLG1BFU+ziF+cdmhO/BvGj5K9qQhVcjQwNEGnVzNLJrrpghj9mbpgC88rxGrPUVRoFr5zE/ETmQekQ5TNccp0X3zzQwUMbFHL63B6OXOghzAYKOGb1BswLcQYVFj4kdVpXK8+iwVadHHvPzwgKA+kvsgWfDFXWk+wpUsHkLGdwieQ5qucrCV+RiSE1vUxn6LI8VZPpgebapWxLxqUem6n+Gs5p+aWUR7CjguhdAHnLcOGpgJqBsF/ivDAE8j4Q4R6eBeTP4+1opYsE+lXBCLGbnrt1W+rpAKlgURzKSHoOobiBzzHqpFyVyhP2UH5Xeu7YJ1QH2rugOM5hmd8Q39L5tgXnZ7TMt7HN7Ox9TtRP7C1xMA== 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:(13230025)(4636009)(136003)(396003)(366004)(39860400002)(346002)(376002)(451199018)(6666004)(2616005)(41300700001)(8676002)(66476007)(66556008)(66946007)(2906002)(38350700002)(478600001)(8936002)(38100700002)(7416002)(4326008)(44832011)(5660300002)(316002)(52116002)(83380400001)(86362001)(6486002)(36756003)(26005)(6512007)(186003)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1hQywsIsj3oHWea8322la+Y5C5LITV+swY6KW7p5E6phgewAomIk+ijc7H1btzuoPeFLtdyww8QotEwIH0dEeWPntCc6XTuh5ue/aD2i4SAltmEP4A2zF9nusNc7sp2o6gOZNvxai99r+iNCFZqDblc6Z/wGpV/NDM/KAIi4t9eZoA4qStIGItrScIJJ1T2UZFYDoixuUDy0w7LrL9Xe430krfFyU9lmNJWyWgHxOhtuAC4rNIPeukXIT+XfwE/C7i1LFxUT3qcCiecnXoxmZKk1cAVW1yL9UzDNIJJdCsbGx5O1GBFLTyDfGQFKhz49Dinwz0q1qAM/3jS0FF2yvIR9jQioa080ZjU1DhC4S+f63sFK4t/0DVPxNY++70EQUkIpQVHMu5ccqTrJdop5298ZzINkLhe95u/FVBCtYG+3hZq8xteC/B9h9FCrg+dEHpAKrP3yWWI1pN9To3QXtNWQYR5bjQcuyIpivsqDBPePZvdh2l8lvdL+co/zS4RFc3sMHRjY5hEq++X2znLfxb3vbVfR1SsOFKTjQhUkzJMZkWwvqZEngUJJ/c34mt8LZUJVO5+Z/DZ8yJ2BbaBA4w2Tpq1IeWMd/hX2lmg1ilym6PaFnS1JO8C/38CptRZBS6naMzJSrYKa0+ONLolf1WsLV6ryL6gWYt/n5FXfIzGv7ZaeBZCBEHncyK8s3mafsBULdNNcEqQ62dWuLx0ZcorYHcHqlotlEltS1GvT5BfRc2YPH4xn8/9mijnT1VnyiqDaP6iqRNFYNui65xAhPK4WVrgH5QHg0aP0pfIDMp8VPoLgSWM/kg49bbQdOx/nw889ABzjBk9/p5COJFKB+UBTU81D5d6we9Z/jDKjhCVkzYrCRQ9wy979s4Dd9K0/DCEuDB5+8H6LMvWcOn6Rhx5OvfbOT4Qk1OvhztyQVMHVzU6wMmyM001ho9VN028H7Ty/ELXY7nrrvu+NTcgtmGM1RtI/i+l2I9PJg/SkGqoUcKLvdoR2vA3ZrnFeufrgaQz6wMTZrnhyeMCFZcefK8dMKxMvKVG9R2ajZG5zZAfRN0jPcMBqdooj6TlCtGfStcG1HvCckVf6Ot6aRczCgi8ege6ueExz4aH4mvHVTBt4ejcChsQceyo7V8TjvRIZh1dVWnR9BXt1yphUkI/xnH+sPake1WgTyHgTyZSLyrDqcsbBbQQe+GGqiP2IijBNihpjU1Ux6sGJ3OrInXufPCm6JPGdbk7MWO+VRArSF7aw7kuh+1EQuXaEhX8xK6LDJCi+HlrfNtcN7KBPsayJwBKbAlkgRZ1tofr7sAEpaJXvnEg2w3n5ciCUoDv7AmCZ2yy+h/ZTsKm2ZjmqoH9CAuWCHaWdj08V19XxeTA1X7MErBe7+kctGT7jwA3EdDkz0RihMUfz4v2CpmvPo1zZiao3/C6/hUsQk9S2Af71V2hqr/8NI3zzxEPTKcTTL+6QwzKC0pVYtFI52ruEZyvJUnqQavqEl0i3JjC0fqmtymqwT7s2CQekaV2fXgU8kBGLTVj9lQID4p7whS462PXwdmVdigVcQ9N11HBENQkMgM73k0UlL0MF+keZyNBsx4R1 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6681713f-2dd5-4c61-9c89-08db0e730afe X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 10:05:47.3574 (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: GwWVKcHKWftA81n0xZHWDbygWAFV4wgdtfHQaGwNdKgo3TPSyAly0TqXjIUhERx6Ya6Y7mpQLPCUng/7bKfM5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9204 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230214_020555_453424_4AB1EE1D X-CRM114-Status: GOOD ( 12.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org P012 is a YUV format with 12-bits per component with interleaved UV, like NV12, expanded to 16 bits. Data in the 12 high bits, zeros in the 4 low bits, arranged in little endian order. And P012M has two non contiguous planes. Signed-off-by: Ming Qian --- .../media/v4l/pixfmt-yuv-planar.rst | 94 +++++++++++++++++++ drivers/media/v4l2-core/v4l2-common.c | 2 + drivers/media/v4l2-core/v4l2-ioctl.c | 2 + include/uapi/linux/videodev2.h | 2 + 4 files changed, 100 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst index f1d5bb7b806d..aa37c3de8808 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst @@ -123,6 +123,20 @@ All components are stored with the same number of bits per component. - Cb, Cr - Yes - 4x4 tiles + * - V4L2_PIX_FMT_P012 + - 'P012' + - 12 + - 4:2:0 + - Cb, Cr + - Yes + - Linear + * - V4L2_PIX_FMT_P012M + - 'PM12' + - 12 + - 4:2:0 + - Cb, Cr + - Yes + - Linear * - V4L2_PIX_FMT_NV16 - 'NV16' - 8 @@ -586,6 +600,86 @@ Data in the 10 high bits, zeros in the 6 low bits, arranged in little endian ord - Cb\ :sub:`11` - Cr\ :sub:`11` +.. _V4L2-PIX-FMT-P012: +.. _V4L2-PIX-FMT-P012M: + +P012 and P012M +-------------- + +P012 is like NV12 with 12 bits per component, expanded to 16 bits. +Data in the 12 high bits, zeros in the 4 low bits, arranged in little endian order. + +.. flat-table:: Sample 4x4 P012 Image + :header-rows: 0 + :stub-columns: 0 + + * - start + 0: + - Y'\ :sub:`00` + - Y'\ :sub:`01` + - Y'\ :sub:`02` + - Y'\ :sub:`03` + * - start + 8: + - Y'\ :sub:`10` + - Y'\ :sub:`11` + - Y'\ :sub:`12` + - Y'\ :sub:`13` + * - start + 16: + - Y'\ :sub:`20` + - Y'\ :sub:`21` + - Y'\ :sub:`22` + - Y'\ :sub:`23` + * - start + 24: + - Y'\ :sub:`30` + - Y'\ :sub:`31` + - Y'\ :sub:`32` + - Y'\ :sub:`33` + * - start + 32: + - Cb\ :sub:`00` + - Cr\ :sub:`00` + - Cb\ :sub:`01` + - Cr\ :sub:`01` + * - start + 40: + - Cb\ :sub:`10` + - Cr\ :sub:`10` + - Cb\ :sub:`11` + - Cr\ :sub:`11` + +.. flat-table:: Sample 4x4 P012M Image + :header-rows: 0 + :stub-columns: 0 + + * - start0 + 0: + - Y'\ :sub:`00` + - Y'\ :sub:`01` + - Y'\ :sub:`02` + - Y'\ :sub:`03` + * - start0 + 8: + - Y'\ :sub:`10` + - Y'\ :sub:`11` + - Y'\ :sub:`12` + - Y'\ :sub:`13` + * - start0 + 16: + - Y'\ :sub:`20` + - Y'\ :sub:`21` + - Y'\ :sub:`22` + - Y'\ :sub:`23` + * - start0 + 24: + - Y'\ :sub:`30` + - Y'\ :sub:`31` + - Y'\ :sub:`32` + - Y'\ :sub:`33` + * - + * - start1 + 0: + - Cb\ :sub:`00` + - Cr\ :sub:`00` + - Cb\ :sub:`01` + - Cr\ :sub:`01` + * - start1 + 8: + - Cb\ :sub:`10` + - Cr\ :sub:`10` + - Cb\ :sub:`11` + - Cr\ :sub:`11` + Fully Planar YUV Formats ======================== diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 40f56e044640..a5e8ba370d33 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -267,6 +267,7 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) { .format = V4L2_PIX_FMT_NV24, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 1, .vdiv = 1 }, { .format = V4L2_PIX_FMT_NV42, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 1, .vdiv = 1 }, { .format = V4L2_PIX_FMT_P010, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 2, 2, 0, 0 }, .hdiv = 2, .vdiv = 1 }, + { .format = V4L2_PIX_FMT_P012, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 2, 4, 0, 0 }, .hdiv = 2, .vdiv = 2 }, { .format = V4L2_PIX_FMT_YUV410, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 4, .vdiv = 4 }, { .format = V4L2_PIX_FMT_YVU410, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 4, .vdiv = 4 }, @@ -292,6 +293,7 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) { .format = V4L2_PIX_FMT_NV21M, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 2, .vdiv = 2 }, { .format = V4L2_PIX_FMT_NV16M, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 2, .vdiv = 1 }, { .format = V4L2_PIX_FMT_NV61M, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 2, .vdiv = 1 }, + { .format = V4L2_PIX_FMT_P012M, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 2, 4, 0, 0 }, .hdiv = 2, .vdiv = 2 }, /* Bayer RGB formats */ { .format = V4L2_PIX_FMT_SBGGR8, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .hdiv = 1, .vdiv = 1 }, diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index b26da2650289..a166436be83f 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1349,6 +1349,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_NV24: descr = "Y/UV 4:4:4"; break; case V4L2_PIX_FMT_NV42: descr = "Y/VU 4:4:4"; break; case V4L2_PIX_FMT_P010: descr = "10-bit Y/UV 4:2:0"; break; + case V4L2_PIX_FMT_P012: descr = "12-bit Y/UV 4:2:0"; break; case V4L2_PIX_FMT_NV12_4L4: descr = "Y/UV 4:2:0 (4x4 Linear)"; break; case V4L2_PIX_FMT_NV12_16L16: descr = "Y/UV 4:2:0 (16x16 Linear)"; break; case V4L2_PIX_FMT_NV12_32L32: descr = "Y/UV 4:2:0 (32x32 Linear)"; break; @@ -1359,6 +1360,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_NV61M: descr = "Y/VU 4:2:2 (N-C)"; break; case V4L2_PIX_FMT_NV12MT: descr = "Y/UV 4:2:0 (64x32 MB, N-C)"; break; case V4L2_PIX_FMT_NV12MT_16X16: descr = "Y/UV 4:2:0 (16x16 MB, N-C)"; break; + case V4L2_PIX_FMT_P012M: descr = "12-bit Y/UV 4:2:0 (N-C)"; break; case V4L2_PIX_FMT_YUV420M: descr = "Planar YUV 4:2:0 (N-C)"; break; case V4L2_PIX_FMT_YVU420M: descr = "Planar YVU 4:2:0 (N-C)"; break; case V4L2_PIX_FMT_YUV422M: descr = "Planar YUV 4:2:2 (N-C)"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 1befd181a4cc..5448aa3b7858 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -626,12 +626,14 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */ #define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */ #define V4L2_PIX_FMT_P010 v4l2_fourcc('P', '0', '1', '0') /* 24 Y/CbCr 4:2:0 10-bit per component */ +#define V4L2_PIX_FMT_P012 v4l2_fourcc('P', '0', '1', '2') /* 24 Y/CbCr 4:2:0 12-bit per component */ /* two non contiguous planes - one Y, one Cr + Cb interleaved */ #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ #define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */ #define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */ #define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */ +#define V4L2_PIX_FMT_P012M v4l2_fourcc('P', 'M', '1', '2') /* 24 Y/CbCr 4:2:0 12-bit per component */ /* three planes - Y Cb, Cr */ #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */