Message ID | 20210312130304.34698-3-jeanmichel.hautbois@ideasonboard.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi JM, On 12/03/2021 13:03, Jean-Michel Hautbois wrote: > The IPU3 IPA will need the BDS configuration when the AWB/AGC algorithm > will be integrated. > In order to do that, the configure() interface needs to be modified. > Do you envisage needing to send more stream configuration parameters into the IPA? I wonder if we should have a struct to send more stream parameters in, but we can always change that if we get more. > Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> > --- > include/libcamera/ipa/ipu3.mojom | 2 +- > src/ipa/ipu3/ipu3.cpp | 7 +++++-- > src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +++- > 3 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom > index 6ee11333..71b61c60 100644 > --- a/include/libcamera/ipa/ipu3.mojom > +++ b/include/libcamera/ipa/ipu3.mojom > @@ -30,7 +30,7 @@ interface IPAIPU3Interface { > start() => (int32 ret); > stop(); > > - configure(map<uint32, ControlInfoMap> entityControls) => (); > + configure(map<uint32, ControlInfoMap> entityControls, Rectangle bds) => (); > > mapBuffers(array<IPABuffer> buffers); > unmapBuffers(array<uint32> ids); > diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp > index b63e58be..4bce5c27 100644 > --- a/src/ipa/ipu3/ipu3.cpp > +++ b/src/ipa/ipu3/ipu3.cpp > @@ -35,7 +35,9 @@ public: > int start() override { return 0; } > void stop() override {} > > - void configure(const std::map<uint32_t, ControlInfoMap> &entityControls) override; > + void configure( > + const std::map<uint32_t, ControlInfoMap> &entityControls, > + const Rectangle &bds) override; > > void mapBuffers(const std::vector<IPABuffer> &buffers) override; > void unmapBuffers(const std::vector<unsigned int> &ids) override; > @@ -62,7 +64,8 @@ private: > uint32_t maxGain_; > }; > > -void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls) > +void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls, > + [[maybe_unused]] const Rectangle &bds) > { > if (entityControls.empty()) > return; > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp > index 0d133031..4958d2fe 100644 > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp > @@ -722,6 +722,7 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis > IPU3CameraData *data = cameraData(camera); > CIO2Device *cio2 = &data->cio2_; > ImgUDevice *imgu = data->imgu_; > + Rectangle bds{ 0, 0, data->pipeConfig_.bds }; > int ret; > > /* Allocate buffers for internal pipeline usage. */ > @@ -746,7 +747,8 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis > goto error; > > entityControls.emplace(0, data->cio2_.sensor()->controls()); > - data->ipa_->configure(entityControls); > + > + data->ipa_->configure(entityControls, bds); > > return 0; > >
Hello Kieran, On 12/03/2021 14:42, Kieran Bingham wrote: > Hi JM, > > On 12/03/2021 13:03, Jean-Michel Hautbois wrote: >> The IPU3 IPA will need the BDS configuration when the AWB/AGC algorithm >> will be integrated. >> In order to do that, the configure() interface needs to be modified. >> > > Do you envisage needing to send more stream configuration parameters > into the IPA? > > I wonder if we should have a struct to send more stream parameters in, > but we can always change that if we get more. I don't think it will be needed, as the parameters are really at the BDS stage. That's why I selected the bds Rectangle only :-). > >> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> >> --- >> include/libcamera/ipa/ipu3.mojom | 2 +- >> src/ipa/ipu3/ipu3.cpp | 7 +++++-- >> src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +++- >> 3 files changed, 9 insertions(+), 4 deletions(-) >> >> diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom >> index 6ee11333..71b61c60 100644 >> --- a/include/libcamera/ipa/ipu3.mojom >> +++ b/include/libcamera/ipa/ipu3.mojom >> @@ -30,7 +30,7 @@ interface IPAIPU3Interface { >> start() => (int32 ret); >> stop(); >> >> - configure(map<uint32, ControlInfoMap> entityControls) => (); >> + configure(map<uint32, ControlInfoMap> entityControls, Rectangle bds) => (); >> >> mapBuffers(array<IPABuffer> buffers); >> unmapBuffers(array<uint32> ids); >> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp >> index b63e58be..4bce5c27 100644 >> --- a/src/ipa/ipu3/ipu3.cpp >> +++ b/src/ipa/ipu3/ipu3.cpp >> @@ -35,7 +35,9 @@ public: >> int start() override { return 0; } >> void stop() override {} >> >> - void configure(const std::map<uint32_t, ControlInfoMap> &entityControls) override; >> + void configure( >> + const std::map<uint32_t, ControlInfoMap> &entityControls, >> + const Rectangle &bds) override; >> >> void mapBuffers(const std::vector<IPABuffer> &buffers) override; >> void unmapBuffers(const std::vector<unsigned int> &ids) override; >> @@ -62,7 +64,8 @@ private: >> uint32_t maxGain_; >> }; >> >> -void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls) >> +void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls, >> + [[maybe_unused]] const Rectangle &bds) >> { >> if (entityControls.empty()) >> return; >> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp >> index 0d133031..4958d2fe 100644 >> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp >> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp >> @@ -722,6 +722,7 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis >> IPU3CameraData *data = cameraData(camera); >> CIO2Device *cio2 = &data->cio2_; >> ImgUDevice *imgu = data->imgu_; >> + Rectangle bds{ 0, 0, data->pipeConfig_.bds }; >> int ret; >> >> /* Allocate buffers for internal pipeline usage. */ >> @@ -746,7 +747,8 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis >> goto error; >> >> entityControls.emplace(0, data->cio2_.sensor()->controls()); >> - data->ipa_->configure(entityControls); >> + >> + data->ipa_->configure(entityControls, bds); >> >> return 0; >> >> >
Hi Jean-Micheal, On Fri, Mar 12, 2021 at 02:03:04PM +0100, Jean-Michel Hautbois wrote: > The IPU3 IPA will need the BDS configuration when the AWB/AGC algorithm > will be integrated. > In order to do that, the configure() interface needs to be modified. Only BDS should be passed to the IPA, or should the whole pipe configuration ? True that, when runnin over IPC, the less data are exchanged the better.. > > Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> > --- > include/libcamera/ipa/ipu3.mojom | 2 +- > src/ipa/ipu3/ipu3.cpp | 7 +++++-- > src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +++- > 3 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom > index 6ee11333..71b61c60 100644 > --- a/include/libcamera/ipa/ipu3.mojom > +++ b/include/libcamera/ipa/ipu3.mojom > @@ -30,7 +30,7 @@ interface IPAIPU3Interface { > start() => (int32 ret); > stop(); > > - configure(map<uint32, ControlInfoMap> entityControls) => (); > + configure(map<uint32, ControlInfoMap> entityControls, Rectangle bds) => (); > > mapBuffers(array<IPABuffer> buffers); > unmapBuffers(array<uint32> ids); > diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp > index b63e58be..4bce5c27 100644 > --- a/src/ipa/ipu3/ipu3.cpp > +++ b/src/ipa/ipu3/ipu3.cpp > @@ -35,7 +35,9 @@ public: > int start() override { return 0; } > void stop() override {} > > - void configure(const std::map<uint32_t, ControlInfoMap> &entityControls) override; > + void configure( > + const std::map<uint32_t, ControlInfoMap> &entityControls, > + const Rectangle &bds) override; > > void mapBuffers(const std::vector<IPABuffer> &buffers) override; > void unmapBuffers(const std::vector<unsigned int> &ids) override; > @@ -62,7 +64,8 @@ private: > uint32_t maxGain_; > }; > > -void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls) > +void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls, > + [[maybe_unused]] const Rectangle &bds) > { > if (entityControls.empty()) > return; > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp > index 0d133031..4958d2fe 100644 > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp > @@ -722,6 +722,7 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis > IPU3CameraData *data = cameraData(camera); > CIO2Device *cio2 = &data->cio2_; > ImgUDevice *imgu = data->imgu_; > + Rectangle bds{ 0, 0, data->pipeConfig_.bds }; > int ret; > > /* Allocate buffers for internal pipeline usage. */ > @@ -746,7 +747,8 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis > goto error; > > entityControls.emplace(0, data->cio2_.sensor()->controls()); > - data->ipa_->configure(entityControls); > + Intentional empty line ? Thanks j > + data->ipa_->configure(entityControls, bds); > > return 0; > > -- > 2.27.0 > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
Hi again, On Sat, Mar 13, 2021 at 09:32:35AM +0100, Jacopo Mondi wrote: > Hi Jean-Micheal, > > On Fri, Mar 12, 2021 at 02:03:04PM +0100, Jean-Michel Hautbois wrote: > > The IPU3 IPA will need the BDS configuration when the AWB/AGC algorithm > > will be integrated. > > In order to do that, the configure() interface needs to be modified. > > Only BDS should be passed to the IPA, or should the whole pipe > configuration ? True that, when runnin over IPC, the less data are > exchanged the better.. > I've just noticed Kieran had the same question and you replied already. Anyway, it will be trivial to pass the rest of the pipe config if needed. Please add Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Thanks j > > > > Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> > > --- > > include/libcamera/ipa/ipu3.mojom | 2 +- > > src/ipa/ipu3/ipu3.cpp | 7 +++++-- > > src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +++- > > 3 files changed, 9 insertions(+), 4 deletions(-) > > > > diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom > > index 6ee11333..71b61c60 100644 > > --- a/include/libcamera/ipa/ipu3.mojom > > +++ b/include/libcamera/ipa/ipu3.mojom > > @@ -30,7 +30,7 @@ interface IPAIPU3Interface { > > start() => (int32 ret); > > stop(); > > > > - configure(map<uint32, ControlInfoMap> entityControls) => (); > > + configure(map<uint32, ControlInfoMap> entityControls, Rectangle bds) => (); > > > > mapBuffers(array<IPABuffer> buffers); > > unmapBuffers(array<uint32> ids); > > diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp > > index b63e58be..4bce5c27 100644 > > --- a/src/ipa/ipu3/ipu3.cpp > > +++ b/src/ipa/ipu3/ipu3.cpp > > @@ -35,7 +35,9 @@ public: > > int start() override { return 0; } > > void stop() override {} > > > > - void configure(const std::map<uint32_t, ControlInfoMap> &entityControls) override; > > + void configure( > > + const std::map<uint32_t, ControlInfoMap> &entityControls, > > + const Rectangle &bds) override; > > > > void mapBuffers(const std::vector<IPABuffer> &buffers) override; > > void unmapBuffers(const std::vector<unsigned int> &ids) override; > > @@ -62,7 +64,8 @@ private: > > uint32_t maxGain_; > > }; > > > > -void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls) > > +void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls, > > + [[maybe_unused]] const Rectangle &bds) > > { > > if (entityControls.empty()) > > return; > > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp > > index 0d133031..4958d2fe 100644 > > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp > > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp > > @@ -722,6 +722,7 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis > > IPU3CameraData *data = cameraData(camera); > > CIO2Device *cio2 = &data->cio2_; > > ImgUDevice *imgu = data->imgu_; > > + Rectangle bds{ 0, 0, data->pipeConfig_.bds }; > > int ret; > > > > /* Allocate buffers for internal pipeline usage. */ > > @@ -746,7 +747,8 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis > > goto error; > > > > entityControls.emplace(0, data->cio2_.sensor()->controls()); > > - data->ipa_->configure(entityControls); > > + > > Intentional empty line ? > > Thanks > j > > > + data->ipa_->configure(entityControls, bds); > > > > return 0; > > > > -- > > 2.27.0 > > > > _______________________________________________ > > libcamera-devel mailing list > > libcamera-devel@lists.libcamera.org > > https://lists.libcamera.org/listinfo/libcamera-devel > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
Hi Jean-Michel, Thank you for the patch. On Fri, Mar 12, 2021 at 02:03:04PM +0100, Jean-Michel Hautbois wrote: > The IPU3 IPA will need the BDS configuration when the AWB/AGC algorithm > will be integrated. > In order to do that, the configure() interface needs to be modified. > > Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> > --- > include/libcamera/ipa/ipu3.mojom | 2 +- > src/ipa/ipu3/ipu3.cpp | 7 +++++-- > src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +++- > 3 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom > index 6ee11333..71b61c60 100644 > --- a/include/libcamera/ipa/ipu3.mojom > +++ b/include/libcamera/ipa/ipu3.mojom > @@ -30,7 +30,7 @@ interface IPAIPU3Interface { > start() => (int32 ret); > stop(); > > - configure(map<uint32, ControlInfoMap> entityControls) => (); > + configure(map<uint32, ControlInfoMap> entityControls, Rectangle bds) => (); bds stands for Bayer Down Scaler if I'm not mistaken. What is this rectangle ? Is it the input size to the BDS, the input crop rectangle, the output crop rectangle, the output size, or something else ? Naming the variable accordingly would be more readable. > > mapBuffers(array<IPABuffer> buffers); > unmapBuffers(array<uint32> ids); > diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp > index b63e58be..4bce5c27 100644 > --- a/src/ipa/ipu3/ipu3.cpp > +++ b/src/ipa/ipu3/ipu3.cpp > @@ -35,7 +35,9 @@ public: > int start() override { return 0; } > void stop() override {} > > - void configure(const std::map<uint32_t, ControlInfoMap> &entityControls) override; > + void configure( > + const std::map<uint32_t, ControlInfoMap> &entityControls, > + const Rectangle &bds) override; > > void mapBuffers(const std::vector<IPABuffer> &buffers) override; > void unmapBuffers(const std::vector<unsigned int> &ids) override; > @@ -62,7 +64,8 @@ private: > uint32_t maxGain_; > }; > > -void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls) > +void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls, > + [[maybe_unused]] const Rectangle &bds) > { > if (entityControls.empty()) > return; > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp > index 0d133031..4958d2fe 100644 > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp > @@ -722,6 +722,7 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis > IPU3CameraData *data = cameraData(camera); > CIO2Device *cio2 = &data->cio2_; > ImgUDevice *imgu = data->imgu_; > + Rectangle bds{ 0, 0, data->pipeConfig_.bds }; > int ret; > > /* Allocate buffers for internal pipeline usage. */ > @@ -746,7 +747,8 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis > goto error; > > entityControls.emplace(0, data->cio2_.sensor()->controls()); > - data->ipa_->configure(entityControls); > + You can move the bds variable declaration right here. > + data->ipa_->configure(entityControls, bds); With these two comments addressed, Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > return 0; >
diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom index 6ee11333..71b61c60 100644 --- a/include/libcamera/ipa/ipu3.mojom +++ b/include/libcamera/ipa/ipu3.mojom @@ -30,7 +30,7 @@ interface IPAIPU3Interface { start() => (int32 ret); stop(); - configure(map<uint32, ControlInfoMap> entityControls) => (); + configure(map<uint32, ControlInfoMap> entityControls, Rectangle bds) => (); mapBuffers(array<IPABuffer> buffers); unmapBuffers(array<uint32> ids); diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index b63e58be..4bce5c27 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -35,7 +35,9 @@ public: int start() override { return 0; } void stop() override {} - void configure(const std::map<uint32_t, ControlInfoMap> &entityControls) override; + void configure( + const std::map<uint32_t, ControlInfoMap> &entityControls, + const Rectangle &bds) override; void mapBuffers(const std::vector<IPABuffer> &buffers) override; void unmapBuffers(const std::vector<unsigned int> &ids) override; @@ -62,7 +64,8 @@ private: uint32_t maxGain_; }; -void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls) +void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls, + [[maybe_unused]] const Rectangle &bds) { if (entityControls.empty()) return; diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 0d133031..4958d2fe 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -722,6 +722,7 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis IPU3CameraData *data = cameraData(camera); CIO2Device *cio2 = &data->cio2_; ImgUDevice *imgu = data->imgu_; + Rectangle bds{ 0, 0, data->pipeConfig_.bds }; int ret; /* Allocate buffers for internal pipeline usage. */ @@ -746,7 +747,8 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis goto error; entityControls.emplace(0, data->cio2_.sensor()->controls()); - data->ipa_->configure(entityControls); + + data->ipa_->configure(entityControls, bds); return 0;
The IPU3 IPA will need the BDS configuration when the AWB/AGC algorithm will be integrated. In order to do that, the configure() interface needs to be modified. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> --- include/libcamera/ipa/ipu3.mojom | 2 +- src/ipa/ipu3/ipu3.cpp | 7 +++++-- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-)