pipeline: imx8-isi: Fix crossbar's sink pad computation

In current implementation, the sink pad counter of the crossbar is not
incremented if the pad is not connected to any subdevice. This would lead
to incorrect routing and format configuration if CSI is not connected
to first sink pad.

To avoid such issue, every sink pads must be taken into account. Then if
CSI and sensor are present, current counter is used for routing at match(),
and stored in camera data to be reused during configure().

Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com>
Tested-by: Pavel Löbl <pavel@loebl.cz>
Tested-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Antoine Bouyer
2025-08-14 17:17:35 +02:00
committed by Kieran Bingham
parent d54e5537ca
commit a139cd3803
+5 -1
View File
@@ -1039,7 +1039,7 @@ bool PipelineHandlerISI::match(DeviceEnumerator *enumerator)
for (MediaPad *pad : crossbar_->entity()->pads()) {
unsigned int sink = numSinks;
if (!(pad->flags() & MEDIA_PAD_FL_SINK) || pad->links().empty())
if (!(pad->flags() & MEDIA_PAD_FL_SINK))
continue;
/*
@@ -1048,6 +1048,9 @@ bool PipelineHandlerISI::match(DeviceEnumerator *enumerator)
*/
numSinks++;
if (pad->links().empty())
continue;
MediaEntity *csi = pad->links()[0]->source()->entity();
if (csi->pads().size() != 2) {
LOG(ISI, Debug) << "Skip unsupported CSI-2 receiver "
@@ -1082,6 +1085,7 @@ bool PipelineHandlerISI::match(DeviceEnumerator *enumerator)
LOG(ISI, Debug)
<< "cam" << numCameras
<< " streams " << data->streams_.size()
<< " sink " << data->xbarSink_
<< " offset " << data->xbarSourceOffset_;
ret = data->init();