[libcamera-devel,2/4] ipa: raspberrypi: cam_helper: Make exposure conversion functions virtual
diff mbox series

Message ID 20211219232714.11427-3-laurent.pinchart@ideasonboard.com
State Accepted
Delegated to: Laurent Pinchart
Headers show
Series
  • libcamera: Add support for the IMX296 sensor in the Raspberry Pi IPA
Related show

Commit Message

Laurent Pinchart Dec. 19, 2021, 11:27 p.m. UTC
From: Naushir Patuck <naush@raspberrypi.com>

Some sensors (namely the Sony IMX296, whose support will be added
shortly) require different conversion formulas between exposure time and
exposure lines. Make the Exposure() and ExposureLines() functions
virtual to allow this.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/raspberrypi/cam_helper.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Naushir Patuck Dec. 20, 2021, 7:37 a.m. UTC | #1
Hi Laurent,

Thank you for your work.

On Sun, 19 Dec 2021 at 23:27, Laurent Pinchart <
laurent.pinchart@ideasonboard.com> wrote:

> From: Naushir Patuck <naush@raspberrypi.com>
>
> Some sensors (namely the Sony IMX296, whose support will be added
> shortly) require different conversion formulas between exposure time and
> exposure lines. Make the Exposure() and ExposureLines() functions
> virtual to allow this.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>

Signed-off-by: Naushir Patuck <naush <naushir@gmail.com>@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush <naushir@gmail.com>@raspberrypi.com>


> ---
>  src/ipa/raspberrypi/cam_helper.hpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/ipa/raspberrypi/cam_helper.hpp
> b/src/ipa/raspberrypi/cam_helper.hpp
> index a776153fcb84..300f8f8a2d3b 100644
> --- a/src/ipa/raspberrypi/cam_helper.hpp
> +++ b/src/ipa/raspberrypi/cam_helper.hpp
> @@ -76,8 +76,8 @@ public:
>         virtual void Prepare(libcamera::Span<const uint8_t> buffer,
>                              Metadata &metadata);
>         virtual void Process(StatisticsPtr &stats, Metadata &metadata);
> -       uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
> -       libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
> +       virtual uint32_t ExposureLines(libcamera::utils::Duration
> exposure) const;
> +       virtual libcamera::utils::Duration Exposure(uint32_t
> exposure_lines) const;
>         virtual uint32_t GetVBlanking(libcamera::utils::Duration &exposure,
>                                       libcamera::utils::Duration
> minFrameDuration,
>                                       libcamera::utils::Duration
> maxFrameDuration) const;
> --
> Regards,
>
> Laurent Pinchart
>
>
Nicolas Dufresne via libcamera-devel March 17, 2022, 11:28 a.m. UTC | #2
Quoting Laurent Pinchart (2021-12-19 23:27:12)
> From: Naushir Patuck <naush@raspberrypi.com>
> 
> Some sensors (namely the Sony IMX296, whose support will be added
> shortly) require different conversion formulas between exposure time and
> exposure lines. Make the Exposure() and ExposureLines() functions
> virtual to allow this.
> 

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/ipa/raspberrypi/cam_helper.hpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp
> index a776153fcb84..300f8f8a2d3b 100644
> --- a/src/ipa/raspberrypi/cam_helper.hpp
> +++ b/src/ipa/raspberrypi/cam_helper.hpp
> @@ -76,8 +76,8 @@ public:
>         virtual void Prepare(libcamera::Span<const uint8_t> buffer,
>                              Metadata &metadata);
>         virtual void Process(StatisticsPtr &stats, Metadata &metadata);
> -       uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
> -       libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
> +       virtual uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
> +       virtual libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
>         virtual uint32_t GetVBlanking(libcamera::utils::Duration &exposure,
>                                       libcamera::utils::Duration minFrameDuration,
>                                       libcamera::utils::Duration maxFrameDuration) const;
> -- 
> Regards,
> 
> Laurent Pinchart
>
Laurent Pinchart March 22, 2022, 11:25 p.m. UTC | #3
On Thu, Mar 17, 2022 at 11:28:01AM +0000, Kieran Bingham wrote:
> Quoting Laurent Pinchart (2021-12-19 23:27:12)
> > From: Naushir Patuck <naush@raspberrypi.com>
> > 
> > Some sensors (namely the Sony IMX296, whose support will be added
> > shortly) require different conversion formulas between exposure time and
> > exposure lines. Make the Exposure() and ExposureLines() functions
> > virtual to allow this.
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Naush, could I get your SoB line for this patch ?

> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  src/ipa/raspberrypi/cam_helper.hpp | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp
> > index a776153fcb84..300f8f8a2d3b 100644
> > --- a/src/ipa/raspberrypi/cam_helper.hpp
> > +++ b/src/ipa/raspberrypi/cam_helper.hpp
> > @@ -76,8 +76,8 @@ public:
> >         virtual void Prepare(libcamera::Span<const uint8_t> buffer,
> >                              Metadata &metadata);
> >         virtual void Process(StatisticsPtr &stats, Metadata &metadata);
> > -       uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
> > -       libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
> > +       virtual uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
> > +       virtual libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
> >         virtual uint32_t GetVBlanking(libcamera::utils::Duration &exposure,
> >                                       libcamera::utils::Duration minFrameDuration,
> >                                       libcamera::utils::Duration maxFrameDuration) const;
Kieran Bingham March 22, 2022, 11:36 p.m. UTC | #4
Quoting Laurent Pinchart (2022-03-22 23:25:05)
> On Thu, Mar 17, 2022 at 11:28:01AM +0000, Kieran Bingham wrote:
> > Quoting Laurent Pinchart (2021-12-19 23:27:12)
> > > From: Naushir Patuck <naush@raspberrypi.com>
> > > 
> > > Some sensors (namely the Sony IMX296, whose support will be added
> > > shortly) require different conversion formulas between exposure time and
> > > exposure lines. Make the Exposure() and ExposureLines() functions
> > > virtual to allow this.
> > 
> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> Naush, could I get your SoB line for this patch ?

You have it already in
 <CAEmqJPpcDLYRtbu0-5aYZxhn0rMgDR15PJj=i+OKr8dss8NtEw@mail.gmail.com>
--
KB

> 
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > ---
> > >  src/ipa/raspberrypi/cam_helper.hpp | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp
> > > index a776153fcb84..300f8f8a2d3b 100644
> > > --- a/src/ipa/raspberrypi/cam_helper.hpp
> > > +++ b/src/ipa/raspberrypi/cam_helper.hpp
> > > @@ -76,8 +76,8 @@ public:
> > >         virtual void Prepare(libcamera::Span<const uint8_t> buffer,
> > >                              Metadata &metadata);
> > >         virtual void Process(StatisticsPtr &stats, Metadata &metadata);
> > > -       uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
> > > -       libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
> > > +       virtual uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
> > > +       virtual libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
> > >         virtual uint32_t GetVBlanking(libcamera::utils::Duration &exposure,
> > >                                       libcamera::utils::Duration minFrameDuration,
> > >                                       libcamera::utils::Duration maxFrameDuration) const;
> 
> -- 
> Regards,
> 
> Laurent Pinchart
Laurent Pinchart March 22, 2022, 11:45 p.m. UTC | #5
On Tue, Mar 22, 2022 at 11:36:23PM +0000, Kieran Bingham wrote:
> Quoting Laurent Pinchart (2022-03-22 23:25:05)
> > On Thu, Mar 17, 2022 at 11:28:01AM +0000, Kieran Bingham wrote:
> > > Quoting Laurent Pinchart (2021-12-19 23:27:12)
> > > > From: Naushir Patuck <naush@raspberrypi.com>
> > > > 
> > > > Some sensors (namely the Sony IMX296, whose support will be added
> > > > shortly) require different conversion formulas between exposure time and
> > > > exposure lines. Make the Exposure() and ExposureLines() functions
> > > > virtual to allow this.
> > > 
> > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> > 
> > Naush, could I get your SoB line for this patch ?
> 
> You have it already in
>  <CAEmqJPpcDLYRtbu0-5aYZxhn0rMgDR15PJj=i+OKr8dss8NtEw@mail.gmail.com>

Oops, sorry for the noise.

> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > ---
> > > >  src/ipa/raspberrypi/cam_helper.hpp | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp
> > > > index a776153fcb84..300f8f8a2d3b 100644
> > > > --- a/src/ipa/raspberrypi/cam_helper.hpp
> > > > +++ b/src/ipa/raspberrypi/cam_helper.hpp
> > > > @@ -76,8 +76,8 @@ public:
> > > >         virtual void Prepare(libcamera::Span<const uint8_t> buffer,
> > > >                              Metadata &metadata);
> > > >         virtual void Process(StatisticsPtr &stats, Metadata &metadata);
> > > > -       uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
> > > > -       libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
> > > > +       virtual uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
> > > > +       virtual libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
> > > >         virtual uint32_t GetVBlanking(libcamera::utils::Duration &exposure,
> > > >                                       libcamera::utils::Duration minFrameDuration,
> > > >                                       libcamera::utils::Duration maxFrameDuration) const;
Naushir Patuck March 23, 2022, 9:53 a.m. UTC | #6
On Tue, 22 Mar 2022 at 23:45, Laurent Pinchart <
laurent.pinchart@ideasonboard.com> wrote:

> On Tue, Mar 22, 2022 at 11:36:23PM +0000, Kieran Bingham wrote:
> > Quoting Laurent Pinchart (2022-03-22 23:25:05)
> > > On Thu, Mar 17, 2022 at 11:28:01AM +0000, Kieran Bingham wrote:
> > > > Quoting Laurent Pinchart (2021-12-19 23:27:12)
> > > > > From: Naushir Patuck <naush@raspberrypi.com>
> > > > >
> > > > > Some sensors (namely the Sony IMX296, whose support will be added
> > > > > shortly) require different conversion formulas between exposure
> time and
> > > > > exposure lines. Make the Exposure() and ExposureLines() functions
> > > > > virtual to allow this.
> > > >
> > > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> > >
> > > Naush, could I get your SoB line for this patch ?
> >
> > You have it already in
> >  <CAEmqJPpcDLYRtbu0-5aYZxhn0rMgDR15PJj=i+OKr8dss8NtEw@mail.gmail.com>
>
> Oops, sorry for the noise.
>

Just to confirm :)

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>


>
> > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com
> >
> > > > > ---
> > > > >  src/ipa/raspberrypi/cam_helper.hpp | 4 ++--
> > > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/src/ipa/raspberrypi/cam_helper.hpp
> b/src/ipa/raspberrypi/cam_helper.hpp
> > > > > index a776153fcb84..300f8f8a2d3b 100644
> > > > > --- a/src/ipa/raspberrypi/cam_helper.hpp
> > > > > +++ b/src/ipa/raspberrypi/cam_helper.hpp
> > > > > @@ -76,8 +76,8 @@ public:
> > > > >         virtual void Prepare(libcamera::Span<const uint8_t> buffer,
> > > > >                              Metadata &metadata);
> > > > >         virtual void Process(StatisticsPtr &stats, Metadata
> &metadata);
> > > > > -       uint32_t ExposureLines(libcamera::utils::Duration
> exposure) const;
> > > > > -       libcamera::utils::Duration Exposure(uint32_t
> exposure_lines) const;
> > > > > +       virtual uint32_t ExposureLines(libcamera::utils::Duration
> exposure) const;
> > > > > +       virtual libcamera::utils::Duration Exposure(uint32_t
> exposure_lines) const;
> > > > >         virtual uint32_t GetVBlanking(libcamera::utils::Duration
> &exposure,
> > > > >                                       libcamera::utils::Duration
> minFrameDuration,
> > > > >                                       libcamera::utils::Duration
> maxFrameDuration) const;
>
> --
> Regards,
>
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp
index a776153fcb84..300f8f8a2d3b 100644
--- a/src/ipa/raspberrypi/cam_helper.hpp
+++ b/src/ipa/raspberrypi/cam_helper.hpp
@@ -76,8 +76,8 @@  public:
 	virtual void Prepare(libcamera::Span<const uint8_t> buffer,
 			     Metadata &metadata);
 	virtual void Process(StatisticsPtr &stats, Metadata &metadata);
-	uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
-	libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
+	virtual uint32_t ExposureLines(libcamera::utils::Duration exposure) const;
+	virtual libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;
 	virtual uint32_t GetVBlanking(libcamera::utils::Duration &exposure,
 				      libcamera::utils::Duration minFrameDuration,
 				      libcamera::utils::Duration maxFrameDuration) const;