Skip to content

Commit a9c8059

Browse files
davidplowmanmchehab
authored andcommitted
media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control
We add a new control V4L2_CID_NOTIFY_GAINS which allows the sensor to be notified what gains will be applied to the different colour channels by subsequent processing (such as by an ISP), even though the sensor will not apply any of these gains itself. For Bayer sensors this will be an array control taking 4 values which are the 4 gains arranged in the fixed order B, Gb, Gr and R, irrespective of the exact Bayer order of the sensor itself. The use of an array makes it straightforward to extend this control to non-Bayer sensors (for example, sensors with an RGBW pattern) in future. The units are in all cases linear with the default value indicating a gain of exactly 1.0. For example, if the default value were reported as 128 then the value 192 would represent a gain of exactly 1.5. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent f136316 commit a9c8059

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/media/v4l2-core/v4l2-ctrls-defs.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,7 @@ const char *v4l2_ctrl_get_name(u32 id)
11081108
case V4L2_CID_TEST_PATTERN_GREENR: return "Green (Red) Pixel Value";
11091109
case V4L2_CID_TEST_PATTERN_BLUE: return "Blue Pixel Value";
11101110
case V4L2_CID_TEST_PATTERN_GREENB: return "Green (Blue) Pixel Value";
1111+
case V4L2_CID_NOTIFY_GAINS: return "Notify Gains";
11111112

11121113
/* Image processing controls */
11131114
/* Keep the order of the 'case's the same as in v4l2-controls.h! */

‎include/uapi/linux/v4l2-controls.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,7 @@ enum v4l2_jpeg_chroma_subsampling {
11181118
#define V4L2_CID_TEST_PATTERN_BLUE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6)
11191119
#define V4L2_CID_TEST_PATTERN_GREENB (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7)
11201120
#define V4L2_CID_UNIT_CELL_SIZE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 8)
1121+
#define V4L2_CID_NOTIFY_GAINS (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 9)
11211122

11221123

11231124
/* Image processing controls */

0 commit comments

Comments
 (0)