[{"id":32939,"web_url":"https://patchwork.libcamera.org/comment/32939/","msgid":"<173625621087.2992722.16489717783086777479@ping.linuxembedded.co.uk>","date":"2025-01-07T13:23:30","subject":"Re: [PATCH v2 2/6] include: linux: videodev2: Add generic line based\n\tpixel formats","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2024-11-08 10:51:12)\n> Add the definition for the generic line based pixelformats.\n> \n> The formats has been added in upstream Linux by commit\n> 1d9215233958 (\"media: uapi: v4l: Add generic 8-bit metadata format\n> definitions\") which got merged in Linux v6.10.\n> \n> The formats however are not yet available to userspace, as they\n> have been made only available to the kernel by commit\n> d69c8429ea80 (\"media: uapi: v4l: Don't expose generic metadata formats\n> to userspace\") to let the line-based metadata support stabilize before\n> allowing applications to use it.\n\naha, I was going to ask why this isn't brought in by the header import\nscripts - but now I see indeed the #ifdef __KERNEL__.\n\nSo yes, keeping this in our tree manually for now is reasonable. A bit\nof a workaround but helps us make progress between chicken-and-eggs...\n\n\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> With the forthcoming completion of the line-based metadata upstreaming\n> manually add the generic line based pixel format to prepare libcamera\n> to support them.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  include/linux/videodev2.h | 12 ++++++++++++\n>  1 file changed, 12 insertions(+)\n> \n> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> index 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                v4l2_fourcc('M', 'E', 'T', '8') /* Generic 8-bit metadata */\n> +#define V4L2_META_FMT_GENERIC_CSI2_10  v4l2_fourcc('M', 'C', '1', 'A') /* 10-bit CSI-2 packed 8-bit metadata */\n> +#define V4L2_META_FMT_GENERIC_CSI2_12  v4l2_fourcc('M', 'C', '1', 'C') /* 12-bit CSI-2 packed 8-bit metadata */\n> +#define V4L2_META_FMT_GENERIC_CSI2_14  v4l2_fourcc('M', 'C', '1', 'E') /* 14-bit CSI-2 packed 8-bit metadata */\n> +#define V4L2_META_FMT_GENERIC_CSI2_16  v4l2_fourcc('M', 'C', '1', 'G') /* 16-bit CSI-2 packed 8-bit metadata */\n> +#define V4L2_META_FMT_GENERIC_CSI2_20  v4l2_fourcc('M', 'C', '1', 'K') /* 20-bit CSI-2 packed 8-bit metadata */\n> +#define V4L2_META_FMT_GENERIC_CSI2_24  v4l2_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                0xfeedcafe\n>  \n> -- \n> 2.47.0\n>","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 61AE6BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Jan 2025 13:23:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F1D9B684E2;\n\tTue,  7 Jan 2025 14:23:34 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DAD9E684CD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Jan 2025 14:23:33 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 73C3580A;\n\tTue,  7 Jan 2025 14:22:41 +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=\"Ne4y8Gzn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1736256161;\n\tbh=Kz3TgUw28r8pX9RgbYO7LSTZJeOPMgvYUOHi4Lo1Fm8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=Ne4y8GznYKPbQDYGpkahkRN1w4VpqevjSbb4l+Vnlz1AzxjyUMkrl1LRWhQSxjT6b\n\tBc9TEn1QRkysGGNwLM9qjFZpp0H997NstWjtLT/H7mMiNbxKtETPBf3DOm/mdhGe9e\n\tnkLbPC22JsHvqe7Yp0rq+ybM7h1toHCrMwohd+sY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241108105117.137121-3-jacopo.mondi@ideasonboard.com>","References":"<20241108105117.137121-1-jacopo.mondi@ideasonboard.com>\n\t<20241108105117.137121-3-jacopo.mondi@ideasonboard.com>","Subject":"Re: [PATCH v2 2/6] include: linux: videodev2: Add generic line based\n\tpixel formats","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, naush@raspberrypi.com","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 07 Jan 2025 13:23:30 +0000","Message-ID":"<173625621087.2992722.16489717783086777479@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]