Linux Media Controller development
 help / color / mirror / Atom feed
From: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
To: <linux-media@vger.kernel.org>
Cc: <alain.volmat@foss.st.com>, <hugues.fruchet@foss.st.com>,
	<sylvain.petinot@foss.st.com>, <dave.stevenson@raspberrypi.com>,
	<sakari.ailus@linux.intel.com>,
	<laurent.pinchart@ideasonboard.com>,
	<kieran.bingham@ideasonboard.com>, <nicolas@ndufresne.ca>,
	<hverkuil@xs4all.nl>,
	Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Subject: [PATCH v7 2/5] media: v4l: ctrls: Add a control for HDR mode
Date: Tue, 11 Oct 2022 14:16:02 +0200	[thread overview]
Message-ID: <20221011121605.30260-2-benjamin.mugnier@foss.st.com> (raw)
In-Reply-To: <20221011121605.30260-1-benjamin.mugnier@foss.st.com>

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>
---
 .../userspace-api/media/v4l/ext-ctrls-camera.rst          | 8 ++++++++
 drivers/media/v4l2-core/v4l2-ctrls-defs.c                 | 2 ++
 include/uapi/linux/v4l2-controls.h                        | 2 ++
 3 files changed, 12 insertions(+)

diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst
index 4c5061aa9cd4..daa4f40869f8 100644
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst
@@ -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.
diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
index e22921e7ea61..564fedee2c88 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
@@ -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:
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index b5e7d082b8ad..d27e255ed33b 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -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)
-- 
2.25.1


  reply	other threads:[~2022-10-11 12:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11 12:05 [PATCH v7 0/5] media: Add ST VGXY61 camera sensor driver Benjamin Mugnier
2022-10-11 12:16 ` [PATCH v7 1/5] media: v4l: Add 1X16 16-bit greyscale media bus code definition Benjamin Mugnier
2022-10-11 12:16   ` Benjamin Mugnier [this message]
2022-11-08  9:50   ` Paul Elder
2022-10-11 12:30 ` [PATCH v7 3/5] media: dt-bindings: Add ST VGXY61 camera sensor binding Benjamin Mugnier
2022-10-11 12:30 ` [PATCH v7 4/5] media: Documentation: Add ST VGXY61 driver documentation Benjamin Mugnier
2022-10-25  7:35   ` Sakari Ailus
2022-10-11 12:30 ` [PATCH v7 5/5] media: i2c: Add driver for ST VGXY61 camera sensor Benjamin Mugnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221011121605.30260-2-benjamin.mugnier@foss.st.com \
    --to=benjamin.mugnier@foss.st.com \
    --cc=alain.volmat@foss.st.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=hugues.fruchet@foss.st.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sylvain.petinot@foss.st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox