]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: v4l: ctrls: Add a control for HDR mode
authorBenjamin Mugnier <benjamin.mugnier@foss.st.com>
Tue, 11 Oct 2022 12:16:02 +0000 (14:16 +0200)
committerSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 25 Oct 2022 11:38:31 +0000 (14:38 +0300)
Add V4L2_CID_HDR_MODE as a menu item control to set the HDR mode of the
sensor, and its documentation.
Menu items are not standardized as they differ for each sensors.

Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst
drivers/media/v4l2-core/v4l2-ctrls-defs.c
include/uapi/linux/v4l2-controls.h

index 4c5061aa9cd45ee1969ed2c36cf11acbdc274219..daa4f40869f8f82e52be788c84e8b29a223efc55 100644 (file)
@@ -661,3 +661,11 @@ enum v4l2_scene_mode -
 .. [#f1]
    This control may be changed to a menu control in the future, if more
    options are required.
+
+``V4L2_CID_HDR_SENSOR_MODE (menu)``
+    Change the sensor HDR mode. A HDR picture is obtained by merging two
+    captures of the same scene using two different exposure periods. HDR mode
+    describes the way these two captures are merged in the sensor.
+
+    As modes differ for each sensor, menu items are not standardized by this
+    control and are left to the programmer.
index e22921e7ea61732fbaee4de19b9ee7564d8c0906..564fedee2c88ed3ad5d9480df05f1bc1d09f78f4 100644 (file)
@@ -1043,6 +1043,7 @@ const char *v4l2_ctrl_get_name(u32 id)
        case V4L2_CID_UNIT_CELL_SIZE:           return "Unit Cell Size";
        case V4L2_CID_CAMERA_ORIENTATION:       return "Camera Orientation";
        case V4L2_CID_CAMERA_SENSOR_ROTATION:   return "Camera Sensor Rotation";
+       case V4L2_CID_HDR_SENSOR_MODE:          return "HDR Sensor Mode";
 
        /* FM Radio Modulator controls */
        /* Keep the order of the 'case's the same as in v4l2-controls.h! */
@@ -1370,6 +1371,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
        case V4L2_CID_STATELESS_H264_START_CODE:
        case V4L2_CID_CAMERA_ORIENTATION:
        case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE:
+       case V4L2_CID_HDR_SENSOR_MODE:
                *type = V4L2_CTRL_TYPE_MENU;
                break;
        case V4L2_CID_LINK_FREQ:
index b5e7d082b8adf65a25d71d520af633d0739763fc..d27e255ed33b382ab67af64cb4fda3fe82f6f13d 100644 (file)
@@ -1019,6 +1019,8 @@ enum v4l2_auto_focus_range {
 
 #define V4L2_CID_CAMERA_SENSOR_ROTATION                (V4L2_CID_CAMERA_CLASS_BASE+35)
 
+#define V4L2_CID_HDR_SENSOR_MODE               (V4L2_CID_CAMERA_CLASS_BASE+36)
+
 /* FM Modulator class control IDs */
 
 #define V4L2_CID_FM_TX_CLASS_BASE              (V4L2_CTRL_CLASS_FM_TX | 0x900)