[{"id":15654,"web_url":"https://patchwork.libcamera.org/comment/15654/","msgid":"<YE0ddR6V5SzG3QQQ@pendragon.ideasonboard.com>","date":"2021-03-13T20:15:49","subject":"Re: [libcamera-devel] [PATCH 2/2] pipeline: raspberrypi: Use a\n\tdefault format for ISP::Output0","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Sat, Mar 13, 2021 at 10:27:41AM +0000, Naushir Patuck wrote:\n> If the ISP::Output1 stream has not been configured, we must enable it\n\nDid you mean Output0 ?\n\n> with a default format and resolution for internal use. This is to allow\n> the pipeline handler data flow to be consistent, and allow the IPA to\n> receive statistics for the frame.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  .../pipeline/raspberrypi/raspberrypi.cpp      | 30 ++++++++++++++++++-\n>  1 file changed, 29 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 9847e926b048..5cc04ce4eb92 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -625,7 +625,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>  \t * StreamConfiguration appropriately.\n>  \t */\n>  \tV4L2DeviceFormat format;\n> -\tbool output1Set = false;\n> +\tbool output0Set = false, output1Set = false;\n>  \tfor (unsigned i = 0; i < config->size(); i++) {\n>  \t\tStreamConfiguration &cfg = config->at(i);\n>  \n> @@ -662,6 +662,34 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>  \n>  \t\tif (i != maxIndex)\n>  \t\t\toutput1Set = true;\n> +\t\telse\n> +\t\t\toutput0Set = true;\n> +\t}\n> +\n> +\t/*\n> +\t * If ISP::Output0 stream has not been configured by the application,\n> +\t * we must allow the hardware to generate an output so that the data\n> +\t * flow in the pipeline handler remains consistent, and we still generate\n> +\t * statistics for the IPA to use. So enable the output at a very low\n> +\t * resolution for internal use.\n> +\t *\n> +\t * \\todo Allow the pipeline to work correctly without Output0 and only\n> +\t * statistics coming from the hardware.\n> +\t */\n> +\tif (!output0Set) {\n> +\t\tmaxSize = Size(320, 240);\n> +\t\tformat = {};\n> +\t\tformat.size = maxSize;\n> +\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420, false);\n> +\t\tret = data->isp_[Isp::Output0].dev()->setFormat(&format);\n> +\t\tif (ret) {\n> +\t\t\tLOG(RPI, Error) << \"Failed to set default format on ISP Output0: \"\n> +\t\t\t\t\t<< ret;\n\nMinor comment, to shorten the lines,\n\n\t\t\tLOG(RPI, Error)\n\t\t\t\t<< \"Failed to set default format on ISP Output0: \"\n\t\t\t\t<< ret;\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nI'll apply this after a confirmation that the commit message should\nmention Ouput0.\n\n> +\t\t\treturn -EINVAL;\n> +\t\t}\n> +\n> +\t\tLOG(RPI, Debug) << \"Defaulting ISP Output0 format to \"\n> +\t\t\t\t<< format.toString();\n>  \t}\n>  \n>  \t/*","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4DFA5BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 13 Mar 2021 20:16:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C95766084F;\n\tSat, 13 Mar 2021 21:16:25 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 18DAD605B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 21:16:25 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8A9B13F0;\n\tSat, 13 Mar 2021 21:16:24 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hvUya27H\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1615666584;\n\tbh=EXk/ODrKZLVEsyiAJKdqIW9LkQiPtLFuVIjqlp54rYo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=hvUya27HrniuXwzuJQUQ2reeau0YbbLTSzVsK4zfKH3nPeDSNq+AyqB3o5en2Wtxm\n\twWE1tdIu4s0Uk9jWZyDRsYLFNRDw2k4RlB4zELXd7Vnm5BhXYAP+y2R3LeVWC6eNnI\n\tdq8VxXNvD4uLclwf+f7jftAv0JXeBWzHu1SKGGYw=","Date":"Sat, 13 Mar 2021 22:15:49 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YE0ddR6V5SzG3QQQ@pendragon.ideasonboard.com>","References":"<20210313102741.2890809-1-naush@raspberrypi.com>\n\t<20210313102741.2890809-3-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210313102741.2890809-3-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 2/2] pipeline: raspberrypi: Use a\n\tdefault format for ISP::Output0","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":15658,"web_url":"https://patchwork.libcamera.org/comment/15658/","msgid":"<CAEmqJPq1LO=TE6eWTvgaGVJUNwNSMhS1D8x0buGLUcDdhf2raA@mail.gmail.com>","date":"2021-03-13T21:58:43","subject":"Re: [libcamera-devel] [PATCH 2/2] pipeline: raspberrypi: Use a\n\tdefault format for ISP::Output0","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Laurent,\n\nOn Sat, 13 Mar 2021 at 20:16, Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Naush,\n>\n> Thank you for the patch.\n>\n> On Sat, Mar 13, 2021 at 10:27:41AM +0000, Naushir Patuck wrote:\n> > If the ISP::Output1 stream has not been configured, we must enable it\n>\n> Did you mean Output0 ?\n>\n> > with a default format and resolution for internal use. This is to allow\n> > the pipeline handler data flow to be consistent, and allow the IPA to\n> > receive statistics for the frame.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  .../pipeline/raspberrypi/raspberrypi.cpp      | 30 ++++++++++++++++++-\n> >  1 file changed, 29 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index 9847e926b048..5cc04ce4eb92 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -625,7 +625,7 @@ int PipelineHandlerRPi::configure(Camera *camera,\n> CameraConfiguration *config)\n> >        * StreamConfiguration appropriately.\n> >        */\n> >       V4L2DeviceFormat format;\n> > -     bool output1Set = false;\n> > +     bool output0Set = false, output1Set = false;\n> >       for (unsigned i = 0; i < config->size(); i++) {\n> >               StreamConfiguration &cfg = config->at(i);\n> >\n> > @@ -662,6 +662,34 @@ int PipelineHandlerRPi::configure(Camera *camera,\n> CameraConfiguration *config)\n> >\n> >               if (i != maxIndex)\n> >                       output1Set = true;\n> > +             else\n> > +                     output0Set = true;\n> > +     }\n> > +\n> > +     /*\n> > +      * If ISP::Output0 stream has not been configured by the\n> application,\n> > +      * we must allow the hardware to generate an output so that the\n> data\n> > +      * flow in the pipeline handler remains consistent, and we still\n> generate\n> > +      * statistics for the IPA to use. So enable the output at a very\n> low\n> > +      * resolution for internal use.\n> > +      *\n> > +      * \\todo Allow the pipeline to work correctly without Output0 and\n> only\n> > +      * statistics coming from the hardware.\n> > +      */\n> > +     if (!output0Set) {\n> > +             maxSize = Size(320, 240);\n> > +             format = {};\n> > +             format.size = maxSize;\n> > +             format.fourcc =\n> V4L2PixelFormat::fromPixelFormat(formats::YUV420, false);\n> > +             ret = data->isp_[Isp::Output0].dev()->setFormat(&format);\n> > +             if (ret) {\n> > +                     LOG(RPI, Error) << \"Failed to set default format\n> on ISP Output0: \"\n> > +                                     << ret;\n>\n> Minor comment, to shorten the lines,\n>\n>                         LOG(RPI, Error)\n>                                 << \"Failed to set default format on ISP\n> Output0: \"\n>                                 << ret;\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> I'll apply this after a confirmation that the commit message should\n> mention Ouput0.\n>\n\nQuite right, that should be Output0.  Thank you for correcting that!\n\nRegards,\nNaush\n\n\n>\n> > +                     return -EINVAL;\n> > +             }\n> > +\n> > +             LOG(RPI, Debug) << \"Defaulting ISP Output0 format to \"\n> > +                             << format.toString();\n> >       }\n> >\n> >       /*\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A6602BD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 13 Mar 2021 21:59:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19A1A6084F;\n\tSat, 13 Mar 2021 22:59:03 +0100 (CET)","from mail-lj1-x236.google.com (mail-lj1-x236.google.com\n\t[IPv6:2a00:1450:4864:20::236])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0773F605B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 22:59:01 +0100 (CET)","by mail-lj1-x236.google.com with SMTP id z8so11768934ljm.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 13:59:00 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"pc66T07J\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=PTK4mmcPj4ICLHB/Y05BYPyUbc8AuN1p0bCVo1pH11s=;\n\tb=pc66T07JkENmAj0R5DLt4v+n7w+8EASxjmBeXtc7WzftO3G2urprTOXwWsT+3Bq43f\n\ta/8cmwYDnfv7/gbuiz02sSgsTrGB4OHrwQLreI5OlNkmbgEr6FgxHU60UzVqYAKZge02\n\tbMe/g5c2sOHLwvd4Je7cGtaX9MWyUsxHqbnfTSHVYt7uVBUY37TRBKvExaNZLTWo3WVb\n\tX+LkzlkFSp44WZ4+IcdjWINzRYmzgvTiyS7OhZPvu6mqgUIclzFNeoUL3UoOtxC2RQeA\n\tNKLjvJOXRzE0Xj9czuLmYPxMqwQ9VNXG80rO2h3sRpb/gx/MKvNSCEwab+c1exLXcSGO\n\tz4Xg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=PTK4mmcPj4ICLHB/Y05BYPyUbc8AuN1p0bCVo1pH11s=;\n\tb=H7+FPoqa4Ax9iWG8JpNthLb5UalOKDEQ4BGUwk+CbPegdOvU3nw9bJFDHzCOdAlGLZ\n\thjx9cb/IG52NG4mu+rsmZMXPm+lBY611VRJ5/A2Ltv8lT19fzfVHAG9kiQ/wN5BlOdgK\n\tze6qBjgE+FUwycEXOu2S/AfB/q5Q1yymJRTdp8ZBv8yQmAANaJBm0FZ/hykmjU4Z1Xdk\n\tdtAPDoNEdJxdtWp3XEgZYpRLhEc7kKL97lby9MpovPZFhTitX93LfM/RCjGIsVO8+Fu8\n\ta6zpraBvHQ1ed4Y8U+TvWwSu8WVYhvb1/DR76iHKPMv7+TAJgB790Fbjk/cfZYUspSmH\n\tZJkQ==","X-Gm-Message-State":"AOAM532Nq2SRy9qSFbMj8Jd97P8PkQfK62aEemNb+jNEkV7NCi7dREpO\n\tHu/vx/GoBz69h52mKwgWZ1UDiPl2up0Ik2ZFtpdC3gctbHI=","X-Google-Smtp-Source":"ABdhPJyM8D+GSztGQxdJytK5j1QRVJSpvtBavZk6fhtV4jP49vl3eRUgmZeQ/vEzSPcvXcvDGdE9CtQ46X3XKurkYA8=","X-Received":"by 2002:a2e:9b10:: with SMTP id\n\tu16mr5971134lji.253.1615672740209; \n\tSat, 13 Mar 2021 13:59:00 -0800 (PST)","MIME-Version":"1.0","References":"<20210313102741.2890809-1-naush@raspberrypi.com>\n\t<20210313102741.2890809-3-naush@raspberrypi.com>\n\t<YE0ddR6V5SzG3QQQ@pendragon.ideasonboard.com>","In-Reply-To":"<YE0ddR6V5SzG3QQQ@pendragon.ideasonboard.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Sat, 13 Mar 2021 21:58:43 +0000","Message-ID":"<CAEmqJPq1LO=TE6eWTvgaGVJUNwNSMhS1D8x0buGLUcDdhf2raA@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 2/2] pipeline: raspberrypi: Use a\n\tdefault format for ISP::Output0","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"multipart/mixed;\n\tboundary=\"===============2279958429508229605==\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]