pipeline: imx8-isi: Add constexpr for maximum pipeline and resize if needed

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>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Antoine Bouyer
2025-07-01 10:58:16 +02:00
committed by Kieran Bingham
parent 21e54eff95
commit f3e8b7e538
+10 -7
View File
@@ -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();
@@ -1050,8 +1049,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);