Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2714638pxb; Thu, 3 Feb 2022 12:34:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwT3dgX+vn6KRrqpqvKS6Lta7TAv99KmmjEMqBvt/pWhMTAxuFrFJU81KVEt74xQSp3JSrE X-Received: by 2002:a17:90a:ab90:: with SMTP id n16mr15674780pjq.229.1643920452841; Thu, 03 Feb 2022 12:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643920452; cv=none; d=google.com; s=arc-20160816; b=EI4YDKufn7UyGnNz6Kc9Rh40BH4Kyp3wfGW17CVj6znqOmbLurSChW+w0Ud+xf2kBr IhbiapZMIi5Rh7x/u/xt8VfDFWqqIMPt6d8tposEbiBBkz8g2XFV0c3SGvPPxwC2+YFJ cRfJVlPoqKUW9akfeoln3rjVJSsAp7RivGfHDzTtrXSjy8oIjaS527QoT5c/yrOhgECx qvQmabeCOSjSbwPU+38wcBIoVnp6kRD6srm+rlppU892uCycTo9AZ7mbaMBVvO2xI9Vp +0BVTT4SMnYkMILzr1FHe5/mKxLW3r+te8ciMJSL2yfjVBNjdVQx1oTUVq11iSoo94Mk JSXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hNH0LZn8t+J0haAlk1+IvT52iQcw11s7rbYq1JFIJJo=; b=ggDlyHdpiVPnOlmfjabjfG7J7/PIU5B2E6qZFxu27TaXmnlPbQLrYVQugobiCFsX+i Dx6V4niuLQCmmehlGhftgvg6kLCHjNma7oTyl75Zwkg9LfJVicuVvpKNPfxyV9Nj98iU v83QxIYlR1JW3eBiXj0kGsivxRkfoet4WottDiibcFeC8vwMhbsRq3x/JgRoSY6qUnTZ qeJBLaxnP/DHJUcHDGmaey4L85NMo4jWGYuajO0lu8PGqncw3YRR62gB9mII9FtgNjvd dxAPnNGaBYozBeYpv9sYhhheeXte4ZdvHgowE2lTT7d3EUFAFriz0pQ8bwskRRBZre8p cFEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hQrxrc6D; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m15si23090174pfc.252.2022.02.03.12.33.58; Thu, 03 Feb 2022 12:34:12 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=hQrxrc6D; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353103AbiBCRua (ORCPT + 99 others); Thu, 3 Feb 2022 12:50:30 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:58988 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353070AbiBCRu0 (ORCPT ); Thu, 3 Feb 2022 12:50:26 -0500 Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:5173:4d3f:4ddc:2012]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 88C14A1B; Thu, 3 Feb 2022 18:50:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1643910624; bh=BiSM1/tUiuHB+ucl4bRPpd0NpznpAwRoiYbo00KaSgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hQrxrc6Dih45juj0ftTcpduBktLhyll6oSV5CRPa/+DkSRKy1eqMskHS/mQl+olBq oilhE/GCgDAdOcgSgjCUR3Ege4kor5Ejt//zZvB+vzK+B1Afx7/GJZxhPENmR2NOsh LzAYunKf6WO8lbNLD20YXhjod/TPiWpvqD1CQ0LA= From: Jean-Michel Hautbois To: jeanmichel.hautbois@ideasonboard.com Cc: dave.stevenson@raspberrypi.com, devicetree@vger.kernel.org, kernel-list@raspberrypi.com, laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, lukasz@jany.st, mchehab@kernel.org, naush@raspberrypi.com, robh@kernel.org, tomi.valkeinen@ideasonboard.com, nsaenz@kernel.org, bcm-kernel-feedback-list@broadcom.com Subject: [RFC PATCH v4 01/12] media: v4l: Add V4L2-PIX-FMT-Y12P format Date: Thu, 3 Feb 2022 18:49:58 +0100 Message-Id: <20220203175009.558868-2-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220203175009.558868-1-jeanmichel.hautbois@ideasonboard.com> References: <20220203175009.558868-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a packed grey-scale image format with a depth of 12 bits per pixel. Two consecutive pixels are packed into 3 bytes. The first 2 bytes contain the 8 high order bits of the pixels, and the 3rd byte contains the 4 least significants bits of each pixel, in the same order. Add the entry in userspace API, and document it. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart --- .../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 91942c4f0967..2d9d588eedcd 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst @@ -92,6 +92,17 @@ are often referred to as greyscale formats. - ... - ... + * .. _V4L2-PIX-FMT-Y12P: + + - ``V4L2_PIX_FMT_Y12P`` + - 'Y12P' + + - Y'\ :sub:`0`\ [11:4] + - Y'\ :sub:`1`\ [11:4] + - Y'\ :sub:`1`\ [3:0] Y'\ :sub:`0`\ [3:0] + - ... + - ... + * .. _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 cca67d43a62f..64a72a6b2132 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1264,6 +1264,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_Y16_BE: descr = "16-bit Greyscale BE"; break; case V4L2_PIX_FMT_Y10BPACK: descr = "10-bit Greyscale (Packed)"; break; case V4L2_PIX_FMT_Y10P: descr = "10-bit Greyscale (MIPI Packed)"; break; + case V4L2_PIX_FMT_Y12P: descr = "12-bit Greyscale (MIPI Packed)"; break; case V4L2_PIX_FMT_Y8I: descr = "Interleaved 8-bit Greyscale"; break; case V4L2_PIX_FMT_Y12I: descr = "Interleaved 12-bit Greyscale"; break; case V4L2_PIX_FMT_Z16: descr = "16-bit Depth"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index c9ee5de1bce6..bef488205fea 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -569,6 +569,7 @@ struct v4l2_pix_format { /* Grey bit-packed formats */ #define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */ #define V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P') /* 10 Greyscale, MIPI RAW10 packed */ +#define V4L2_PIX_FMT_Y12P v4l2_fourcc('Y', '1', '2', 'P') /* 12 Greyscale, MIPI RAW12 packed */ /* Palette formats */ #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ -- 2.32.0