<div dir="ltr"><div dir="ltr">Hi Laurent,<div><br></div><div>Thank you for your feedback.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 25 Oct 2021 at 18:04, Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Naush,<br>
<br>
Thank you for the patch.<br>
<br>
On Fri, Oct 22, 2021 at 03:39:06PM +0100, Naushir Patuck wrote:<br>
> The unicam driver no longer regesters an embedded data node if the sensor does<br>
<br>
s/regesters/registers/<br>
<br>
> not provide this stream. Account for this in the pipeline handler match routine<br>
> by not assuming it is always present.<br>
> <br>
> Add a warning if Unicam and the CamHelper do not agree on the presense of sensor<br>
> embedded data, and disable its useage in these cases.<br>
<br>
s/useage/usage/<br>
<br>
> <br>
> Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
> Review-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br>
> ---<br>
> .../pipeline/raspberrypi/raspberrypi.cpp | 16 +++++++++++++---<br>
> 1 file changed, 13 insertions(+), 3 deletions(-)<br>
> <br>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> index 2b70b877e70a..c5e9607c7d95 100644<br>
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> @@ -984,7 +984,6 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)<br>
> DeviceMatch unicam("unicam");<br>
> DeviceMatch isp("bcm2835-isp");<br>
> <br>
> - unicam.add("unicam-embedded");<br>
> unicam.add("unicam-image");<br>
> <br>
> isp.add("bcm2835-isp0-output0"); /* Input */<br>
> @@ -1005,9 +1004,16 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)<br>
> return false;<br>
> <br>
> /* Locate and open the unicam video streams. */<br>
> - data->unicam_[Unicam::Embedded] = RPi::Stream("Unicam Embedded", unicam_->getEntityByName("unicam-embedded"));<br>
> data->unicam_[Unicam::Image] = RPi::Stream("Unicam Image", unicam_->getEntityByName("unicam-image"));<br>
> <br>
> + /* An embedded data node will not be present if the sensor does not support it. */<br>
> + MediaEntity *embeddedEntity = unicam_->getEntityByName("unicam-embedded");<br>
> + if (embeddedEntity) {<br>
> + data->unicam_[Unicam::Embedded] = RPi::Stream("Unicam Embedded", embeddedEntity);<br>
> + data->unicam_[Unicam::Embedded].dev()->bufferReady.connect(data.get(),<br>
> + &RPiCameraData::unicamBufferDequeue);<br>
<br>
It would be nice to keep signal connection uniform, but that's no big<br>
deal.<br></blockquote><div><br></div><div>Not sure I understand here. If the embedded node is absent in cases where the sensor</div><div>does not support it, data->unicam_[Unicam::Embedded].dev() will not be valid, so cannot</div><div>connect to anything?</div><div><br></div><div>Regards,</div><div>Naush</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Reviewed-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>><br>
<br>
> + }<br>
> +<br>
> /* Tag the ISP input stream as an import stream. */<br>
> data->isp_[Isp::Input] = RPi::Stream("ISP Input", isp_->getEntityByName("bcm2835-isp0-output0"), true);<br>
> data->isp_[Isp::Output0] = RPi::Stream("ISP Output0", isp_->getEntityByName("bcm2835-isp0-capture1"));<br>
> @@ -1017,7 +1023,6 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)<br>
> /* Wire up all the buffer connections. */<br>
> data->unicam_[Unicam::Image].dev()->frameStart.connect(data.get(), &RPiCameraData::frameStarted);<br>
> data->unicam_[Unicam::Image].dev()->bufferReady.connect(data.get(), &RPiCameraData::unicamBufferDequeue);<br>
> - data->unicam_[Unicam::Embedded].dev()->bufferReady.connect(data.get(), &RPiCameraData::unicamBufferDequeue);<br>
> data->isp_[Isp::Input].dev()->bufferReady.connect(data.get(), &RPiCameraData::ispInputDequeue);<br>
> data->isp_[Isp::Output0].dev()->bufferReady.connect(data.get(), &RPiCameraData::ispOutputDequeue);<br>
> data->isp_[Isp::Output1].dev()->bufferReady.connect(data.get(), &RPiCameraData::ispOutputDequeue);<br>
> @@ -1045,6 +1050,11 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)<br>
> return false;<br>
> }<br>
> <br>
> + if (sensorConfig.sensorMetadata ^ !!embeddedEntity) {<br>
> + LOG(RPI, Warning) << "Mismatch between Unicam and CamHelper for embedded data usage!";<br>
> + sensorConfig.sensorMetadata = false;<br>
> + }<br>
> +<br>
> /*<br>
> * Open all Unicam and ISP streams. The exception is the embedded data<br>
> * stream, which only gets opened below if the IPA reports that the sensor<br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div></div>