[libcamera-devel] [PATCH v2 1/2] include: linux: Update v4l2 ctrls for properties

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed May 20 12:42:53 CEST 2020


Hi Jacopo,

Thank you for the patch.

On Wed, May 20, 2020 at 12:03:19PM +0200, Jacopo Mondi wrote:
> The version of the v4l2-controls.h header file shipped by libcamera had
> slightly deviated from the upstream one, as it included definitions for

"slightly" ? ;-)

> v4l2 controls that report camera properties, which were not acceppted

s/acceppted/accepted/

> upstream at the time the header file was updated.
> 
> Now that the controls definition has been accepted in the master branch
> of the linux-media kernel tree, update include/linux/v4l2-controls.h with
> the upstream-accepted definition of the control ids that describe camera
> properties.
> 
> The control definition has been imported from the Linux kernel header
> files generated from the most recent linux-media master branch, at
> revision
> ad3a44cbd1b2e ("media: i2c: imx219: Parse and register properties")
> 
> Instead of updating the whole header, just update the definition of V4L2
> controls that describe camera properties. A full header update will be
> performed at the next available linux-media release candidate.

s/at the next available/at a future/ (maybe we'll miss -rc1 :-))
s/linux-media/Linux kernel/

> 
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  include/linux/v4l2-controls.h | 20 ++++----------------
>  1 file changed, 4 insertions(+), 16 deletions(-)
> 
> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
> index 171351aee6fc..24eea2b69a86 100644
> --- a/include/linux/v4l2-controls.h
> +++ b/include/linux/v4l2-controls.h
> @@ -914,22 +914,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)
>  

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list