From patchwork Mon Aug 1 00:05:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 16881 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 7469BBE173 for ; Mon, 1 Aug 2022 00:05:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 428106331F; Mon, 1 Aug 2022 02:05:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1659312357; bh=E3PAsvSy3WTxzdQlZAYsTOacD1wqsE8rvqeK246JCf8=; 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=q78hxTtATinwJC8Un2wHaxSCVubEvqLLQ+0AnEty31wstQFjr49lN3Z1C7Remu9Pw DuRbjFdetd4uLea7VGJh5Cwu7JWpU3UV3iSDgSIUfaKvg4VsCXV78a9YVkOz5P38nw Y8jwlD8ejFQyoaQkLdVCVYTtwZUcyzLhxD3CiZsAh98J4YPh98UX16xKsup4V7mv/I HMMQxg4ZPHMRfgS3bmR2dqHkifc9X1aB3mQG5TYx7ypciBUN/ApaFR1wCjzShAhmHM CMU+Nq+uy0NK4MB2uMD3XDwgbrIUspKJJe1wtQZiSFu5TwBHJAyURW01PJZnIyLJQI HJLlsqG0j8NNw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B2F163316 for ; Mon, 1 Aug 2022 02:05:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Q9hetGDB"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A8D699AA for ; Mon, 1 Aug 2022 02:05:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1659312354; bh=E3PAsvSy3WTxzdQlZAYsTOacD1wqsE8rvqeK246JCf8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Q9hetGDBwp4IfumLjF3JRM0nvEcX5a1Ps/BKQdR6iHOCxIQeFnSPHu1KIquHxErQR GmspqqPPj6i/zr6gQcu7rriFx2HkQ8z9jfEEFqDtwwy6wqLhDNDanpEDcysNBF2zob gVrkveVt2QpVCduZ6+NDCpounDHN4XB7+Ux/HIDk= To: libcamera-devel@lists.libcamera.org Date: Mon, 1 Aug 2022 03:05:34 +0300 Message-Id: <20220801000543.3501-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220801000543.3501-1-laurent.pinchart@ideasonboard.com> References: <20220801000543.3501-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 04/13] libcamera: formats: Add AVUY8888 and XVUY8888 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" Add missing 32-bit packet YUV 4:4:4 formats. These formats are used by the i.MX8 ISI driver. 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 283ecb3d89d8..24739c01c928 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -363,6 +363,32 @@ const std::map pixelFormatInfo{ .pixelsPerGroup = 2, .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }}, } }, + { formats::AVUY8888, { + .name = "AVUY8888", + .format = formats::AVUY8888, + .v4l2Formats = { + .single = V4L2PixelFormat(V4L2_PIX_FMT_YUVA32), + .multi = V4L2PixelFormat(), + }, + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = false, + .pixelsPerGroup = 1, + .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }}, + } }, + { formats::XVUY8888, { + .name = "XVUY8888", + .format = formats::XVUY8888, + .v4l2Formats = { + .single = V4L2PixelFormat(V4L2_PIX_FMT_YUVX32), + .multi = V4L2PixelFormat(), + }, + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = false, + .pixelsPerGroup = 1, + .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }}, + } }, /* YUV planar formats. */ { formats::NV12, { diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml index 7dda01325f33..d3fbf5f47211 100644 --- a/src/libcamera/formats.yaml +++ b/src/libcamera/formats.yaml @@ -49,6 +49,10 @@ formats: fourcc: DRM_FORMAT_UYVY - VYUY: fourcc: DRM_FORMAT_VYUY + - AVUY8888: + fourcc: DRM_FORMAT_AVUY8888 + - XVUY8888: + fourcc: DRM_FORMAT_XVUY8888 - NV12: fourcc: DRM_FORMAT_NV12 diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp index bdcdc3be4e0c..53ac9399130a 100644 --- a/src/libcamera/v4l2_pixelformat.cpp +++ b/src/libcamera/v4l2_pixelformat.cpp @@ -81,6 +81,10 @@ const std::map vpf2pf{ { formats::UYVY, "UYVY 4:2:2" } }, { V4L2PixelFormat(V4L2_PIX_FMT_VYUY), { formats::VYUY, "VYUY 4:2:2" } }, + { V4L2PixelFormat(V4L2_PIX_FMT_YUVA32), + { formats::AVUY8888, "32-bit YUVA 8-8-8-8" } }, + { V4L2PixelFormat(V4L2_PIX_FMT_YUVX32), + { formats::XVUY8888, "32-bit YUVX 8-8-8-8" } }, /* YUV planar formats. */ { V4L2PixelFormat(V4L2_PIX_FMT_NV16),