<div dir="ltr"><div dir="ltr">Hi Laurent,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 13 Mar 2021 at 20:16, 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 Sat, Mar 13, 2021 at 10:27:41AM +0000, Naushir Patuck wrote:<br>
> If the ISP::Output1 stream has not been configured, we must enable it<br>
<br>
Did you mean Output0 ?<br>
<br>
> with a default format and resolution for internal use. This is to allow<br>
> the pipeline handler data flow to be consistent, and allow the IPA to<br>
> receive statistics for the frame.<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      | 30 ++++++++++++++++++-<br>
>  1 file changed, 29 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> index 9847e926b048..5cc04ce4eb92 100644<br>
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> @@ -625,7 +625,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)<br>
>        * StreamConfiguration appropriately.<br>
>        */<br>
>       V4L2DeviceFormat format;<br>
> -     bool output1Set = false;<br>
> +     bool output0Set = false, output1Set = false;<br>
>       for (unsigned i = 0; i < config->size(); i++) {<br>
>               StreamConfiguration &cfg = config->at(i);<br>
>  <br>
> @@ -662,6 +662,34 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)<br>
>  <br>
>               if (i != maxIndex)<br>
>                       output1Set = true;<br>
> +             else<br>
> +                     output0Set = true;<br>
> +     }<br>
> +<br>
> +     /*<br>
> +      * If ISP::Output0 stream has not been configured by the application,<br>
> +      * we must allow the hardware to generate an output so that the data<br>
> +      * flow in the pipeline handler remains consistent, and we still generate<br>
> +      * statistics for the IPA to use. So enable the output at a very low<br>
> +      * resolution for internal use.<br>
> +      *<br>
> +      * \todo Allow the pipeline to work correctly without Output0 and only<br>
> +      * statistics coming from the hardware.<br>
> +      */<br>
> +     if (!output0Set) {<br>
> +             maxSize = Size(320, 240);<br>
> +             format = {};<br>
> +             format.size = maxSize;<br>
> +             format.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420, false);<br>
> +             ret = data->isp_[Isp::Output0].dev()->setFormat(&format);<br>
> +             if (ret) {<br>
> +                     LOG(RPI, Error) << "Failed to set default format on ISP Output0: "<br>
> +                                     << ret;<br>
<br>
Minor comment, to shorten the lines,<br>
<br>
                        LOG(RPI, Error)<br>
                                << "Failed to set default format on ISP Output0: "<br>
                                << ret;<br>
<br>
Reviewed-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>><br>
<br>
I'll apply this after a confirmation that the commit message should<br>
mention Ouput0.<br></blockquote><div><br></div><div>Quite right, that should be Output0.  Thank you for correcting that!</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>
> +                     return -EINVAL;<br>
> +             }<br>
> +<br>
> +             LOG(RPI, Debug) << "Defaulting ISP Output0 format to "<br>
> +                             << format.toString();<br>
>       }<br>
>  <br>
>       /*<br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div></div>