Message ID | 20250618124541.2340270-2-antoine.bouyer@nxp.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
Hi Antoine, Thank you for the patch. On Wed, Jun 18, 2025 at 02:45:40PM +0200, Antoine Bouyer wrote: > This patch adds number of streams per camera as constructor parameter, and > limits stream count to 3. Some applications may need up to 3 streams for > preview + capture + video record. Currently, imx8-isi pipeline only supports > up to 2. Increase constant parameter to 3 to match these applications' > requirements. > > Minimum value between default value 3, and total amount of ISI's pipes is > now applied. For SOCs which only have 1 ISI pipe (ie i.MX93), available > stream count becomes 1. > > Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> I gave a R-b tag on v1 of this patch. For future patch series, please collect the tags you receive, and include them in new versions. > --- > src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp > index ecda426a6021..186b623df186 100644 > --- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp > +++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp > @@ -40,14 +40,13 @@ class PipelineHandlerISI; > class ISICameraData : public Camera::Private > { > public: > - ISICameraData(PipelineHandler *ph) > + /* Maximum amount of streams (i.e. pipes) per camera. */ > + static constexpr unsigned int kNumStreams = 3; > + > + ISICameraData(PipelineHandler *ph, unsigned int numStreams) > : Camera::Private(ph) > { > - /* > - * \todo Assume 2 channels only for now, as that's the number of > - * available channels on i.MX8MP. > - */ > - streams_.resize(2); > + streams_.resize(std::min(kNumStreams, numStreams)); > } > > PipelineHandlerISI *pipe(); > @@ -1052,8 +1051,12 @@ bool PipelineHandlerISI::match(DeviceEnumerator *enumerator) > } > > /* Create the camera data. */ > + /* > + * \todo compute available pipes per camera instead of using > + * pipes_.size() for multi cameras case. > + */ > std::unique_ptr<ISICameraData> data = > - std::make_unique<ISICameraData>(this); > + std::make_unique<ISICameraData>(this, pipes_.size()); > > data->sensor_ = CameraSensorFactoryBase::create(sensor); > data->csis_ = std::make_unique<V4L2Subdevice>(csi);
diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp index ecda426a6021..186b623df186 100644 --- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp +++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp @@ -40,14 +40,13 @@ class PipelineHandlerISI; class ISICameraData : public Camera::Private { public: - ISICameraData(PipelineHandler *ph) + /* Maximum amount of streams (i.e. pipes) per camera. */ + static constexpr unsigned int kNumStreams = 3; + + ISICameraData(PipelineHandler *ph, unsigned int numStreams) : Camera::Private(ph) { - /* - * \todo Assume 2 channels only for now, as that's the number of - * available channels on i.MX8MP. - */ - streams_.resize(2); + streams_.resize(std::min(kNumStreams, numStreams)); } PipelineHandlerISI *pipe(); @@ -1052,8 +1051,12 @@ bool PipelineHandlerISI::match(DeviceEnumerator *enumerator) } /* Create the camera data. */ + /* + * \todo compute available pipes per camera instead of using + * pipes_.size() for multi cameras case. + */ std::unique_ptr<ISICameraData> data = - std::make_unique<ISICameraData>(this); + std::make_unique<ISICameraData>(this, pipes_.size()); data->sensor_ = CameraSensorFactoryBase::create(sensor); data->csis_ = std::make_unique<V4L2Subdevice>(csi);
This patch adds number of streams per camera as constructor parameter, and limits stream count to 3. Some applications may need up to 3 streams for preview + capture + video record. Currently, imx8-isi pipeline only supports up to 2. Increase constant parameter to 3 to match these applications' requirements. Minimum value between default value 3, and total amount of ISI's pipes is now applied. For SOCs which only have 1 ISI pipe (ie i.MX93), available stream count becomes 1. Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com> --- src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)