From patchwork Tue Dec 20 03:11:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 34881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2747463wrn; Mon, 19 Dec 2022 19:14:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXv17qjYfIfIOi4fuVQUauW3Kews6j9wUJOky0y1xesku+0wIgqeRePFW3iGsQN/CZLN9Lg7 X-Received: by 2002:a05:6a00:300d:b0:577:b52:4ec3 with SMTP id ay13-20020a056a00300d00b005770b524ec3mr10833575pfb.22.1671506043566; Mon, 19 Dec 2022 19:14:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671506043; cv=pass; d=google.com; s=arc-20160816; b=CblF4srghiS8UWYU1XJwat1sZo/mXI7AGSBqIg/tY2FrOwJ1uwEve18pBBa+JgdM4f pIMnf+lFqC2/lxie4FGsHMNfhx1JGdqoakYEF2ocQmkeVbg1OIkPuYGyG5oxk0FLQVRD AmmYP+4Qm/AThUPB2MK6tfIsPTfIvpJqwNIdU61TqeSdfceOOFy6l7L6uBxnGgoywzpO FWqPCRB28CcbPV3mKOhccg2R/Zm56CrTEUIY4b1OOyu8Fe+nZCu/nMY2XOiUqAtKUmdD mDQaIvh1EUA2Ksnmu9YJNKabGex129gs5sER7uAnu2QJG/Vs4GpI0D+O/o3/nB4i344a VTQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=d2Yx21b0j1MK0Ce6cSenyGIaB1kBCSsck2Aem2dw9Nc=; b=Wxhxey2rt/7X/rf/T+hhiQAUfvPzdzQO4mCS0rkLtE4LuxXsP9VfuV3PvUKCfYOyc5 J71+dBCgZ4d7U92PcPgW91apwNjckzK6ZraFieuzd8B/IX2nh8iw8Ikbyy5G5ZbFTw0C 3L0KOIbZkjAmMRbClZntX5Uey9GT3b0R4JMHYmGlEJIoQqjBfvt2v9iTr9ru5LPvXKid 9TXnovkZFKH0ifJSVESd7xR3iNailklUiCpjbst6BYiA6EKytwuiug9c0G/BIZjq9Br1 2M1vXrQ8rT10fH1Upx3w2+fXQBpUwn7En6kBAb2wMK9j8GFa4qd9/m5/zWVqgUUvrYVi MJ7g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=N1Evrkcw; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020aa79d04000000b0056be3585c3asi11682589pfp.266.2022.12.19.19.13.50; Mon, 19 Dec 2022 19:14:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=N1Evrkcw; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232473AbiLTDMh (ORCPT + 99 others); Mon, 19 Dec 2022 22:12:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbiLTDM3 (ORCPT ); Mon, 19 Dec 2022 22:12:29 -0500 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2040.outbound.protection.outlook.com [40.107.15.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CDB92DC0; Mon, 19 Dec 2022 19:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VdjuRl1F+8O2CemU+vYtqwnrR7/oj0msCCbkAfxViqAs+nmFUACuPnGrs2Us1TPIw4M8FUJd9EMBHsTpXX3EZNOhhApz4dEFn/NjSDiiarn8eMeahINs9z4lw5ZNsk1i9iL/7XzCLyDXHDjGvag34iE1l53s636QwZ7egIAzrR6IQcEYEg+0MhR9VZd95c3e22tSWvKKuc0buDfVhxgBLDtxnMgFbFd+6sGIcI/EpO/VWbmQQi7at/KhZsaxI3UQLoKcjVIXHSoPxFTjXqTWgt0iJcvwZbJ9Zi701HattxqwWsc6AmevGoFh/M/F9+8DAvJ9G+T6bAA4D4S+/DEvMQ== 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=d2Yx21b0j1MK0Ce6cSenyGIaB1kBCSsck2Aem2dw9Nc=; b=Q8OT2/2Na+ayz+cam14usmAV1GpqnvjhJ0hPyQhR0jUCpbOl5hyb84JXK3K/uRsSlWzDeDrzboSZ8LwIw98G99v94YVfyFCfwkKT+6xuBwmuw+z3gtVCSsaoGJQL1lNbr/FmYbV6Tl8B3bXsfbXgJQfRtaMrXGbMSz4Wz9MdKPhKNmHXAOgr7hC6a71AyC1kR1NnJg3cr3IbdpphY6Ah8ymeEe21F5IhTzhndiX1mbiJoW6RKiPvpjSpFWW7JIy0bSg9QIkAkRfSJCjaU3STVbhNTj/f3rrBRO3PloPeYCocYhGBwhXtr6zJwZOGSYUWKkiO9EiW4WW+t2O46DtHbw== 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=d2Yx21b0j1MK0Ce6cSenyGIaB1kBCSsck2Aem2dw9Nc=; b=N1Evrkcwj1fWAM0uYMwuCY8upnYoh/7jEzt+lXu3A0ey7LZyzqWxwDAa9ALr0apb8Yox0wuqwE+lzQhgrR+HGIIlEEMn3GVaPhryWkqvDYIfzWVE02eVCJXYIHCVYbFE7TUBEbqS7eODp+s31pTn3HEakXO1/VDaF+JNBn2K47k= 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 AS1PR04MB9405.eurprd04.prod.outlook.com (2603:10a6:20b:4db::17) 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 03:12:24 +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 03:12:24 +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 02/10] media: Add Y012 video format Date: Tue, 20 Dec 2022 11:11:32 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR04CA0014.apcprd04.prod.outlook.com (2603:1096:4:197::18) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|AS1PR04MB9405:EE_ X-MS-Office365-Filtering-Correlation-Id: 7edcfb57-657b-45b8-24b9-08dae23803dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xG/hly2z2jD3b2Vhx4jnLkQn6jSVdmT2CKAFy/ww6YgWMDhRXrfcmIN+JduRFQD7NVmWiOoLirPEhvHYIHUUrEElQO+7vcFekmh6ZrlxPYa+Ro/C2Q6qHajnUWofCTqK+vPPKIkp55y7q9XKhZnYtLJfSfjIHVWfnVa/cJS1L5eQ7ipo7WU3GhHOqOKiNCh1yN4IkVyRa4azn8msnC0UWXRAa/3uCjwhoixW/iKeI3Z51Rka0uE4BXciAgJj289QZP0/UInp4Dkww8hL45T/5r15m7q0chIp3cIpd21+1j4rxBh15AEOgyyPqQsx6LNnMTlykFo6brMv1kuuCbMBkHklzY2o75lGxpWRfttpa7H+CgnhkohStrSU3azTOpx+7hW897KtF12mUh0rZpJy6ywfCvxlobWWel1ICB2QK7ahUGVpo+2XKsufv9IeVf4QjnKOKmyqVii6gR5c+uangNkGOJjZLIeT3e38jqrtZt9deClqnR7uNhEySc75uU0T5utAwuW832CzUcp1jktFrUHsyjCLFkauCzPhAfy3GE4pgfuuzF0CoalAHIvXX09wLKdP5z/s8YQ9elEzOL6Ch9XFR0jr21OPJQ0C3BmXAqxhwvxSgpkbInzabcAgrkC3pKa3w9H6XMZBWENjAs9XGuIH10siUwTVM25iHQOC5FqFUHSxf2UBUGj1LSc91b3N/G4LZCtxc7aRt1NLRdIlSA== 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)(136003)(376002)(396003)(366004)(39860400002)(346002)(451199015)(36756003)(86362001)(478600001)(316002)(6486002)(66476007)(8676002)(52116002)(7416002)(2906002)(6666004)(5660300002)(44832011)(66946007)(41300700001)(8936002)(66556008)(4326008)(6506007)(38100700002)(26005)(38350700002)(6512007)(186003)(83380400001)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QQ82qs5rSZC5+R7iSi5Ys2puFXjkGRjIRri+tsHp2hCY/axjkjYJYhgY/ELEuI4K9Aw+F+UpbH8f7DU2pUwMUgDyn854bkYLvpKQqo36OsIxEOqQb+rMch8l3drOJi6LPeeXpsI3gzGZsjbWsXc4l8mgNftFuuS9Hbt7oc1ryV9KzTFSREBZLX4Hm3E816SycHOSAqDiQytTDkq0t14/CC9OLSExCAwKHvnZKH5T04njTe/XudBNF3Lxa0HuEdhtQddNDj49/94sH8mK0DmU+Q0unKWmXXMImQ4S01xji6mkrnsIbQ9w2OumCAnNj5BwKqgWNeO05AYAyB8kNk2SLapHX+mseaPFRaSJZDJ60opoGq5ypMa4+mCIvWeCs5UsqsXEIxXZx6tTyu+M9sHDFJJL+OhowbELDu86t0cDUx9bWA0r4DjypJ4NzMTDNYI33swAXZCTxQV8TaBes44H6vNkDVEaTUxZ062uzaF7/HpuaWwvN/5ED/yAmLaT6hFFPVJnQo8hBmBnpNVb0D0nwl0ygyY8uiIMl2ubr/LTxdc8a/jNOST2dhFGvlauDUHOpSeitFoP19C4LhYoFV40tVf/K2nQmxRl7/Au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Tenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 03:12:24.0029 (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: gK7ZbvyyoUXUnZeK1Hygv+ke0Xv88PMoT1n8U9FI+2e0vxYN+nPdOHkTGgnjxG/ZWMQl0iA8OGhLdAxgF7708Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9405 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752701121452066891?= X-GMAIL-MSGID: =?utf-8?q?1752701121452066891?= Y012 is a luma-only formats with 12-bits per pixel, expanded to 16bits. Data in the 12 high bits, zeros in the 4 low bits, arranged in little endian order. Signed-off-by: Ming Qian --- .../userspace-api/media/v4l/pixfmt-yuv-luma.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-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst index 6a387f9df3ba..3ffa29000238 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst @@ -103,6 +103,17 @@ are often referred to as greyscale formats. - ... - ... + * .. _V4L2-PIX-FMT-Y012: + + - ``V4L2_PIX_FMT_Y012`` + - 'Y012' + + - Y'\ :sub:`0`\ [3:0] `0000` + - Y'\ :sub:`0`\ [11:4] + - ... + - ... + - ... + * .. _V4L2-PIX-FMT-Y14: - ``V4L2_PIX_FMT_Y14`` diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 067dbdd0a9ef..0ee730aa6cc7 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1303,6 +1303,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_Y6: descr = "6-bit Greyscale"; break; case V4L2_PIX_FMT_Y10: descr = "10-bit Greyscale"; break; case V4L2_PIX_FMT_Y12: descr = "12-bit Greyscale"; break; + case V4L2_PIX_FMT_Y012: descr = "12-bit Greyscale"; break; case V4L2_PIX_FMT_Y14: descr = "14-bit Greyscale"; break; case V4L2_PIX_FMT_Y16: descr = "16-bit Greyscale"; break; case V4L2_PIX_FMT_Y16_BE: descr = "16-bit Greyscale BE"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 5448aa3b7858..3d8f89bff33c 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -583,6 +583,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */ #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */ +#define V4L2_PIX_FMT_Y012 v4l2_fourcc('Y', '0', '1', '2') /* 12 Greyscale */ #define V4L2_PIX_FMT_Y14 v4l2_fourcc('Y', '1', '4', ' ') /* 14 Greyscale */ #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ #define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */