[{"id":11195,"web_url":"https://patchwork.libcamera.org/comment/11195/","msgid":"<20200706090010.onviuc72s5tgca4m@uno.localdomain>","date":"2020-07-06T09:00:10","subject":"Re: [libcamera-devel] [PATCH v2 07/12] libcamera: pipeline:\n\traspberrypi: Don't call handleState() in stop state","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Sat, Jul 04, 2020 at 03:52:22AM +0300, Laurent Pinchart wrote:\n> The handleState() function is a no-op when the state is State::Stopped.\n> Don't call it in that case, which simplifies the caller.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 ++++-----\n>  1 file changed, 4 insertions(+), 5 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index a05fc68b98fa..74bee6895dcd 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1188,7 +1188,7 @@ void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData\n>  \t\tControlList controls = action.controls[0];\n>  \t\tif (!staggeredCtrl_.set(controls))\n>  \t\t\tLOG(RPI, Error) << \"V4L2 staggered set failed\";\n> -\t\tgoto done;\n> +\t\treturn;\n>  \t}\n>\n>  \tcase RPI_IPA_ACTION_SET_SENSOR_CONFIG: {\n> @@ -1206,18 +1206,18 @@ void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData\n>  \t\t/* Set the sensor orientation here as well. */\n>  \t\tControlList controls = action.controls[0];\n>  \t\tunicam_[Unicam::Image].dev()->setControls(&controls);\n> -\t\tgoto done;\n> +\t\treturn;\n>  \t}\n>\n>  \tcase RPI_IPA_ACTION_V4L2_SET_ISP: {\n>  \t\tControlList controls = action.controls[0];\n>  \t\tisp_[Isp::Input].dev()->setControls(&controls);\n> -\t\tgoto done;\n> +\t\treturn;\n\nI'm sure I don't fully understand the IPA protocol for this device,\nbut the comment says this operation *can* be handled with the IPA in\nstopped state, not that the stop state is required. Furthermore, the\nnext switch block says the there handled operation *must not* be handled\nin stopped state, which makes me think these ones can but don't\nrequire to.\n\n\n>  \t}\n>  \t}\n>\n>  \tif (state_ == State::Stopped)\n> -\t\tgoto done;\n> +\t\treturn;\n\nThis, instead, is crystal clear :)\n\n>\n>  \t/*\n>  \t * The following actions must not be handled when the pipeline handler\n> @@ -1261,7 +1261,6 @@ void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData\n>  \t\tbreak;\n>  \t}\n>\n> -done:\n>  \thandleState();\n>  }\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 837A0BD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jul 2020 08:56:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5D9A060E05;\n\tMon,  6 Jul 2020 10:56:39 +0200 (CEST)","from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 69D7E60E01\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jul 2020 10:56:37 +0200 (CEST)","from uno.localdomain (host-79-34-235-173.business.telecomitalia.it\n\t[79.34.235.173]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id BCA466000E;\n\tMon,  6 Jul 2020 08:56:36 +0000 (UTC)"],"X-Originating-IP":"79.34.235.173","Date":"Mon, 6 Jul 2020 11:00:10 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20200706090010.onviuc72s5tgca4m@uno.localdomain>","References":"<20200704005227.21782-1-laurent.pinchart@ideasonboard.com>\n\t<20200704005227.21782-8-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200704005227.21782-8-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 07/12] libcamera: pipeline:\n\traspberrypi: Don't call handleState() in stop state","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":11208,"web_url":"https://patchwork.libcamera.org/comment/11208/","msgid":"<20200706111047.GB5912@pendragon.ideasonboard.com>","date":"2020-07-06T11:10:47","subject":"Re: [libcamera-devel] [PATCH v2 07/12] libcamera: pipeline:\n\traspberrypi: Don't call handleState() in stop state","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Mon, Jul 06, 2020 at 11:00:10AM +0200, Jacopo Mondi wrote:\n> On Sat, Jul 04, 2020 at 03:52:22AM +0300, Laurent Pinchart wrote:\n> > The handleState() function is a no-op when the state is State::Stopped.\n> > Don't call it in that case, which simplifies the caller.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 ++++-----\n> >  1 file changed, 4 insertions(+), 5 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index a05fc68b98fa..74bee6895dcd 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -1188,7 +1188,7 @@ void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData\n> >  \t\tControlList controls = action.controls[0];\n> >  \t\tif (!staggeredCtrl_.set(controls))\n> >  \t\t\tLOG(RPI, Error) << \"V4L2 staggered set failed\";\n> > -\t\tgoto done;\n> > +\t\treturn;\n> >  \t}\n> >\n> >  \tcase RPI_IPA_ACTION_SET_SENSOR_CONFIG: {\n> > @@ -1206,18 +1206,18 @@ void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData\n> >  \t\t/* Set the sensor orientation here as well. */\n> >  \t\tControlList controls = action.controls[0];\n> >  \t\tunicam_[Unicam::Image].dev()->setControls(&controls);\n> > -\t\tgoto done;\n> > +\t\treturn;\n> >  \t}\n> >\n> >  \tcase RPI_IPA_ACTION_V4L2_SET_ISP: {\n> >  \t\tControlList controls = action.controls[0];\n> >  \t\tisp_[Isp::Input].dev()->setControls(&controls);\n> > -\t\tgoto done;\n> > +\t\treturn;\n> \n> I'm sure I don't fully understand the IPA protocol for this device,\n> but the comment says this operation *can* be handled with the IPA in\n> stopped state, not that the stop state is required. Furthermore, the\n> next switch block says the there handled operation *must not* be handled\n> in stopped state, which makes me think these ones can but don't\n> require to.\n\nYou're absolutely right. As this patch will then become a one-liner I\nthink I'll just drop it.\n\n> >  \t}\n> >  \t}\n> >\n> >  \tif (state_ == State::Stopped)\n> > -\t\tgoto done;\n> > +\t\treturn;\n> \n> This, instead, is crystal clear :)\n> \n> >\n> >  \t/*\n> >  \t * The following actions must not be handled when the pipeline handler\n> > @@ -1261,7 +1261,6 @@ void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData\n> >  \t\tbreak;\n> >  \t}\n> >\n> > -done:\n> >  \thandleState();\n> >  }\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 D8069BD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jul 2020 11:10:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 591D560E01;\n\tMon,  6 Jul 2020 13:10:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B6889603AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jul 2020 13:10:51 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 09FE097E;\n\tMon,  6 Jul 2020 13:10:50 +0200 (CEST)"],"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=\"S/UYJdXM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594033851;\n\tbh=zdN2r1eEx5GLUeS3EDWU59Y2jNrW18bRxZE5ccKc3ZI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=S/UYJdXMnjQLW0icCWrzI+xyHqo8Di+o13+eNWK/+p99QueuzYISrcovsc4XdoqJN\n\tAu8FjQJuRr7Shc7vDVlhuI9fSm1dU18Rq0vs1e8SmVeIV+5jLAPH7qsidiyxMP+Y6c\n\tcAVECLeOd5Cz1YBnUA3sIgCKW8h7C+fbD913mhJ8=","Date":"Mon, 6 Jul 2020 14:10:47 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200706111047.GB5912@pendragon.ideasonboard.com>","References":"<20200704005227.21782-1-laurent.pinchart@ideasonboard.com>\n\t<20200704005227.21782-8-laurent.pinchart@ideasonboard.com>\n\t<20200706090010.onviuc72s5tgca4m@uno.localdomain>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200706090010.onviuc72s5tgca4m@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH v2 07/12] libcamera: pipeline:\n\traspberrypi: Don't call handleState() in stop state","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>"}}]