From patchwork Wed May 4 13:15:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15769 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id F3766C0F2A for ; Wed, 4 May 2022 13:16:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D99FB65654; Wed, 4 May 2022 15:16:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1651670166; bh=fWt404U56kVZzAAy/pmDiT2ZgDHZxGo0VUAC6a9H31o=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=F2BVOhDfXAl1UcHQbKeKo013aNy/8E8TtNDtSvFYTVRmZ4OdNxQn1aR4N7M73338I bKvqm5f9nH50tyqBxQ/AhsETnLCDQfT0chl6npFY3CZevPGjRwsD+29U4X37PtsD0z AUfzpwdMXiTVVy2n2Bu1ippjR5KCGJQPM0qHH7/VJOTSK26EHgLBHwXYdL/iPEdUgS fGfg/SeVp8U2zVpA8owhYGHn1BHhwuNJe6j+AWjcKCzYTMDOca2ozJmFydrL7ucKME sVFdAtZyTBhikI790UVK6hWuFn7kJVDtNG7Y6po/Ht1mj6qNZfcYsMZGKq0Hi1LROe p/7D9cScOqzQg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E54E65642 for ; Wed, 4 May 2022 15:16:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="F6k0Et+u"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 25FA14A8 for ; Wed, 4 May 2022 15:16:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1651670164; bh=fWt404U56kVZzAAy/pmDiT2ZgDHZxGo0VUAC6a9H31o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=F6k0Et+u/qQPeKQJhunCihSaCFRG6hQJaRs1D5kejZKUK3yfWzfN/0F4OoE81WOd0 +p7FD29SLxF4VZt/F+szhyom6xJ87O+//heU5LwZ9Qtfhuh2Snl1GNAlv1ok/L+8Nx bdJK7C1sO9miWEUvlkwvyRw8bMo/AwNmITaIOMVM= To: libcamera-devel@lists.libcamera.org Date: Wed, 4 May 2022 16:15:55 +0300 Message-Id: <20220504131558.9498-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220504131558.9498-1-laurent.pinchart@ideasonboard.com> References: <20220504131558.9498-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/5] libcamera: formats: Add YUV444 and YVU444 pixel formats X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Extend planar YUV format support with 4:4:4 formats. Those formats are used by the i.MX8 ISI driver that will be supported by the simple pipeline handler. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/libcamera/formats.cpp | 26 ++++++++++++++++++++++++++ src/libcamera/formats.yaml | 4 ++++ src/libcamera/v4l2_pixelformat.cpp | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index c5cca37b02c2..e205df0529ba 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -482,6 +482,32 @@ const std::map pixelFormatInfo{ .pixelsPerGroup = 2, .planes = {{ { 2, 1 }, { 1, 1 }, { 1, 1 } }}, } }, + { formats::YUV444, { + .name = "YUV444", + .format = formats::YUV444, + .v4l2Formats = { + .single = V4L2PixelFormat(), + .multi = V4L2PixelFormat(V4L2_PIX_FMT_YUV444M), + }, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = false, + .pixelsPerGroup = 1, + .planes = {{ { 1, 1 }, { 1, 1 }, { 1, 1 } }}, + } }, + { formats::YVU444, { + .name = "YVU444", + .format = formats::YVU444, + .v4l2Formats = { + .single = V4L2PixelFormat(), + .multi = V4L2PixelFormat(V4L2_PIX_FMT_YVU444M), + }, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = false, + .pixelsPerGroup = 1, + .planes = {{ { 1, 1 }, { 1, 1 }, { 1, 1 } }}, + } }, /* Greyscale formats. */ { formats::R8, { diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml index 0b527dbefe32..7dda01325f33 100644 --- a/src/libcamera/formats.yaml +++ b/src/libcamera/formats.yaml @@ -71,6 +71,10 @@ formats: fourcc: DRM_FORMAT_YUV422 - YVU422: fourcc: DRM_FORMAT_YVU422 + - YUV444: + fourcc: DRM_FORMAT_YUV444 + - YVU444: + fourcc: DRM_FORMAT_YVU444 - MJPEG: fourcc: DRM_FORMAT_MJPEG diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp index 818bd1037e14..8d409943e2d3 100644 --- a/src/libcamera/v4l2_pixelformat.cpp +++ b/src/libcamera/v4l2_pixelformat.cpp @@ -115,6 +115,10 @@ const std::map vpf2pf{ { formats::YUV422, "Planar YUV 4:2:2 (N-C)" } }, { V4L2PixelFormat(V4L2_PIX_FMT_YUV422M), { formats::YVU422, "Planar YVU 4:2:2 (N-C)" } }, + { V4L2PixelFormat(V4L2_PIX_FMT_YUV444M), + { formats::YUV444, "Planar YUV 4:4:4 (N-C)" } }, + { V4L2PixelFormat(V4L2_PIX_FMT_YUV444M), + { formats::YVU444, "Planar YVU 4:4:4 (N-C)" } }, /* Greyscale formats. */ { V4L2PixelFormat(V4L2_PIX_FMT_GREY),