From a139cd3803071389053af66bdea16422743a11f2 Mon Sep 17 00:00:00 2001 From: Antoine Bouyer Date: Thu, 14 Aug 2025 17:17:35 +0200 Subject: [PATCH] pipeline: imx8-isi: Fix crossbar's sink pad computation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Pavel Löbl Tested-by: Julien Vuillaumier Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp index 72e055e4..de09431c 100644 --- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp +++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp @@ -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();