All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS
@ 2021-08-16 11:39 David Plowman
  2021-08-16 11:39 ` [PATCH v6 1/2] media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control David Plowman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Plowman @ 2021-08-16 11:39 UTC (permalink / raw)
  To: linux-media, sakari.ailus, Laurent Pinchart, Kieran Bingham,
	Hans Verkuil, Mauro Carvalho Chehab
  Cc: David Plowman

Hi again everyone

Thanks for last round of feedback, leading to this v6 pair of
patches. I've made the documentation improvements that were suggested,
and accordingly added Laurent's "Reviewed-by" tags.

Thanks and best regards

David

David Plowman (2):
  media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control
  media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAINS control

 .../media/v4l/ext-ctrls-image-source.rst      | 20 +++++++++++++++++++
 drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  1 +
 include/uapi/linux/v4l2-controls.h            |  1 +
 3 files changed, 22 insertions(+)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v6 1/2] media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control
  2021-08-16 11:39 [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS David Plowman
@ 2021-08-16 11:39 ` David Plowman
  2021-08-16 11:39 ` [PATCH v6 2/2] media: v4l2-ctrls: Document " David Plowman
  2021-09-07 13:32 ` [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS Laurent Pinchart
  2 siblings, 0 replies; 7+ messages in thread
From: David Plowman @ 2021-08-16 11:39 UTC (permalink / raw)
  To: linux-media, sakari.ailus, Laurent Pinchart, Kieran Bingham,
	Hans Verkuil, Mauro Carvalho Chehab
  Cc: David Plowman

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>
---
 drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 +
 include/uapi/linux/v4l2-controls.h        | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
index 421300e13a41..f87053c83249 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
@@ -1107,6 +1107,7 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_TEST_PATTERN_GREENR:	return "Green (Red) Pixel Value";
 	case V4L2_CID_TEST_PATTERN_BLUE:	return "Blue Pixel Value";
 	case V4L2_CID_TEST_PATTERN_GREENB:	return "Green (Blue) Pixel Value";
+	case V4L2_CID_NOTIFY_GAINS:		return "Notify Gains";
 
 	/* Image processing controls */
 	/* Keep the order of the 'case's the same as in v4l2-controls.h! */
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index 5532b5f68493..133e20444939 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -1118,6 +1118,7 @@ enum v4l2_jpeg_chroma_subsampling {
 #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)
+#define V4L2_CID_NOTIFY_GAINS			(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 9)
 
 
 /* Image processing controls */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v6 2/2] media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAINS control
  2021-08-16 11:39 [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS David Plowman
  2021-08-16 11:39 ` [PATCH v6 1/2] media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control David Plowman
@ 2021-08-16 11:39 ` David Plowman
  2021-09-07 13:32 ` [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS Laurent Pinchart
  2 siblings, 0 replies; 7+ messages in thread
From: David Plowman @ 2021-08-16 11:39 UTC (permalink / raw)
  To: linux-media, sakari.ailus, Laurent Pinchart, Kieran Bingham,
	Hans Verkuil, Mauro Carvalho Chehab
  Cc: David Plowman

Add documentation for the V4L2_CID_NOTIFY_GAINS control.

This control is required by sensors that need to know what colour
gains will be applied to pixels by downstream processing (such as by
an ISP), though the sensor does not apply these gains itself.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 .../media/v4l/ext-ctrls-image-source.rst      | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst
index de43f5c8486d..71f23f131f97 100644
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst
@@ -72,3 +72,23 @@ Image Source Control IDs
     * - __u32
       - ``height``
       - Height of the area.
+
+``V4L2_CID_NOTIFY_GAINS (integer array)``
+    The sensor is notified what gains will be applied to the different
+    colour channels by subsequent processing (such as by an ISP). The
+    sensor is merely informed of these values in case it performs
+    processing that requires them, but it does not apply them itself to
+    the output pixels.
+
+    Currently it is defined only for Bayer sensors, and is an array
+    control taking 4 gain values, being the gains for each of the
+    Bayer channels. The gains are always in the order B, Gb, Gr and R,
+    irrespective of the exact Bayer order of the sensor itself.
+
+    The use of an array allows this control to be extended to sensors
+    with, for example, non-Bayer CFAs (colour filter arrays).
+
+    The units for the gain values are linear, with the default value
+    representing a gain of exactly 1.0. For example, if this default value
+    is reported as being (say) 128, then a value of 192 would represent
+    a gain of exactly 1.5.
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS
  2021-08-16 11:39 [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS David Plowman
  2021-08-16 11:39 ` [PATCH v6 1/2] media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control David Plowman
  2021-08-16 11:39 ` [PATCH v6 2/2] media: v4l2-ctrls: Document " David Plowman
@ 2021-09-07 13:32 ` Laurent Pinchart
  2021-10-05  9:37   ` David Plowman
  2 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2021-09-07 13:32 UTC (permalink / raw)
  To: David Plowman
  Cc: linux-media, sakari.ailus, Kieran Bingham, Hans Verkuil,
	Mauro Carvalho Chehab

Hello,

I've reviewed this series and it looks good to me. Sakari, would you
like to have a look, or should I send a pull request ?

On Mon, Aug 16, 2021 at 12:39:07PM +0100, David Plowman wrote:
> Hi again everyone
> 
> Thanks for last round of feedback, leading to this v6 pair of
> patches. I've made the documentation improvements that were suggested,
> and accordingly added Laurent's "Reviewed-by" tags.
> 
> Thanks and best regards
> 
> David
> 
> David Plowman (2):
>   media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control
>   media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAINS control
> 
>  .../media/v4l/ext-ctrls-image-source.rst      | 20 +++++++++++++++++++
>  drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  1 +
>  include/uapi/linux/v4l2-controls.h            |  1 +
>  3 files changed, 22 insertions(+)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS
  2021-09-07 13:32 ` [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS Laurent Pinchart
@ 2021-10-05  9:37   ` David Plowman
  2021-10-06  1:10     ` Laurent Pinchart
  0 siblings, 1 reply; 7+ messages in thread
From: David Plowman @ 2021-10-05  9:37 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media, Sakari Ailus, Kieran Bingham, Hans Verkuil,
	Mauro Carvalho Chehab

Hi Laurent, Sakari, everyone

I was wondering whether I might give this another little nudge just so
that it doesn't get lost.

Thanks again and best regards

David

On Tue, 7 Sept 2021 at 14:32, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hello,
>
> I've reviewed this series and it looks good to me. Sakari, would you
> like to have a look, or should I send a pull request ?
>
> On Mon, Aug 16, 2021 at 12:39:07PM +0100, David Plowman wrote:
> > Hi again everyone
> >
> > Thanks for last round of feedback, leading to this v6 pair of
> > patches. I've made the documentation improvements that were suggested,
> > and accordingly added Laurent's "Reviewed-by" tags.
> >
> > Thanks and best regards
> >
> > David
> >
> > David Plowman (2):
> >   media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control
> >   media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAINS control
> >
> >  .../media/v4l/ext-ctrls-image-source.rst      | 20 +++++++++++++++++++
> >  drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  1 +
> >  include/uapi/linux/v4l2-controls.h            |  1 +
> >  3 files changed, 22 insertions(+)
>
> --
> Regards,
>
> Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS
  2021-10-05  9:37   ` David Plowman
@ 2021-10-06  1:10     ` Laurent Pinchart
  2021-10-06 13:03       ` Sakari Ailus
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2021-10-06  1:10 UTC (permalink / raw)
  To: David Plowman
  Cc: linux-media, Sakari Ailus, Kieran Bingham, Hans Verkuil,
	Mauro Carvalho Chehab

Hi David,

On Tue, Oct 05, 2021 at 10:37:54AM +0100, David Plowman wrote:
> Hi Laurent, Sakari, everyone
> 
> I was wondering whether I might give this another little nudge just so
> that it doesn't get lost.

I've already reviewed it, I can only join you to nicely ask Sakari if he
could have a look :-) I know he has lots of patches on his plate at the
moment though.

Hans, would you like to share your opinion on this series ?

> On Tue, 7 Sept 2021 at 14:32, Laurent Pinchart wrote:
> >
> > Hello,
> >
> > I've reviewed this series and it looks good to me. Sakari, would you
> > like to have a look, or should I send a pull request ?
> >
> > On Mon, Aug 16, 2021 at 12:39:07PM +0100, David Plowman wrote:
> > > Hi again everyone
> > >
> > > Thanks for last round of feedback, leading to this v6 pair of
> > > patches. I've made the documentation improvements that were suggested,
> > > and accordingly added Laurent's "Reviewed-by" tags.
> > >
> > > Thanks and best regards
> > >
> > > David
> > >
> > > David Plowman (2):
> > >   media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control
> > >   media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAINS control
> > >
> > >  .../media/v4l/ext-ctrls-image-source.rst      | 20 +++++++++++++++++++
> > >  drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  1 +
> > >  include/uapi/linux/v4l2-controls.h            |  1 +
> > >  3 files changed, 22 insertions(+)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS
  2021-10-06  1:10     ` Laurent Pinchart
@ 2021-10-06 13:03       ` Sakari Ailus
  0 siblings, 0 replies; 7+ messages in thread
From: Sakari Ailus @ 2021-10-06 13:03 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: David Plowman, linux-media, Kieran Bingham, Hans Verkuil,
	Mauro Carvalho Chehab

Hi David, Laurent,

On Wed, Oct 06, 2021 at 04:10:26AM +0300, Laurent Pinchart wrote:
> Hi David,
> 
> On Tue, Oct 05, 2021 at 10:37:54AM +0100, David Plowman wrote:
> > Hi Laurent, Sakari, everyone
> > 
> > I was wondering whether I might give this another little nudge just so
> > that it doesn't get lost.
> 
> I've already reviewed it, I can only join you to nicely ask Sakari if he
> could have a look :-) I know he has lots of patches on his plate at the
> moment though.
> 
> Hans, would you like to share your opinion on this series ?

The patches have been merged some time ago to the media tree master branch:

commit 311a839a1ad255ebcb7291fb4e0d2ec2f32312a7
Author: David Plowman <david.plowman@raspberrypi.com>
Date:   Mon Aug 16 13:39:09 2021 +0200

    media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAINS control
    
    Add documentation for the V4L2_CID_NOTIFY_GAINS control.
    
    This control is required by sensors that need to know what colour
    gains will be applied to pixels by downstream processing (such as by
    an ISP), though the sensor does not apply these gains itself.
    
    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>

commit a9c80593ff80ddb7c6496624e5384e1ea3460a72
Author: David Plowman <david.plowman@raspberrypi.com>
Date:   Mon Aug 16 13:39:08 2021 +0200

    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>

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-06 13:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 11:39 [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS David Plowman
2021-08-16 11:39 ` [PATCH v6 1/2] media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control David Plowman
2021-08-16 11:39 ` [PATCH v6 2/2] media: v4l2-ctrls: Document " David Plowman
2021-09-07 13:32 ` [PATCH v6 0/2] New V4L2 control V4L2_CID_NOTIFY_GAINS Laurent Pinchart
2021-10-05  9:37   ` David Plowman
2021-10-06  1:10     ` Laurent Pinchart
2021-10-06 13:03       ` Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.