[PATCH v2 2/6] include: linux: videodev2: Add generic line based pixel formats
Kieran Bingham
kieran.bingham at ideasonboard.com
Tue Jan 7 14:23:30 CET 2025
Quoting Jacopo Mondi (2024-11-08 10:51:12)
> Add the definition for the generic line based pixelformats.
>
> The formats has been added in upstream Linux by commit
> 1d9215233958 ("media: uapi: v4l: Add generic 8-bit metadata format
> definitions") which got merged in Linux v6.10.
>
> The formats however are not yet available to userspace, as they
> have been made only available to the kernel by commit
> d69c8429ea80 ("media: uapi: v4l: Don't expose generic metadata formats
> to userspace") to let the line-based metadata support stabilize before
> allowing applications to use it.
aha, I was going to ask why this isn't brought in by the header import
scripts - but now I see indeed the #ifdef __KERNEL__.
So yes, keeping this in our tree manually for now is reasonable. A bit
of a workaround but helps us make progress between chicken-and-eggs...
Acked-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
>
> With the forthcoming completion of the line-based metadata upstreaming
> manually add the generic line based pixel format to prepare libcamera
> to support them.
>
> Signed-off-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
> ---
> include/linux/videodev2.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
> index 3829c0b60f52..1168f6ff40eb 100644
> --- a/include/linux/videodev2.h
> +++ b/include/linux/videodev2.h
> @@ -840,6 +840,18 @@ struct v4l2_pix_format {
> /* The metadata format identifier for FE stats buffers. */
> #define V4L2_META_FMT_RPI_FE_STATS v4l2_fourcc('R', 'P', 'F', 'S')
>
> +/*
> + * Line-based metadata formats. Remember to update v4l_fill_fmtdesc() when
> + * adding new ones!
> + */
> +#define V4L2_META_FMT_GENERIC_8 v4l2_fourcc('M', 'E', 'T', '8') /* Generic 8-bit metadata */
> +#define V4L2_META_FMT_GENERIC_CSI2_10 v4l2_fourcc('M', 'C', '1', 'A') /* 10-bit CSI-2 packed 8-bit metadata */
> +#define V4L2_META_FMT_GENERIC_CSI2_12 v4l2_fourcc('M', 'C', '1', 'C') /* 12-bit CSI-2 packed 8-bit metadata */
> +#define V4L2_META_FMT_GENERIC_CSI2_14 v4l2_fourcc('M', 'C', '1', 'E') /* 14-bit CSI-2 packed 8-bit metadata */
> +#define V4L2_META_FMT_GENERIC_CSI2_16 v4l2_fourcc('M', 'C', '1', 'G') /* 16-bit CSI-2 packed 8-bit metadata */
> +#define V4L2_META_FMT_GENERIC_CSI2_20 v4l2_fourcc('M', 'C', '1', 'K') /* 20-bit CSI-2 packed 8-bit metadata */
> +#define V4L2_META_FMT_GENERIC_CSI2_24 v4l2_fourcc('M', 'C', '1', 'O') /* 24-bit CSI-2 packed 8-bit metadata */
> +
> /* priv field value to indicates that subsequent fields are valid. */
> #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe
>
> --
> 2.47.0
>
More information about the libcamera-devel
mailing list