From patchwork Mon Jun 29 08:36:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 27076 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 97410C3303 for ; Mon, 29 Jun 2026 09:42:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5A4A665F11; Mon, 29 Jun 2026 11:42:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="R0IgBfQb"; dkim-atps=neutral Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 92535658B4 for ; Mon, 29 Jun 2026 11:42:26 +0200 (CEST) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-490791a3e92so1564325e9.0 for ; Mon, 29 Jun 2026 02:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1782726146; x=1783330946; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=h1rClfaffIT3DE8I5/juRuLpsPmXkec9YylWUf+GqM4=; b=R0IgBfQbQTcT7fAKRMWkG8BeC7faLP9aBwjF/QGLIQm/ojPzembEDIvbTwLJU2cMIn 1Me3Z/nKWQJDhtCB5BC+Aij5nI9Iwx3eU0t+rjmgu6MTfLoWLyBKmEwcY2IGEKEaIasI j3vK1DQaSuEwfplMp8Qhd5RzvW+d0H1e553tPLTYFeB/7nE2eJ4aPuouNnHEOP8bWJLm 3j1KGCXM02mu/0jqozX9WCdIHINGwCJCiHd24aBkrrStskx0L0FrZ4LKMPHSzQ+qf5dc evzwxAb2pEtVeXrCdY9tBnCdstJyp25yg44luMZ3fII7TTHwrPvjo/DWWukKqyr8hOBF DnEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782726146; x=1783330946; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=h1rClfaffIT3DE8I5/juRuLpsPmXkec9YylWUf+GqM4=; b=OnzjNaf2N2Rm4630Jrc8Xr2mOkutwuyjyszw7u2xec8eqqTgYstO3AmGgo/H8BV34Z wRLEASFSTiGkKjIAzG/z1ArHkTwc6DCm3jL+TJ0+8RgHmt3vGsRzSNR93cdnzrUchq+c IHckQOBR0Acek1H9xBkQvXG0pEqkAYRqQB3f6LctYFzBkMkDulsshYmP41u3FQW+WSZ9 jc7SjrT/ZtRsaAWjfCFx6ldjgk1ekesqv3iHvD5tKsuOeP0XXVEPouTR6ii/k0hTN6a+ Dlg/dCVE6s2M7f7tP02ia/0GEobS9XI4nYmc8McCwFEDlqeWKVKukuusE6NVGjdM2Xjq fYAw== X-Gm-Message-State: AOJu0YxuP6HV4Up+hVKF0LCJQMCZVDJu507vpcmHcBo8/QT9jafytwew oD61r5wmUH9uuzPRZvzZEn1uk6MRlC6bzLJ+QTi9mV2qp+ifI56vHQOhlLAf4nC16vrSI4eR/AS fKIm0iq4= X-Gm-Gg: AfdE7cm7l4LYvRRAMXus+1i8+dPBS8i+rNHixCT0JJjpW5syK0rJ1NkdHbqPUHUNlyc UVldBDXq0kWBULgpsQ++O7kQK5VkuFMcxLSJCApnRl44CraALegy7x8bbwqDFquJ2QhKtmaLXY3 r4+EOAYhtJ3RSOzcw966HSPxNv7fW75lpgLMhedDhYM8ck9FfXLs6T3eRjfPj4ZrWr1yVJCJH0C CKKduNpK8zSickFUoN32tO2qe6lx+9e3lPbV4OjqWVHUOH3zOZeVLOT46tmJdH3rOp7zeFLNHsv WcTd7u2DcYybZ9RXdRK9VZE6v7DUdgkUnmcAh6AkdifZPDa11nte7InQ4qcrKnJAYFw7w8NKMDJ /Fe6eLwipKrODjz7bUBTQJx3UQGU+NVieP673OtKTR+RU5qntVvVLQda2dvxDMTo3uMc5lg7CRs 6i7rftdMjzLU8u5eCVO+DwS7tOhXp8MPkp9eFEcjUXT4OW9VC5oeFD/wZQGRcSQ9UmdLGm8YGrh Zfewans27VYFuFTa38mFJu6ZDZHN1nXGwavpmViGFi/8CKyFjTisD1VfRWzsA/S1ujE25+vkBp4 I7jFbrIbRqzR6tefSaaK X-Received: by 2002:a05:600c:4714:b0:490:e919:7bba with SMTP id 5b1f17b1804b1-492668b80a8mr120274055e9.8.1782726146045; Mon, 29 Jun 2026 02:42:26 -0700 (PDT) Received: from naush-dell.pitowers.org ([2a00:1098:3142:1f:496e:3dec:bc78:809f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268f700c0sm345499125e9.0.2026.06.29.02.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2026 02:42:25 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v2 3/3] libcamera: formats: Add NV12MT_COL128 8/10-bit pixel formats Date: Mon, 29 Jun 2026 09:36:42 +0100 Message-ID: <20260629094216.747340-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260629094216.747340-1-naush@raspberrypi.com> References: <20260629094216.747340-1-naush@raspberrypi.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add the NV12MT_COL128 (NV12 8-bit) and NV12MT_10_COL128 (P030 10-bit) column layout pixel formats available from the PiSP Backend hardware. Map the matching V4L2 FourCCs to the libcamera::formats conversion table. Signed-off-by: Naushir Patuck --- src/libcamera/formats.cpp | 20 ++++++++++++++++++++ src/libcamera/formats.yaml | 6 ++++++ src/libcamera/v4l2_pixelformat.cpp | 4 ++++ 3 files changed, 30 insertions(+) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index bfcdfc08960d..c407802ea135 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -366,6 +366,26 @@ const std::map pixelFormatInfo{ .pixelsPerGroup = 2, .planes = {{ { 2, 1 }, { 2, 2 }, { 0, 0 } }}, } }, + { formats::NV12MT_COL128, { + .name = "NV12MT_COL128", + .format = formats::NV12MT_COL128, + .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_NV12MT_COL128), }, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = false, + .pixelsPerGroup = 2, + .planes = {{ { 2, 1 }, { 2, 2 }, { 0, 0 } }}, + } }, + { formats::NV12MT_10_COL128, { + .name = "NV12MT_10_COL128", + .format = formats::NV12MT_10_COL128, + .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_NV12MT_10_COL128), }, + .bitsPerPixel = 15, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = true, + .pixelsPerGroup = 6, + .planes = {{ { 8, 1 }, { 8, 2 }, { 0, 0 } }}, + } }, { formats::NV21, { .name = "NV21", .format = formats::NV21, diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml index 2d54d391ca01..3bf010c47aa6 100644 --- a/src/libcamera/formats.yaml +++ b/src/libcamera/formats.yaml @@ -73,6 +73,12 @@ formats: fourcc: DRM_FORMAT_NV24 - NV42: fourcc: DRM_FORMAT_NV42 + - NV12MT_COL128: + fourcc: DRM_FORMAT_NV12 + mod: DRM_FORMAT_MOD_BROADCOM_SAND128 + - NV12MT_10_COL128: + fourcc: DRM_FORMAT_P030 + mod: DRM_FORMAT_MOD_BROADCOM_SAND128 - YUV420: fourcc: DRM_FORMAT_YUV420 diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp index e8b3eb9c1394..bfd662b0de47 100644 --- a/src/libcamera/v4l2_pixelformat.cpp +++ b/src/libcamera/v4l2_pixelformat.cpp @@ -103,6 +103,10 @@ const std::map vpf2pf{ { formats::NV12, "Y/CbCr 4:2:0" } }, { V4L2PixelFormat(V4L2_PIX_FMT_NV12M), { formats::NV12, "Y/CbCr 4:2:0 (N-C)" } }, + { V4L2PixelFormat(V4L2_PIX_FMT_NV12MT_COL128), + { formats::NV12MT_COL128, "Y/CbCr 4:2:0 (128 col)" } }, + { V4L2PixelFormat(V4L2_PIX_FMT_NV12MT_10_COL128), + { formats::NV12MT_10_COL128, "10-bit Y/CbCr 4:2:0 (128 col)" } }, { V4L2PixelFormat(V4L2_PIX_FMT_NV21), { formats::NV21, "Y/CrCb 4:2:0" } }, { V4L2PixelFormat(V4L2_PIX_FMT_NV21M),