{"id":12885,"url":"https://patchwork.libcamera.org/api/patches/12885/?format=json","web_url":"https://patchwork.libcamera.org/patch/12885/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210709145825.2943443-3-naush@raspberrypi.com>","date":"2021-07-09T14:58:19","name":"[libcamera-devel,v6,2/8] ipa: raspberrypi: Add a constructor struct DeviceStatus","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"b8bb7bfa6a8820aac23d3ce34356ecf3103f436f","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12885/mbox/","series":[{"id":2223,"url":"https://patchwork.libcamera.org/api/series/2223/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2223","date":"2021-07-09T14:58:17","name":"ipa: raspberrypi: Allow long exposure modes for imx477.","version":6,"mbox":"https://patchwork.libcamera.org/series/2223/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12885/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12885/checks/","tags":{},"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 80F32BD794\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Jul 2021 14:58:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4189F68530;\n\tFri,  9 Jul 2021 16:58:34 +0200 (CEST)","from mail-wm1-x333.google.com (mail-wm1-x333.google.com\n\t[IPv6:2a00:1450:4864:20::333])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BA2856851D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Jul 2021 16:58:31 +0200 (CEST)","by mail-wm1-x333.google.com with SMTP id\n\tt14-20020a05600c198eb029020c8aac53d4so26039167wmq.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 09 Jul 2021 07:58:31 -0700 (PDT)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:35c2:26d3:e217:4410])\n\tby smtp.gmail.com with ESMTPSA id\n\tc2sm1480995wrn.28.2021.07.09.07.58.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 09 Jul 2021 07:58:30 -0700 (PDT)"],"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=\"DdJrvY7Y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=CBcHuMVRJcBtnrr3Y7E6tv89VxQZh5+qq8+9trsTclk=;\n\tb=DdJrvY7YOzhlqfHAwUbCv+xwT9qWkr29lZcD1qcFQiCtfbYaIsXrPFgQoZdoNyHgQ1\n\tMx4nDC9ozxwtqXyKUSo1hRVMDqCphpu+/Vct6baO6/rBrVVypIMYguX4hAVTg3uWY8+R\n\tI4JDG6wT6wRHaA4EZs1y6YL8WZRvAZ6yrAZrsess1fMiIllnJ1HHFeSMTKa5XvG6gAWQ\n\t6KgzOTP0zpjdGw44dS5+SbpjnRUb24TFZbgcIUkjq75wWaOuWn0Zph/tCg38Sq/aTuEy\n\tD5Smszr+DyLn0wVFUP8fOkWZPPtB4IMg/yrPGE3S0tSKZn9vxxxmtSIcZ6vH1Nq6QHNu\n\t1zxg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=CBcHuMVRJcBtnrr3Y7E6tv89VxQZh5+qq8+9trsTclk=;\n\tb=TpWSeWEXrXRG1q3FSHzAEffNKr5YY9p2IIaPXJzMxypnIbGKOygSjSrPSX2TSDQE2+\n\tG46nzwR5w88jO65DhvajoYn2tTe5Ee74ax6cl2H8tYaNI9WG4CExJWUK5iYaljt5Ah3N\n\t+73k/TXahRCiT2xfZazyFrehcLPsfXN7+40oBB5dGN/CsrfI9i+0aG6QyvAWSrpnN5+u\n\toNVaRjW+XIaQNYxORptJK7kB7hwlJOEPxAy2Ghae8linzNAW23/Q/N7iwlroKn9HcgZX\n\tcVX/fs+NhjRwcmSOWk2cc6KjjP/98fIMgLgWtPlYJxCsjNemXvvwuCaY/O0e/8nPxXVW\n\tWzCQ==","X-Gm-Message-State":"AOAM53094AuuetUKDM3eCE/d+/J7AkPULppEaGqAu9lfJ0I/3/b0uFUx\n\t98NaPkU927XbXgBsXrpRks6usJqyFNr7Qw==","X-Google-Smtp-Source":"ABdhPJy2B2rO3BjBYopqljufrekTVKuw+1PPhXmFRl7c1GyHDUr5gx9XA3GB3dH3wRbjkj/v1fCBlg==","X-Received":"by 2002:a05:600c:2058:: with SMTP id\n\tp24mr40235568wmg.76.1625842711155; \n\tFri, 09 Jul 2021 07:58:31 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  9 Jul 2021 15:58:19 +0100","Message-Id":"<20210709145825.2943443-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210709145825.2943443-1-naush@raspberrypi.com>","References":"<20210709145825.2943443-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The constructor sets all fields to 0. This replaces the memset(0) and default\nvalue initialisation usage in the agc and lux controllers respectively.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-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(-)","diff":"diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\nindex 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;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex 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\ndiff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp\nindex 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","prefixes":["libcamera-devel","v6","2/8"]}