[{"id":18065,"web_url":"https://patchwork.libcamera.org/comment/18065/","msgid":"<20210709161018.zavve43qtsadnhvd@uno.localdomain>","date":"2021-07-09T16:10:18","subject":"Re: [libcamera-devel] [PATCH v6 2/8] ipa: raspberrypi: Add a\n\tconstructor struct DeviceStatus","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Naush,\n\nOn Fri, Jul 09, 2021 at 03:58:19PM +0100, Naushir Patuck wrote:\n> The constructor sets all fields to 0. This replaces the memset(0) and default\n> value initialisation usage in the agc and lux controllers respectively.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/ipa/raspberrypi/controller/device_status.h | 6 ++++++\n>  src/ipa/raspberrypi/controller/rpi/agc.cpp     | 1 -\n>  src/ipa/raspberrypi/controller/rpi/lux.cpp     | 9 +--------\n>  3 files changed, 7 insertions(+), 9 deletions(-)\n>\n> diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\n> index 733378dbfa27..73df7ce228dd 100644\n> --- a/src/ipa/raspberrypi/controller/device_status.h\n> +++ b/src/ipa/raspberrypi/controller/device_status.h\n> @@ -14,6 +14,12 @@\n>   */\n>\n>  struct DeviceStatus {\n> +\tDeviceStatus()\n> +\t\t: shutter_speed(std::chrono::seconds(0)), analogue_gain(0.0),\n> +\t\t  lens_position(0.0), aperture(0.0), flash_intensity(0.0)\n> +\t{\n> +\t}\n> +\n>  \t/* time shutter is open */\n>  \tlibcamera::utils::Duration shutter_speed;\n>  \tdouble analogue_gain;\n> diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> index 6c3a4eb2a04d..f57783f821ec 100644\n> --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> @@ -172,7 +172,6 @@ Agc::Agc(Controller *controller)\n>  \t// it's not been calculated yet (i.e. Process hasn't yet run).\n>  \tmemset(&status_, 0, sizeof(status_));\n>  \tstatus_.ev = ev_;\n> -\tmemset(&last_device_status_, 0, sizeof(last_device_status_));\n\n>\n>  char const *Agc::Name() const\n> diff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp\n> index f58d69397e1c..6367b17dc7f4 100644\n> --- a/src/ipa/raspberrypi/controller/rpi/lux.cpp\n> +++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp\n> @@ -60,14 +60,7 @@ void Lux::Prepare(Metadata *image_metadata)\n>\n>  void Lux::Process(StatisticsPtr &stats, Metadata *image_metadata)\n>  {\n> -\t// set some initial values to shut the compiler up\n> -\tDeviceStatus device_status = {\n> -\t\t.shutter_speed = 1.0ms,\n> -\t\t.analogue_gain = 1.0,\n> -\t\t.lens_position = 0.0,\n> -\t\t.aperture = 0.0,\n> -\t\t.flash_intensity = 0.0\n> -\t};\n> +\tDeviceStatus device_status;\n>  \tif (image_metadata->Get(\"device.status\", device_status) == 0) {\n>  \t\tdouble current_gain = device_status.analogue_gain;\n>  \t\tdouble current_aperture = device_status.aperture;\n\nI do also see an\ngeq.cpp:     DeviceStatus device_status = {};\n\nwhich doesn't hurt though\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> --\n> 2.25.1\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 D9B18C3224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Jul 2021 16:09:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5F21F6851B;\n\tFri,  9 Jul 2021 18:09:36 +0200 (CEST)","from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C64E2605AC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Jul 2021 18:09:30 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id 3345A240005;\n\tFri,  9 Jul 2021 16:09:29 +0000 (UTC)"],"Date":"Fri, 9 Jul 2021 18:10:18 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20210709161018.zavve43qtsadnhvd@uno.localdomain>","References":"<20210709145825.2943443-1-naush@raspberrypi.com>\n\t<20210709145825.2943443-3-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210709145825.2943443-3-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v6 2/8] ipa: raspberrypi: Add a\n\tconstructor struct DeviceStatus","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18077,"web_url":"https://patchwork.libcamera.org/comment/18077/","msgid":"<YOs7s62BhHpGx0yM@pendragon.ideasonboard.com>","date":"2021-07-11T18:42:59","subject":"Re: [libcamera-devel] [PATCH v6 2/8] ipa: raspberrypi: Add a\n\tconstructor struct DeviceStatus","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Jul 09, 2021 at 06:10:18PM +0200, Jacopo Mondi wrote:\n> Hi Naush,\n> \n> On Fri, Jul 09, 2021 at 03:58:19PM +0100, Naushir Patuck wrote:\n> > The constructor sets all fields to 0. This replaces the memset(0) and default\n> > value initialisation usage in the agc and lux controllers respectively.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >  src/ipa/raspberrypi/controller/device_status.h | 6 ++++++\n> >  src/ipa/raspberrypi/controller/rpi/agc.cpp     | 1 -\n> >  src/ipa/raspberrypi/controller/rpi/lux.cpp     | 9 +--------\n> >  3 files changed, 7 insertions(+), 9 deletions(-)\n> >\n> > diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\n> > index 733378dbfa27..73df7ce228dd 100644\n> > --- a/src/ipa/raspberrypi/controller/device_status.h\n> > +++ b/src/ipa/raspberrypi/controller/device_status.h\n> > @@ -14,6 +14,12 @@\n> >   */\n> >\n> >  struct DeviceStatus {\n> > +\tDeviceStatus()\n> > +\t\t: shutter_speed(std::chrono::seconds(0)), analogue_gain(0.0),\n> > +\t\t  lens_position(0.0), aperture(0.0), flash_intensity(0.0)\n> > +\t{\n> > +\t}\n> > +\n> >  \t/* time shutter is open */\n> >  \tlibcamera::utils::Duration shutter_speed;\n> >  \tdouble analogue_gain;\n> > diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> > index 6c3a4eb2a04d..f57783f821ec 100644\n> > --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> > +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> > @@ -172,7 +172,6 @@ Agc::Agc(Controller *controller)\n> >  \t// it's not been calculated yet (i.e. Process hasn't yet run).\n> >  \tmemset(&status_, 0, sizeof(status_));\n> >  \tstatus_.ev = ev_;\n> > -\tmemset(&last_device_status_, 0, sizeof(last_device_status_));\n> \n> >\n> >  char const *Agc::Name() const\n> > diff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp\n> > index f58d69397e1c..6367b17dc7f4 100644\n> > --- a/src/ipa/raspberrypi/controller/rpi/lux.cpp\n> > +++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp\n> > @@ -60,14 +60,7 @@ void Lux::Prepare(Metadata *image_metadata)\n> >\n> >  void Lux::Process(StatisticsPtr &stats, Metadata *image_metadata)\n> >  {\n> > -\t// set some initial values to shut the compiler up\n> > -\tDeviceStatus device_status = {\n> > -\t\t.shutter_speed = 1.0ms,\n> > -\t\t.analogue_gain = 1.0,\n> > -\t\t.lens_position = 0.0,\n> > -\t\t.aperture = 0.0,\n> > -\t\t.flash_intensity = 0.0\n> > -\t};\n> > +\tDeviceStatus device_status;\n> >  \tif (image_metadata->Get(\"device.status\", device_status) == 0) {\n> >  \t\tdouble current_gain = device_status.analogue_gain;\n> >  \t\tdouble current_aperture = device_status.aperture;\n> \n> I do also see an\n> geq.cpp:     DeviceStatus device_status = {};\n> \n> which doesn't hurt though\n\nI can fix this when applying. Naush, is that OK with you ?\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>","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 66747C3224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 11 Jul 2021 18:43:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6806B68519;\n\tSun, 11 Jul 2021 20:43:47 +0200 (CEST)","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 804CD68519\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 11 Jul 2021 20:43:45 +0200 (CEST)","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 DE7D9CC;\n\tSun, 11 Jul 2021 20:43:44 +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=\"N/nIZq6P\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1626029025;\n\tbh=ew3NATz2vu0X2aCQrK/mngLGufZhb9fDs/hpLldYNCE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=N/nIZq6PAX45VQIAE85hachyz0WsvpFeqMJAQiI5bMhzwBh6R5FpG3XthbimDuvhx\n\tkeZR5xz6cH9Vwt0uRieL0zqDqEt/syAi66OowNeW2M/x/64pr7C9A6k0gntkCGwjYj\n\tDDY/vxDZDwYP60lsjVXFDBNKyuKgtwq+VT5aEg2A=","Date":"Sun, 11 Jul 2021 21:42:59 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YOs7s62BhHpGx0yM@pendragon.ideasonboard.com>","References":"<20210709145825.2943443-1-naush@raspberrypi.com>\n\t<20210709145825.2943443-3-naush@raspberrypi.com>\n\t<20210709161018.zavve43qtsadnhvd@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210709161018.zavve43qtsadnhvd@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH v6 2/8] ipa: raspberrypi: Add a\n\tconstructor struct DeviceStatus","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]