[libcamera-devel] [PATCH] include: linux: Update v4l2-controls.h

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue May 19 15:52:45 CEST 2020


Hi Jacopo,

Thank you for the patch.

On Tue, May 19, 2020 at 02:50:50PM +0200, Jacopo Mondi wrote:
> Update include/linux/v4l2-controls.h with the latest version from the
> Linux kernel media tree master.

Could you please mention the commit ID ?

Instead of pulling a random commit ID, one option would be to only
replace the control macros we need, similarly to what we did in
972bb30c4b2fdd50f8fc02683130fd45b0d793f6, and then update to v5.8 when
it will be released (or most likely v5.8-rc1 already to avoid delays).

> The most notable update is the definition of the V4L2_CID_ORIENTATION
> control that replaces the downstream V4L2_CID_LOCATION.
> 
> The here copied version is not a 1-to-1 copy of the kernel exported
> header , because of this conflicting definition
> 
> < /* The base for the bcm2835-isp driver controls.
> <  * We reserve 16 controls for this driver. */
> < #define V4L2_CID_USER_BCM2835_ISP_BASE		(V4L2_CID_USER_BASE + 0x10c0)
> > /*
> >  * The base for the atmel isc driver controls.
> >  * We reserve 32 controls for this driver.
> >  */
> > #define V4L2_CID_USER_ATMEL_ISC_BASE		(V4L2_CID_USER_BASE + 0x10c0)
> 
> In order to keep the RPi pipeline working, keep the downstream
> V4L2_CID_USER_BCM2835_ISP_BASE definition and post-pone the inclusion
> of V4L2_CID_USER_ATMEL_ISC_BASE, which is not used by libcamera.
> 
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
>  include/linux/v4l2-controls.h | 26 ++++++++++----------------
>  1 file changed, 10 insertions(+), 16 deletions(-)
> 
> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
> index 171351aee6fc..ffa0d74dd195 100644
> --- a/include/linux/v4l2-controls.h
> +++ b/include/linux/v4l2-controls.h
> @@ -469,6 +469,10 @@ enum v4l2_mpeg_video_h264_level {
>  	V4L2_MPEG_VIDEO_H264_LEVEL_4_2	= 13,
>  	V4L2_MPEG_VIDEO_H264_LEVEL_5_0	= 14,
>  	V4L2_MPEG_VIDEO_H264_LEVEL_5_1	= 15,
> +	V4L2_MPEG_VIDEO_H264_LEVEL_5_2	= 16,
> +	V4L2_MPEG_VIDEO_H264_LEVEL_6_0	= 17,
> +	V4L2_MPEG_VIDEO_H264_LEVEL_6_1	= 18,
> +	V4L2_MPEG_VIDEO_H264_LEVEL_6_2	= 19,
>  };
>  #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA	(V4L2_CID_MPEG_BASE+360)
>  #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA	(V4L2_CID_MPEG_BASE+361)
> @@ -497,6 +501,7 @@ enum v4l2_mpeg_video_h264_profile {
>  	V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA	= 14,
>  	V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH		= 15,
>  	V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH		= 16,
> +	V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH		= 17,
>  };
>  #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT	(V4L2_CID_MPEG_BASE+364)
>  #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH	(V4L2_CID_MPEG_BASE+365)
> @@ -914,22 +919,10 @@ enum v4l2_auto_focus_range {
>  #define V4L2_CID_PAN_SPEED			(V4L2_CID_CAMERA_CLASS_BASE+32)
>  #define V4L2_CID_TILT_SPEED			(V4L2_CID_CAMERA_CLASS_BASE+33)
> 
> -/*
> - * This version of the v4l2-controls.h header part of the libcamera sources has
> - * deviated from the version distributed by the mainline Linux kernel.
> - *
> - * Specifically, this version includes temporary definitions of a few custom
> - * controls (V4L2_CID_CAMERA_SENSOR_ROTATION and
> - * V4L2_CID_CAMERA_SENSOR_LOCATION) which have not yet made their way to
> - * upstream Linux.
> - *
> - * When updating this header with a more recent version, make sure the new
> - * version has those additional controls defined.
> - */
> -#define V4L2_CID_CAMERA_SENSOR_LOCATION		(V4L2_CID_CAMERA_CLASS_BASE+34)
> -#define V4L2_LOCATION_FRONT			0
> -#define V4L2_LOCATION_BACK			1
> -#define V4L2_LOCATION_EXTERNAL			2
> +#define V4L2_CID_CAMERA_ORIENTATION		(V4L2_CID_CAMERA_CLASS_BASE+34)
> +#define V4L2_CAMERA_ORIENTATION_FRONT		0
> +#define V4L2_CAMERA_ORIENTATION_BACK		1
> +#define V4L2_CAMERA_ORIENTATION_EXTERNAL	2
> 
>  #define V4L2_CID_CAMERA_SENSOR_ROTATION		(V4L2_CID_CAMERA_CLASS_BASE+35)
> 
> @@ -1055,6 +1048,7 @@ enum v4l2_jpeg_chroma_subsampling {
>  #define V4L2_CID_TEST_PATTERN_GREENR		(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 5)
>  #define V4L2_CID_TEST_PATTERN_BLUE		(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6)
>  #define V4L2_CID_TEST_PATTERN_GREENB		(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7)
> +#define V4L2_CID_UNIT_CELL_SIZE			(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 8)
> 
> 
>  /* Image processing controls */

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list