From patchwork Mon Jun 29 08:36:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 27074 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 B02C0C3264 for ; Mon, 29 Jun 2026 09:42:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0996765F13; Mon, 29 Jun 2026 11:42:28 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="VPd9/qTJ"; dkim-atps=neutral Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4510565F10 for ; Mon, 29 Jun 2026 11:42:25 +0200 (CEST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-490d6730461so2806885e9.3 for ; Mon, 29 Jun 2026 02:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1782726145; x=1783330945; 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=YJ2j2YFI2gtwpHQ6GxpM81KxZWVYfpTifYHhAI9CDqg=; b=VPd9/qTJOZXgDBbUr2DHpIVmHimpmE4AiNGHi1R7ri4Psbe0RVYbAmja1ThvlEuCeW FNfCBD6+G8FeWfQHdkCZBf89Vs4b3ESgeQsexBMXEZSkIG6HuEQqmDP03oBlbjpe8xXJ tIrgEpiIU7hz6PjvuETImnd+CBc18k1kknLEMCigkY7kdZ1QOvvo2qUo/+gZTGcv+aQL P2vb1EFivoBLyxpBK45wRiBNEmDIoXepWS+cW4Z1Hc9znMQSn5F6MBvfWZSC2qaP5Byc 9+zyGIvfwzb6np2RxqZR01/1+8xe4awKYMY1ZGvaQ5QvS5IV22JHqaCuknear7UCzDpt XJbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782726145; x=1783330945; 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=YJ2j2YFI2gtwpHQ6GxpM81KxZWVYfpTifYHhAI9CDqg=; b=mafuyTjKe8Ejc7zn/Ysz8mrC404byhTsPg+xtmMj4qoa9eHeMhlEASm9xxA3o7Z04U QgAqfDCv10kxYS1BD4EigTWVLWX6pHLVFoYj443yvb5wkYga1Z1/TUBzK8qCcVtBcvGf xkmERBOeOfP1C1XYF74oNH9H6i2TfVS8BCPXdL4JCLYF/2TQ0n+xVVBxUNaw6EDdycp6 XJTW1Ja7KEQZjw1mYFZXIUv6pDuTtec8uci3RvVgxHHDCpGdsBDsw96qBfjDCtvNgCKq ngYYZsdxZRl1DjTOu49bb3ln2RpV4G/xkgb35m0ljnIunh2XJq65av65o4vVnjlyfZUG G2fg== X-Gm-Message-State: AOJu0YxFVOw1ZUG0XvZ6oXHq6K9O/YyErpG4FgAx9bbh4XtEDYcMiOim BCZEy1m0gMZ4Vu9l8Ury5sex1Od5evhmmdt5K2TnqKneR4YFNaQrIfWoGzGHTAfhMMVLfc1sp0f XBXkLIXI= X-Gm-Gg: AfdE7cnEE9ld6/1Xtce8uRaguUwN6JTqw3W/ntx9NXUmES2uM6lnGvpc1LAasIXq80c wmPdDBhu3Sh7bl8KiNTQSkgREHIXl7HU0OEY2cRnuTsIjRJMn9oSVhk6L8q/eSdfewguqk5Wk5R AaRd9NXkDk8FPPpK3sy2cF4P8pufiNEhl4ATaw7JV6WOJjjnXRNxEv8LhjWQYPPXKhxMPV/jnHi DqQEeqBY7NJM7qfwBK9Xj4qOhYwZOxvKXNJvdvE5W6XpTU9oRUX4xWuYE0yUGmjCFtpgEEZVSpj 0N1mPLACWcMDaW3hKjypJiLuaOr8GmmP+1K3N2pBqawruGKJr/r/xO0o94QscCC0BOjiuZHOvyO iWMaNGfyfsve9YkDZoKOWm1DCCxjgb9GLfsz5YgDbLo1GmZR7uOpWg6VhZ3Rew+ofcC4pL8s7Fj T5CXocoE1aVTyPE7NGbVMLGuAoregExPmA/+u1YeZ6b7DImjdghvR0HV0tujr1tsKUUNzNTgWgu A/taRYEwLtcJMrXbHaxMvrKbzC9bfgouDXhqOVBNIcTq9iDtJEQxAC/Xe0pnXqN7M80gZ8frUJr TSX4THhUg+tfhKutEClR X-Received: by 2002:a05:600d:117:b0:490:b4d4:5c16 with SMTP id 5b1f17b1804b1-4926689f7a8mr85414975e9.8.1782726144693; Mon, 29 Jun 2026 02:42:24 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2026 02:42:24 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v2 1/3] utils: codegen: gen-formats: Resolve Broadcom SAND modifiers Date: Mon, 29 Jun 2026 09:36:40 +0100 Message-ID: <20260629094216.747340-2-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" The Broadcom SAND (coloumn mode) modifiers are defined through the fourcc_mod_broadcom_code() column-height helper rather than a plain fourcc_mod_code(), so the generator script cannot not resolve them. Collapse line continuations and match the helper form so formats may reference the DRM_FORMAT_MOD_BROADCOM_SAND* modifiers. Signed-off-by: Naushir Patuck --- utils/codegen/gen-formats.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/utils/codegen/gen-formats.py b/utils/codegen/gen-formats.py index 740790e8f1a6..add04558f65f 100755 --- a/utils/codegen/gen-formats.py +++ b/utils/codegen/gen-formats.py @@ -18,13 +18,22 @@ class DRMFourCC(object): format_regex = re.compile(r"#define (DRM_FORMAT_[A-Z0-9_]+)[ \t]+fourcc_code\(('.', '.', '.', '.')\)") mod_vendor_regex = re.compile(r"#define DRM_FORMAT_MOD_VENDOR_([A-Z0-9_]+)[ \t]+([0-9a-fA-Fx]+)") mod_regex = re.compile(r"#define ([A-Za-z0-9_]+)[ \t]+fourcc_mod_code\(([A-Z0-9_]+), ([0-9a-fA-Fx]+)\)") + # Broadcom SAND modifiers are defined indirectly via a _COL_HEIGHT(v) helper + # that wraps fourcc_mod_broadcom_code(, v) (which injects the BROADCOM + # vendor). Match that helper, strip _COL_HEIGHT to recover the convenience + # macro name, and use as the value - valid as the convenience macro is + # the height-0 case, which contributes nothing to it. + mod_brcm_regex = re.compile(r"#define (DRM_FORMAT_MOD_BROADCOM_SAND[0-9]+)_COL_HEIGHT\(v\)" + r"[ \t]+fourcc_mod_broadcom_code\(([0-9]+), v\)") def __init__(self, file): self.formats = {} self.vendors = {} self.mods = {} - for line in file: + # Collapse line continuations so multi-line macros match on one line. + lines = re.sub(r'\\[ \t]*\n', ' ', file.read()).splitlines() + for line in lines: match = DRMFourCC.format_regex.match(line) if match: format, fourcc = match.groups() @@ -43,6 +52,12 @@ class DRMFourCC(object): self.mods[mod] = (vendor, int(value, 0)) continue + match = DRMFourCC.mod_brcm_regex.match(line) + if match: + mod, code = match.groups() + self.mods[mod] = ('BROADCOM', int(code)) + continue + def fourcc(self, name): return self.formats[name] From patchwork Mon Jun 29 08:36:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 27075 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 EB2ABC3264 for ; Mon, 29 Jun 2026 09:42:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C5D465F19; Mon, 29 Jun 2026 11:42:28 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="A9TYo/0P"; dkim-atps=neutral Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E4F14658B4 for ; Mon, 29 Jun 2026 11:42:25 +0200 (CEST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-473987fc217so68327f8f.0 for ; Mon, 29 Jun 2026 02:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1782726145; x=1783330945; 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=jjn/Cv38r0CBDn6xvS/obDVXTgG4SR205+YKmG/PUv0=; b=A9TYo/0P2AmMjDZMWCAEXBjuDcIOfY+K5ZOiZidty/cA/BoDiFItAkgZdCmdg5Sxa4 KcfCI0IfoXuH8IyX21MxHm+KeTRVw9xOydbZmQzB4SzNVejO+EWlvpZ/losPhusEgy8b 4SV4zo3wdD3c/m/xA5cfUHa9j3pATTy+iY+lzS6vc7pzhb8wHZmgzEfTpI8+rhHus1nM GnpfygXoSJYI95Agke/TpoOI8lUt2jST+91YnSWdlmwHNmiN7gHb8IvunDQcaJI7KI8I TSI+6T/CfYID7vlqG+LjXwulwZ4fXICGrhsBgAMR7fiY7QqZYauUqmsKPAlhhjgmG6Fa DULQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782726145; x=1783330945; 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=jjn/Cv38r0CBDn6xvS/obDVXTgG4SR205+YKmG/PUv0=; b=bR03nP4L0Knctv2Xucm3JO2666QpmEc7ZS4/GCrSh7MFwImegG0el3byotNkAklgSo z8tHQdsEgoTQ5xH4QyPKm2wdPgbfaoJIXrelj/UdNcsiIPSTrsZilEEQrtwRF0xUU5um Xlpfxolis4+8l2QrKWiWg3WdGypuBm+RkHh6P9+QYI4UeJDLIMn0wZJFU/jXJQMaZt5p dGRJmKPKU8RXMMlyzAcORsqoo4cFEkK9ItdYVAC6PFP/czpkPhnNSnLgVvPiJS+BsFgy Gx1MsXpqRBdNXUb6bAt6KbqXxdQmpYEaCUraUqO4/vMcefuoXMFBL1OkUlcX57R4e5nk 9TvA== X-Gm-Message-State: AOJu0YwNYZRE0Hh1/S/qkWJWKgUddV6wfoQbQE41YrCbfgaj50W+YTq3 pGp23K1ZkF/mPROh8GBJfzFFWkduzQcLIZRO2rBaasNazON6BQy+Fgkn/VY4FJiFvvxLSDcvuAk 8rFagyJo= X-Gm-Gg: AfdE7cmWTXP+y1dKzcSSHjCHMk54zQggWZhg+pBGhbRSVqCCJGRjV6yttbrAdGQKrGR TJNSuSZ/LezhU4yOO0qLnMXtKZMu73uD53aWZ8X9IcEEtGr1SQ/0X0igfey6J3E1Q+m5brTz1E0 6AZJFiyr7VHAUQkXlEPVylSYCZpq1Dv1gSLPTECpFKEyiTLqKtBkQNtXWgHeB6B7TCkPkwZZHhT qHuAW8V5G+fS/clDtKen2TKv7rkFYbC/8Pmx6RGLc0XwGjbNsy22Z3wBuViNeQ1nMxDENZu1QZ/ quyZLV+2qgPmgU4kB50LfaTf4T2tIJT0E97+KEx+et/uWg3vg24oo+m3S6TwKZDCxOUmml0VkvW lbzZv5/IFgnene7mczOKXZBaqoo2B2ZT19aBQj6LNvRP4EviW4+ADznRIPK4uwV4PDmRji33NCl PaBLkkunBFC48FJ/tGXqpK7KtvV/eMWs748Qmo+jyyMfsv8YQja0i0AwJNNyP0tv9TUIGbytKll WmjH4vK2f6GMcpAm5pi9WVJt+SmPD7Tg6exL/mlaS2aDpuXpuGsWa39jWN9ZZcqgk93TKDIMJJe TIc5/IEJ6M4jUYma/bpC X-Received: by 2002:a05:600c:6386:b0:493:a974:f15d with SMTP id 5b1f17b1804b1-493a974f26emr33058925e9.7.1782726145414; Mon, 29 Jun 2026 02:42:25 -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.24 (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 2/3] include: linux: videodev2: Add NV12MT_COL128 8/10-bit pixel formats Date: Mon, 29 Jun 2026 09:36:41 +0100 Message-ID: <20260629094216.747340-3-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 V4L2_PIX_FMT_NV12MT_COL128 and V4L2_PIX_FMT_NV12MT_10_COL128 4CCs. These formats are available from the PiSP Backend hardware. Signed-off-by: Naushir Patuck --- include/linux/videodev2.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 8bccad84ff83..0c6c4c6831d9 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -670,6 +670,9 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */ #define V4L2_PIX_FMT_NV12M_8L128 v4l2_fourcc('N', 'A', '1', '2') /* Y/CbCr 4:2:0 8x128 tiles */ #define V4L2_PIX_FMT_NV12M_10BE_8L128 v4l2_fourcc_be('N', 'T', '1', '2') /* Y/CbCr 4:2:0 10-bit 8x128 tiles */ +#define V4L2_PIX_FMT_NV12MT_COL128 v4l2_fourcc('N', 'c', '1', '2') /* 12 Y/CbCr 4:2:0 128 pixel wide column */ +#define V4L2_PIX_FMT_NV12MT_10_COL128 v4l2_fourcc('N', 'c', '3', '0') + /* Y/CbCr 4:2:0 10bpc, 3x10 packed as 4 bytes in a 128 bytes / 96 pixel wide column */ /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ 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),