<div dir="ltr"><div dir="ltr">Hi David,<div><br></div><div>Thank you for your feedback.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 22 Oct 2021 at 14:18, David Plowman <<a href="mailto:david.plowman@raspberrypi.com">david.plowman@raspberrypi.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>
Thanks for this patch.<br>
<br>
On Fri, 22 Oct 2021 at 12:55, Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>> wrote:<br>
><br>
> The unicam driver no longer regesters an embedded data node if the sensor does<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>
> Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@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 fc190e39732a..5aaf24436f27 100644<br>
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> @@ -994,7 +994,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>
> @@ -1015,9 +1014,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>
> +<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>
> @@ -1027,7 +1033,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>
> @@ -1055,6 +1060,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>
> 2.25.1<br>
><br>
<br>
I was just wondering, is there any implication for our "embedded data<br>
present" CamHelper functions? Can we now just tell, or do we still<br>
need them?<br></blockquote><div><br></div>It does make CamHelper::SensorEmbeddedDataPresent() a bit redundant.</div><div class="gmail_quote">I currently just use it to verify that both kernel and userland agree, but perhaps</div><div class="gmail_quote">I should remove that member function entirely?</div><div class="gmail_quote"><br></div><div class="gmail_quote">Regards,</div><div class="gmail_quote">Naush<br><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>
Other than this:<br>
<br>
Reviewed-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br>
<br>
Thanks!<br>
<br>
David<br>
</blockquote></div></div>