[libcamera-devel,1/3] include: linux: Add V4L2_CID_NOTIFY_GAINS control
diff mbox series

Message ID 20211223080110.9766-2-david.plowman@raspberrypi.com
State Accepted
Headers show
Series
  • Make use of V4L2_CID_NOTIFY_GAINS
Related show

Commit Message

David Plowman Dec. 23, 2021, 8:01 a.m. UTC
Add this control which is already present upstream.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
---
 include/linux/v4l2-controls.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart Dec. 24, 2021, 3:18 a.m. UTC | #1
Hi David,

Thank you for the patch.

On Thu, Dec 23, 2021 at 08:01:08AM +0000, David Plowman wrote:
> Add this control which is already present upstream.

We have a process to update the kernel headers. If possible, please use
utils/update-kernel-headers.sh. You will need to then pick changes
manually to avoid dropping the currently not upstream features. The git
log for the include/linux/ directory can show you examples.

> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> ---
>  include/linux/v4l2-controls.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
> index 59a57418..9db06cb2 100644
> --- a/include/linux/v4l2-controls.h
> +++ b/include/linux/v4l2-controls.h
> @@ -1109,6 +1109,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 */
David Plowman Dec. 30, 2021, 10:52 a.m. UTC | #2
Hi Laurent

Sure, I can do that. Could you perhaps give me a few more hints, I
didn't really understand how looking at commits in include/linux was
helping me. Anyway, here's what I've done:

1. I've cloned the whole of linuxtv-master onto my Pi.
2. I've run "utils/update-kernel-headers.sh <path-to-my-linuxtv-master>
3. There were some warnings about intel-ipu3.h being missing, I assume
I can ignore that.
4. Now I have about 7 files in include/linux that show up as
"modified", and one (intel-ipu3.h) is "deleted".

I'm guessing I shouldn't try and commit them all, so should I commit
just the one file that I care about (v4l2-controls.h)? But I can't
commit the whole v4l2-controls.h either, not least because it doesn't
compile (V4L2_CID_USER_BCM2835_ISP_BASE has disappeared), and it has
lots of other changes too. So maybe I just pick the single line that I
want? (only now it doesn't seem any different to what I did). So I've
rather managed to confuse myself!

Thanks for your help!

Best regards
David

On Fri, 24 Dec 2021 at 03:18, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi David,
>
> Thank you for the patch.
>
> On Thu, Dec 23, 2021 at 08:01:08AM +0000, David Plowman wrote:
> > Add this control which is already present upstream.
>
> We have a process to update the kernel headers. If possible, please use
> utils/update-kernel-headers.sh. You will need to then pick changes
> manually to avoid dropping the currently not upstream features. The git
> log for the include/linux/ directory can show you examples.
>
> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> > ---
> >  include/linux/v4l2-controls.h | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
> > index 59a57418..9db06cb2 100644
> > --- a/include/linux/v4l2-controls.h
> > +++ b/include/linux/v4l2-controls.h
> > @@ -1109,6 +1109,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 */
>
> --
> Regards,
>
> Laurent Pinchart
Laurent Pinchart Dec. 30, 2021, 4:13 p.m. UTC | #3
Hi David,

On Thu, Dec 30, 2021 at 10:52:54AM +0000, David Plowman wrote:
> Hi Laurent
> 
> Sure, I can do that. Could you perhaps give me a few more hints, I
> didn't really understand how looking at commits in include/linux was
> helping me. Anyway, here's what I've done:
> 
> 1. I've cloned the whole of linuxtv-master onto my Pi.
> 2. I've run "utils/update-kernel-headers.sh <path-to-my-linuxtv-master>
> 3. There were some warnings about intel-ipu3.h being missing, I assume
> I can ignore that.
> 4. Now I have about 7 files in include/linux that show up as
> "modified", and one (intel-ipu3.h) is "deleted".

The path to intel-ipu3.h has changed in v5.14. I've just sent a patch to
update the update-kernel-headers.sh script accordingly, and have CC'ed
you.

> I'm guessing I shouldn't try and commit them all, so should I commit
> just the one file that I care about (v4l2-controls.h)? But I can't
> commit the whole v4l2-controls.h either, not least because it doesn't
> compile (V4L2_CID_USER_BCM2835_ISP_BASE has disappeared), and it has
> lots of other changes too. So maybe I just pick the single line that I
> want? (only now it doesn't seem any different to what I did). So I've
> rather managed to confuse myself!

Committing everything will indeed not work, as we carry local
modifications for a few uAPI extensions that are not upstream yet. This
includes

- In include/linux/drm_fourcc.h, the MJPEG and Bayer formats, the
  DRM_FORMAT_MOD_VENDOR_MIPI modifier vendor prefix, the
  IPU3_FORMAT_MOD_PACKED modifier and the MIPI_FORMAT_MOD_CSI2_PACKED
  modifier.

- In include/linux/v4l2-controls.h, V4L2_CID_USER_BCM2835_ISP_BASE.

- In include/linux/videodev2.h, V4L2_META_FMT_SENSOR_DATA and
  V4L2_META_FMT_BCM2835_ISP_STATS.

Those should be kept. All other modifications should be committed.

By the way, we could simplify the kernel headers update process by
moving the definitions of V4L2_CID_USER_BCM2835_ISP_BASE,
V4L2_META_FMT_SENSOR_DATA and V4L2_META_FMT_BCM2835_ISP_STATS to the
Raspberry Pi pipeline handler and/or IPA as appropriate, until those get
merged upstream.

> Thanks for your help!
> 
> On Fri, 24 Dec 2021 at 03:18, Laurent Pinchart wrote:
> >
> > Hi David,
> >
> > Thank you for the patch.
> >
> > On Thu, Dec 23, 2021 at 08:01:08AM +0000, David Plowman wrote:
> > > Add this control which is already present upstream.
> >
> > We have a process to update the kernel headers. If possible, please use
> > utils/update-kernel-headers.sh. You will need to then pick changes
> > manually to avoid dropping the currently not upstream features. The git
> > log for the include/linux/ directory can show you examples.
> >
> > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> > > ---
> > >  include/linux/v4l2-controls.h | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
> > > index 59a57418..9db06cb2 100644
> > > --- a/include/linux/v4l2-controls.h
> > > +++ b/include/linux/v4l2-controls.h
> > > @@ -1109,6 +1109,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 */
Laurent Pinchart Dec. 30, 2021, 7:09 p.m. UTC | #4
Hi David,

On Thu, Dec 30, 2021 at 06:13:11PM +0200, Laurent Pinchart wrote:
> On Thu, Dec 30, 2021 at 10:52:54AM +0000, David Plowman wrote:
> > Hi Laurent
> > 
> > Sure, I can do that. Could you perhaps give me a few more hints, I
> > didn't really understand how looking at commits in include/linux was
> > helping me. Anyway, here's what I've done:
> > 
> > 1. I've cloned the whole of linuxtv-master onto my Pi.

By the way, we prefer updating to known tags from Linus' tree when
possible. As the V4L2_CID_NOTIFY_GAINS control has been merged in
v5.16-rc1, could you update to v5.16-rc7 instead of linuxtv/master ?

> > 2. I've run "utils/update-kernel-headers.sh <path-to-my-linuxtv-master>
> > 3. There were some warnings about intel-ipu3.h being missing, I assume
> > I can ignore that.
> > 4. Now I have about 7 files in include/linux that show up as
> > "modified", and one (intel-ipu3.h) is "deleted".
> 
> The path to intel-ipu3.h has changed in v5.14. I've just sent a patch to
> update the update-kernel-headers.sh script accordingly, and have CC'ed
> you.
> 
> > I'm guessing I shouldn't try and commit them all, so should I commit
> > just the one file that I care about (v4l2-controls.h)? But I can't
> > commit the whole v4l2-controls.h either, not least because it doesn't
> > compile (V4L2_CID_USER_BCM2835_ISP_BASE has disappeared), and it has
> > lots of other changes too. So maybe I just pick the single line that I
> > want? (only now it doesn't seem any different to what I did). So I've
> > rather managed to confuse myself!
> 
> Committing everything will indeed not work, as we carry local
> modifications for a few uAPI extensions that are not upstream yet. This
> includes
> 
> - In include/linux/drm_fourcc.h, the MJPEG and Bayer formats, the
>   DRM_FORMAT_MOD_VENDOR_MIPI modifier vendor prefix, the
>   IPU3_FORMAT_MOD_PACKED modifier and the MIPI_FORMAT_MOD_CSI2_PACKED
>   modifier.
> 
> - In include/linux/v4l2-controls.h, V4L2_CID_USER_BCM2835_ISP_BASE.
> 
> - In include/linux/videodev2.h, V4L2_META_FMT_SENSOR_DATA and
>   V4L2_META_FMT_BCM2835_ISP_STATS.
> 
> Those should be kept. All other modifications should be committed.
> 
> By the way, we could simplify the kernel headers update process by
> moving the definitions of V4L2_CID_USER_BCM2835_ISP_BASE,
> V4L2_META_FMT_SENSOR_DATA and V4L2_META_FMT_BCM2835_ISP_STATS to the
> Raspberry Pi pipeline handler and/or IPA as appropriate, until those get
> merged upstream.
> 
> > Thanks for your help!
> > 
> > On Fri, 24 Dec 2021 at 03:18, Laurent Pinchart wrote:
> > >
> > > Hi David,
> > >
> > > Thank you for the patch.
> > >
> > > On Thu, Dec 23, 2021 at 08:01:08AM +0000, David Plowman wrote:
> > > > Add this control which is already present upstream.
> > >
> > > We have a process to update the kernel headers. If possible, please use
> > > utils/update-kernel-headers.sh. You will need to then pick changes
> > > manually to avoid dropping the currently not upstream features. The git
> > > log for the include/linux/ directory can show you examples.
> > >
> > > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> > > > ---
> > > >  include/linux/v4l2-controls.h | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
> > > > index 59a57418..9db06cb2 100644
> > > > --- a/include/linux/v4l2-controls.h
> > > > +++ b/include/linux/v4l2-controls.h
> > > > @@ -1109,6 +1109,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 */
David Plowman Dec. 30, 2021, 7:51 p.m. UTC | #5
Hi Laurent

Thanks for the answers. I think that's clear enough, I'll include all
this as the first patch in my next revision of that set. It will
probably be January now!

Best regards
David

On Thu, 30 Dec 2021 at 19:09, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi David,
>
> On Thu, Dec 30, 2021 at 06:13:11PM +0200, Laurent Pinchart wrote:
> > On Thu, Dec 30, 2021 at 10:52:54AM +0000, David Plowman wrote:
> > > Hi Laurent
> > >
> > > Sure, I can do that. Could you perhaps give me a few more hints, I
> > > didn't really understand how looking at commits in include/linux was
> > > helping me. Anyway, here's what I've done:
> > >
> > > 1. I've cloned the whole of linuxtv-master onto my Pi.
>
> By the way, we prefer updating to known tags from Linus' tree when
> possible. As the V4L2_CID_NOTIFY_GAINS control has been merged in
> v5.16-rc1, could you update to v5.16-rc7 instead of linuxtv/master ?
>
> > > 2. I've run "utils/update-kernel-headers.sh <path-to-my-linuxtv-master>
> > > 3. There were some warnings about intel-ipu3.h being missing, I assume
> > > I can ignore that.
> > > 4. Now I have about 7 files in include/linux that show up as
> > > "modified", and one (intel-ipu3.h) is "deleted".
> >
> > The path to intel-ipu3.h has changed in v5.14. I've just sent a patch to
> > update the update-kernel-headers.sh script accordingly, and have CC'ed
> > you.
> >
> > > I'm guessing I shouldn't try and commit them all, so should I commit
> > > just the one file that I care about (v4l2-controls.h)? But I can't
> > > commit the whole v4l2-controls.h either, not least because it doesn't
> > > compile (V4L2_CID_USER_BCM2835_ISP_BASE has disappeared), and it has
> > > lots of other changes too. So maybe I just pick the single line that I
> > > want? (only now it doesn't seem any different to what I did). So I've
> > > rather managed to confuse myself!
> >
> > Committing everything will indeed not work, as we carry local
> > modifications for a few uAPI extensions that are not upstream yet. This
> > includes
> >
> > - In include/linux/drm_fourcc.h, the MJPEG and Bayer formats, the
> >   DRM_FORMAT_MOD_VENDOR_MIPI modifier vendor prefix, the
> >   IPU3_FORMAT_MOD_PACKED modifier and the MIPI_FORMAT_MOD_CSI2_PACKED
> >   modifier.
> >
> > - In include/linux/v4l2-controls.h, V4L2_CID_USER_BCM2835_ISP_BASE.
> >
> > - In include/linux/videodev2.h, V4L2_META_FMT_SENSOR_DATA and
> >   V4L2_META_FMT_BCM2835_ISP_STATS.
> >
> > Those should be kept. All other modifications should be committed.
> >
> > By the way, we could simplify the kernel headers update process by
> > moving the definitions of V4L2_CID_USER_BCM2835_ISP_BASE,
> > V4L2_META_FMT_SENSOR_DATA and V4L2_META_FMT_BCM2835_ISP_STATS to the
> > Raspberry Pi pipeline handler and/or IPA as appropriate, until those get
> > merged upstream.
> >
> > > Thanks for your help!
> > >
> > > On Fri, 24 Dec 2021 at 03:18, Laurent Pinchart wrote:
> > > >
> > > > Hi David,
> > > >
> > > > Thank you for the patch.
> > > >
> > > > On Thu, Dec 23, 2021 at 08:01:08AM +0000, David Plowman wrote:
> > > > > Add this control which is already present upstream.
> > > >
> > > > We have a process to update the kernel headers. If possible, please use
> > > > utils/update-kernel-headers.sh. You will need to then pick changes
> > > > manually to avoid dropping the currently not upstream features. The git
> > > > log for the include/linux/ directory can show you examples.
> > > >
> > > > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> > > > > ---
> > > > >  include/linux/v4l2-controls.h | 1 +
> > > > >  1 file changed, 1 insertion(+)
> > > > >
> > > > > diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
> > > > > index 59a57418..9db06cb2 100644
> > > > > --- a/include/linux/v4l2-controls.h
> > > > > +++ b/include/linux/v4l2-controls.h
> > > > > @@ -1109,6 +1109,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 */
>
> --
> Regards,
>
> Laurent Pinchart

Patch
diff mbox series

diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
index 59a57418..9db06cb2 100644
--- a/include/linux/v4l2-controls.h
+++ b/include/linux/v4l2-controls.h
@@ -1109,6 +1109,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 */