{"id":21868,"url":"https://patchwork.libcamera.org/api/patches/21868/?format=json","web_url":"https://patchwork.libcamera.org/patch/21868/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20241108105117.137121-3-jacopo.mondi@ideasonboard.com>","date":"2024-11-08T10:51:12","name":"[v2,2/6] include: linux: videodev2: Add generic line based pixel formats","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"7a9ecd782f5b884be8c73c9c3b29bd7e4a3c1818","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/?format=json","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21868/mbox/","series":[{"id":4783,"url":"https://patchwork.libcamera.org/api/series/4783/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4783","date":"2024-11-08T10:51:10","name":"libcamera: Initial support for generic line based metadata","version":2,"mbox":"https://patchwork.libcamera.org/series/4783/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21868/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21868/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id EFFA2BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Nov 2024 10:51:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8E81D657AE;\n\tFri,  8 Nov 2024 11:51:32 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 93E2C60589\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Nov 2024 11:51:25 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F394D7E9;\n\tFri,  8 Nov 2024 11:51:15 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"HllcnW4s\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731063076;\n\tbh=9RDNizsjn3o2mwoKS2stCXuUdQGqHVcv8Vx79zQ7o4s=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=HllcnW4sQY/15+yt+uFp4OAtx7sixDEkA4tLRH8zcvDcVcKskn7p+yzo2K2wSv6Hi\n\tbzVCzwZaZ1JRulhC2FG+WUYzbO1cBYyW3skRcv23SGSTmFdYSjexi9fDjJo8XVpYeE\n\tDj46tKuivOFNtLYIBjmERDHK96P+x+cgDzmGYXDY=","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tnaush@raspberrypi.com","Subject":"[PATCH v2 2/6] include: linux: videodev2: Add generic line based\n\tpixel formats","Date":"Fri,  8 Nov 2024 11:51:12 +0100","Message-ID":"<20241108105117.137121-3-jacopo.mondi@ideasonboard.com>","X-Mailer":"git-send-email 2.47.0","In-Reply-To":"<20241108105117.137121-1-jacopo.mondi@ideasonboard.com>","References":"<20241108105117.137121-1-jacopo.mondi@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add the definition for the generic line based pixelformats.\n\nThe formats has been added in upstream Linux by commit\n1d9215233958 (\"media: uapi: v4l: Add generic 8-bit metadata format\ndefinitions\") which got merged in Linux v6.10.\n\nThe formats however are not yet available to userspace, as they\nhave been made only available to the kernel by commit\nd69c8429ea80 (\"media: uapi: v4l: Don't expose generic metadata formats\nto userspace\") to let the line-based metadata support stabilize before\nallowing applications to use it.\n\nWith the forthcoming completion of the line-based metadata upstreaming\nmanually add the generic line based pixel format to prepare libcamera\nto support them.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n include/linux/videodev2.h | 12 ++++++++++++\n 1 file changed, 12 insertions(+)","diff":"diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\nindex 3829c0b60f52..1168f6ff40eb 100644\n--- a/include/linux/videodev2.h\n+++ b/include/linux/videodev2.h\n@@ -840,6 +840,18 @@ struct v4l2_pix_format {\n /* The metadata format identifier for FE stats buffers. */\n #define V4L2_META_FMT_RPI_FE_STATS v4l2_fourcc('R', 'P', 'F', 'S')\n \n+/*\n+ * Line-based metadata formats. Remember to update v4l_fill_fmtdesc() when\n+ * adding new ones!\n+ */\n+#define V4L2_META_FMT_GENERIC_8\t\tv4l2_fourcc('M', 'E', 'T', '8') /* Generic 8-bit metadata */\n+#define V4L2_META_FMT_GENERIC_CSI2_10\tv4l2_fourcc('M', 'C', '1', 'A') /* 10-bit CSI-2 packed 8-bit metadata */\n+#define V4L2_META_FMT_GENERIC_CSI2_12\tv4l2_fourcc('M', 'C', '1', 'C') /* 12-bit CSI-2 packed 8-bit metadata */\n+#define V4L2_META_FMT_GENERIC_CSI2_14\tv4l2_fourcc('M', 'C', '1', 'E') /* 14-bit CSI-2 packed 8-bit metadata */\n+#define V4L2_META_FMT_GENERIC_CSI2_16\tv4l2_fourcc('M', 'C', '1', 'G') /* 16-bit CSI-2 packed 8-bit metadata */\n+#define V4L2_META_FMT_GENERIC_CSI2_20\tv4l2_fourcc('M', 'C', '1', 'K') /* 20-bit CSI-2 packed 8-bit metadata */\n+#define V4L2_META_FMT_GENERIC_CSI2_24\tv4l2_fourcc('M', 'C', '1', 'O') /* 24-bit CSI-2 packed 8-bit metadata */\n+\n /* priv field value to indicates that subsequent fields are valid. */\n #define V4L2_PIX_FMT_PRIV_MAGIC\t\t0xfeedcafe\n \n","prefixes":["v2","2/6"]}