From patchwork Mon Jul 12 10:02:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12902 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 0F9B8C3224 for ; Mon, 12 Jul 2021 10:02:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9AC986852C; Mon, 12 Jul 2021 12:02:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Hd7M+Cel"; dkim-atps=neutral Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C36168521 for ; Mon, 12 Jul 2021 12:02:16 +0200 (CEST) Received: by mail-wr1-x433.google.com with SMTP id v5so24795815wrt.3 for ; Mon, 12 Jul 2021 03:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IF2nPnuOcRtGtByOSMQln8DsOJyZiq6YxqgDrJr80Sw=; b=Hd7M+Cel46Y/Z9W9VMlzCNi7R/MwWz3EbWy5c0ssJJtSNzWKvTzngiXLNsx+PhuOI6 ZcLf74B8LKDDNmolYfXh9v9fdkhGcpfPirs08bmiOnzw8CsBjHNwqjYUv61JsRBapbja kme+axAXQlD16pincDF1TNsBwkuNE8t65vEikXKy5Cb/VrRiWqr2cZQ4CvzpVEMo69Zk MhTdozFwT4fwV9j34A6InAn1DXouL9pvAPOfwc8yAdIAwVxAVf3uasK06+HB1xyna3B1 bOREUvWxYdYAPXLOFGCgjNkEAyFBCa6kuuSDFWRihcspx1IQJtCK91hcnj9jrjMvbjXc svig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IF2nPnuOcRtGtByOSMQln8DsOJyZiq6YxqgDrJr80Sw=; b=a4amdq+sd/OOPGKnJVVnzX1cPlE8r/3wKCBcfO44D20WnloJtl/P1VnRQ8v00Il3l2 wrG+JS6fEH4o9ZfiI84sYccMS8tjUW/5sdsNzuKED1ntYVbCYE1gsQ39rJR+MrhhGDXx w2o0dUlPzRP0oxnOXPK3XpUjcZHVLO1632c60J2duXXkE/3PNORYNMl2Xai6SFLjUkJZ mk2ineyldOH55cqilgm2I8Gv01qMytAgsgtS+23g6G5PWx6W5ojtUxOQiZkRzlfdOrH/ 7cMF/s2Fc+aCv2mj9ewO8xr/bOU0TE3G+uW7I6BYvCRZ8HGclGkxm4XL88DaoA/vaR9C DKYQ== X-Gm-Message-State: AOAM532aGCC5OyKywxDX25VtlTzaxbv/RA1OLDIpXf+1AZz8d1elNL0a aSNK6TEuTEBjqZdLmqzlA6hnzBi4u2CAyQ== X-Google-Smtp-Source: ABdhPJxh2ABBDCDdkI5ap7CL/OAW5BBPCW/ZqgaN1WtKlZp0lJrXwAEiOFI16OEKqvq84yDlux3PNA== X-Received: by 2002:adf:f907:: with SMTP id b7mr57650785wrr.357.1626084135872; Mon, 12 Jul 2021 03:02:15 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:3395:5e50:10bb:f8fd]) by smtp.gmail.com with ESMTPSA id b16sm14249941wrs.51.2021.07.12.03.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:02:15 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Jul 2021 11:02:02 +0100 Message-Id: <20210712100209.447893-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712100209.447893-1-naush@raspberrypi.com> References: <20210712100209.447893-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 1/8] ipa: raspberrypi: Make device_status.h C++ only header, and update comments X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This header file is no longer C compatible, so remove the extern "C" declaration. Replace C++ style comments with C style based on libcamera guidelines. There are no functional changes in this commit. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- .../raspberrypi/controller/device_status.h | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h index f74235248b12..733378dbfa27 100644 --- a/src/ipa/raspberrypi/controller/device_status.h +++ b/src/ipa/raspberrypi/controller/device_status.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2019, Raspberry Pi (Trading) Limited + * Copyright (C) 2019-2021, Raspberry Pi (Trading) Limited * * device_status.h - device (image sensor) status */ @@ -8,25 +8,19 @@ #include -// Definition of "device metadata" which stores things like shutter time and -// analogue gain that downstream control algorithms will want to know. - -#ifdef __cplusplus -extern "C" { -#endif +/* + * Definition of "device metadata" which stores things like shutter time and + * analogue gain that downstream control algorithms will want to know. + */ struct DeviceStatus { - // time shutter is open + /* time shutter is open */ libcamera::utils::Duration shutter_speed; double analogue_gain; - // 1.0/distance-in-metres, or 0 if unknown + /* 1.0/distance-in-metres, or 0 if unknown */ double lens_position; - // 1/f so that brightness quadruples when this doubles, or 0 if unknown + /* 1/f so that brightness quadruples when this doubles, or 0 if unknown */ double aperture; - // proportional to brightness with 0 = no flash, 1 = maximum flash + /* proportional to brightness with 0 = no flash, 1 = maximum flash */ double flash_intensity; }; - -#ifdef __cplusplus -} -#endif From patchwork Mon Jul 12 10:02:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12903 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E936FC3226 for ; Mon, 12 Jul 2021 10:02:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4A8B968530; Mon, 12 Jul 2021 12:02:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="JG1+JvXj"; dkim-atps=neutral Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E96D68513 for ; Mon, 12 Jul 2021 12:02:17 +0200 (CEST) Received: by mail-wm1-x333.google.com with SMTP id j25-20020a05600c1c19b02902269686f585so800986wms.0 for ; Mon, 12 Jul 2021 03:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a0ZizHb7bTi3j6yd62ZDAnQqObfPtxZJzqDIOudippA=; b=JG1+JvXjfZ8kkysHva0wlUurAaVyRWKNcWf1HVD+8JcVrNyDyOSBWxAzCdc3Aya3rC XnMkPNOmLBPeATOyZLgoOXEjqiQBJU/7UaiI3HJrs9FTPS3TzoFLNMLHxXez3yjqJ+kK cMm6hDXNtUjk4ymZTJASuUKBp0mTYnYiSdz9errJqiv2faHszCyD9cocgwLuogmc1Zw1 SL9pV4xpOM0Ox9QFBi/OPWxitU0CEigAf7O2K4xZt5RUonxlSRtnvq88ENrcZh7kPpLo 5c52S8SiO9cAltMbhmUK4zzvv+GrDexELjuiEVHD0RdlPjgWesupf3Cu8Mzu+qPlfj4Y 72gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a0ZizHb7bTi3j6yd62ZDAnQqObfPtxZJzqDIOudippA=; b=J0kerV9j81p1z2heAeRSYai+RrMNvXAHZlEMfy5JTl511clpYfwmv+PNIBwRwtZy1I 0uh/sS8pEZW5wY5LB0gkeYhfUuuXZY/ebR3ehnEfC9UXkDZLTF0Z2gRS/QUl8yuIvtg9 hXWuEi9wc8xqKRJPN53Tyhp7dNMo4XWbpcmLv55ejInoFee3nMwkeB/Os5BgQ39ObHgP x8Ub46f5mkfuc7ufQKDKIfA6vq06RluRQY1isxmOcqrsHknExWEWXwsuBx3Sir0090nl uEk2WeEpZw1bPxXzewdxiaJP8wJxNO/zUu3j1iNaB+7FddPxeAYwf+Lky5cW1+lHHgo1 xr0w== X-Gm-Message-State: AOAM5310yvk5Wa9Dg0u3JN4aCU3LimoM9k1A36+ep0BypC6vseVGEBgF uCaHLwIc+2qhxtJUmtkaBfDzfVCT1WdgnQ== X-Google-Smtp-Source: ABdhPJyP8LvHkePKVX2d/7ERQMsFYN9g3YQGKIE5p/CA1JZEkeOzkmMr0yi4r4v6b5c+5Oz6GXh3HQ== X-Received: by 2002:a05:600c:4f54:: with SMTP id m20mr3340728wmq.52.1626084136664; Mon, 12 Jul 2021 03:02:16 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:3395:5e50:10bb:f8fd]) by smtp.gmail.com with ESMTPSA id b16sm14249941wrs.51.2021.07.12.03.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:02:16 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Jul 2021 11:02:03 +0100 Message-Id: <20210712100209.447893-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712100209.447893-1-naush@raspberrypi.com> References: <20210712100209.447893-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 2/8] ipa: raspberrypi: Add a constructor struct DeviceStatus X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The constructor sets all fields to 0. This replaces the memset(0) and default value initialisation usage in the agc and lux controllers respectively. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/device_status.h | 6 ++++++ src/ipa/raspberrypi/controller/rpi/agc.cpp | 1 - src/ipa/raspberrypi/controller/rpi/geq.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/lux.cpp | 9 +-------- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h index 733378dbfa27..73df7ce228dd 100644 --- a/src/ipa/raspberrypi/controller/device_status.h +++ b/src/ipa/raspberrypi/controller/device_status.h @@ -14,6 +14,12 @@ */ struct DeviceStatus { + DeviceStatus() + : shutter_speed(std::chrono::seconds(0)), analogue_gain(0.0), + lens_position(0.0), aperture(0.0), flash_intensity(0.0) + { + } + /* time shutter is open */ libcamera::utils::Duration shutter_speed; double analogue_gain; diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index 6c3a4eb2a04d..f57783f821ec 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -172,7 +172,6 @@ Agc::Agc(Controller *controller) // it's not been calculated yet (i.e. Process hasn't yet run). memset(&status_, 0, sizeof(status_)); status_.ev = ev_; - memset(&last_device_status_, 0, sizeof(last_device_status_)); } char const *Agc::Name() const diff --git a/src/ipa/raspberrypi/controller/rpi/geq.cpp b/src/ipa/raspberrypi/controller/rpi/geq.cpp index bdceb1f3d3eb..4530cb75792c 100644 --- a/src/ipa/raspberrypi/controller/rpi/geq.cpp +++ b/src/ipa/raspberrypi/controller/rpi/geq.cpp @@ -49,7 +49,7 @@ void Geq::Prepare(Metadata *image_metadata) lux_status.lux = 400; if (image_metadata->Get("lux.status", lux_status)) LOG(RPiGeq, Warning) << "no lux data found"; - DeviceStatus device_status = {}; + DeviceStatus device_status; device_status.analogue_gain = 1.0; // in case not found if (image_metadata->Get("device.status", device_status)) LOG(RPiGeq, Warning) diff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp index f58d69397e1c..6367b17dc7f4 100644 --- a/src/ipa/raspberrypi/controller/rpi/lux.cpp +++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp @@ -60,14 +60,7 @@ void Lux::Prepare(Metadata *image_metadata) void Lux::Process(StatisticsPtr &stats, Metadata *image_metadata) { - // set some initial values to shut the compiler up - DeviceStatus device_status = { - .shutter_speed = 1.0ms, - .analogue_gain = 1.0, - .lens_position = 0.0, - .aperture = 0.0, - .flash_intensity = 0.0 - }; + DeviceStatus device_status; if (image_metadata->Get("device.status", device_status) == 0) { double current_gain = device_status.analogue_gain; double current_aperture = device_status.aperture; From patchwork Mon Jul 12 10:02:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12904 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 07557C3224 for ; Mon, 12 Jul 2021 10:02:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B01446852A; Mon, 12 Jul 2021 12:02:21 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="shSnnXUA"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3AB4F6852A for ; Mon, 12 Jul 2021 12:02:18 +0200 (CEST) Received: by mail-wm1-x32d.google.com with SMTP id l4-20020a05600c4f04b0290220f8455631so3473715wmq.1 for ; Mon, 12 Jul 2021 03:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VHbiovgBa81RqZUmpEMLgj2ypP55uY9DSSVQxj3EZM4=; b=shSnnXUAELm87sM1eTiiTuLvGlK7B52c60NUQTm9W4SPSlgEupwtEstVvjQySe6WjA lbfjE/0KXLkqZj7mjhF+HJjBZ4gC9ww+pS/60kl33gBbVpkV8rpA4yzxuRGREsQTJx1/ tu8oHN9Vk99oX140Gl9hbFRIEF6xMR/DabKACyqQ2c77ZOozQvADlRtZQiSHjFKxMWxn 68mI4IAWr2OA6Dd+MmM/uMzvEa/AKSq6FY8g1zgUu01gjAzqzUQAfdvTCM+rp3kVmoht mleGFwS/08/j2b50gZrzN/CmnetJ1pN7YhKiqBScoj9Zzw8sLGGmV2cAlqDeoXHdzccs N92w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VHbiovgBa81RqZUmpEMLgj2ypP55uY9DSSVQxj3EZM4=; b=BoCk31AzzFA+cBEUk9VXfQzhKfG1/FOgzwWI5MjXmfUZWOU1V8uEzBPWXgjFbj0vBF BdB7tzrkk2xoi0kQ8lUoePm3vRON6lJMhULzfXec1pxPzOZtZowXIoAVePe4vQJNjRrT rBFABfTIMqexOg49iUQnQLJv6jyzS8/eXHPMZjszh/1z4nXLZl20Sds8iL4IAqDlPvGh rcwgJ7Z26JO42wRVjDhjMF2e2kAskBpzib6h6zsfy4ZqSBHunrtqneYBrC7C6iPSpeFp LkyBoqX7GhRlap746/tbNFe94HSQN/CWVE6cA5FXKQDX8DzoPu9OJzxUwTr9zrZTswWr 1UUw== X-Gm-Message-State: AOAM5314mgAWUJQkAuHsw6HTw1ZHirBFZ3K/5vgLxSr+cYrmIO0GFkyt J97AyE/FD30oORwc3BafsSuqRJLEfLzAjA== X-Google-Smtp-Source: ABdhPJzfGhh2nG4dKJD1GzlMfzirYN6xlZx9Do+Jjj1ckEokneBZsnvkVcd0X3UHRT7UuWNP4pxQcQ== X-Received: by 2002:a1c:1bc3:: with SMTP id b186mr13655814wmb.27.1626084137707; Mon, 12 Jul 2021 03:02:17 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:3395:5e50:10bb:f8fd]) by smtp.gmail.com with ESMTPSA id b16sm14249941wrs.51.2021.07.12.03.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:02:17 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Jul 2021 11:02:04 +0100 Message-Id: <20210712100209.447893-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712100209.447893-1-naush@raspberrypi.com> References: <20210712100209.447893-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 3/8] ipa: raspberrypi: Add an operator<< to struct DeviceStatus X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add an operator<< overload to log all fields in DeviceStatus, and remove the manual logging statements in the IPA and CamHelper. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/cam_helper.cpp | 5 +---- .../raspberrypi/controller/device_status.cpp | 20 +++++++++++++++++++ .../raspberrypi/controller/device_status.h | 4 ++++ src/ipa/raspberrypi/meson.build | 1 + src/ipa/raspberrypi/raspberrypi.cpp | 5 +---- 5 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 src/ipa/raspberrypi/controller/device_status.cpp diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp index e6d2258c66d7..1ec3f03e1aa3 100644 --- a/src/ipa/raspberrypi/cam_helper.cpp +++ b/src/ipa/raspberrypi/cam_helper.cpp @@ -188,10 +188,7 @@ void CamHelper::parseEmbeddedData(Span buffer, deviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed; deviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain; - LOG(IPARPI, Debug) << "Metadata updated - Exposure : " - << deviceStatus.shutter_speed - << " Gain : " - << deviceStatus.analogue_gain; + LOG(IPARPI, Debug) << "Metadata updated - " << deviceStatus; metadata.Set("device.status", deviceStatus); } diff --git a/src/ipa/raspberrypi/controller/device_status.cpp b/src/ipa/raspberrypi/controller/device_status.cpp new file mode 100644 index 000000000000..7b8218ca67d5 --- /dev/null +++ b/src/ipa/raspberrypi/controller/device_status.cpp @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ +/* + * Copyright (C) 2021, Raspberry Pi (Trading) Limited + * + * device_status.cpp - device (image sensor) status + */ +#include "device_status.h" + +using namespace libcamera; /* for the Duration operator<< overload */ + +std::ostream &operator<<(std::ostream &out, const DeviceStatus &d) +{ + out << "Exposure: " << d.shutter_speed + << " Gain: " << d.analogue_gain + << " Aperture: " << d.aperture + << " Lens: " << d.lens_position + << " Flash: " << d.flash_intensity; + + return out; +} diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h index 73df7ce228dd..ec4bbe738b35 100644 --- a/src/ipa/raspberrypi/controller/device_status.h +++ b/src/ipa/raspberrypi/controller/device_status.h @@ -6,6 +6,8 @@ */ #pragma once +#include + #include /* @@ -20,6 +22,8 @@ struct DeviceStatus { { } + friend std::ostream &operator<<(std::ostream &out, const DeviceStatus &d); + /* time shutter is open */ libcamera::utils::Duration shutter_speed; double analogue_gain; diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build index c98550180d7b..1af31e4aa021 100644 --- a/src/ipa/raspberrypi/meson.build +++ b/src/ipa/raspberrypi/meson.build @@ -40,6 +40,7 @@ rpi_ipa_sources = files([ 'controller/rpi/contrast.cpp', 'controller/rpi/sdn.cpp', 'controller/pwl.cpp', + 'controller/device_status.cpp', ]) mod = shared_module(ipa_name, diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 4d09a84f6532..f51c970befb5 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -1019,10 +1019,7 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls) deviceStatus.shutter_speed = helper_->Exposure(exposureLines); deviceStatus.analogue_gain = helper_->Gain(gainCode); - LOG(IPARPI, Debug) << "Metadata - Exposure : " - << deviceStatus.shutter_speed - << " Gain : " - << deviceStatus.analogue_gain; + LOG(IPARPI, Debug) << "Metadata - " << deviceStatus; rpiMetadata_.Set("device.status", deviceStatus); } From patchwork Mon Jul 12 10:02:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12905 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 85CCAC3227 for ; Mon, 12 Jul 2021 10:02:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2F10168534; Mon, 12 Jul 2021 12:02:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="GHW5hz66"; dkim-atps=neutral Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E829E6852D for ; Mon, 12 Jul 2021 12:02:18 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id g12so3169231wme.2 for ; Mon, 12 Jul 2021 03:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G4TAVStL/tcP2DlEiFfnCm1cY6C6U0CxrcKv4TvSmvM=; b=GHW5hz66BguI7elgDMW5df9egaybCzUdlm0NXABwk1QZsdaDgXkn6KOoEd6dQ3jMyr 4adeVLrkwhbfzAa/m28Xtq+Y+iddrLd4tvXVu+1kFT6ZHayvs/74bsedHpkpCYIONqN8 b41RHbWiSo3bS8VHqUjnicfXDLazV/tzqxOOdrEf9LgQzj0h0EIgvoek5PswQC0JU0f5 jU+dSdpJKD/OEqklUB2EgipzBscgGQmdTM1FVi53cfvxDIXT4Q5otiDuzz+WClEdg6v9 1JZcY3ofpExK1X91Qe61WdE+Y4ZVh1w7C5SkRIQ5pk89Tl11VGzzvlirZIT/kyw2gx7f ZPFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G4TAVStL/tcP2DlEiFfnCm1cY6C6U0CxrcKv4TvSmvM=; b=UCOaKarGipXgVkPtkZ1DCmZDWOYY6weENL8Ky/HgXyAP3XpHhV2l2VMr6GjpKdXK5x /HNAS7WyqfVGTu2FcOM1gle6tqnPt9hGTxgp+R78si2+Ak7yG//gjrThFYCASZyrinZf Q9//DfzIQixzAmlHiS0sUTPujH4NwYmDeEy7JCwBYkr9YcE4r49q1usefVnDoaepsjqi 4FEvMyJZBL8syCkx8QGl2r1YkUYoLDy716Dc3T1tdZbdHxpRuxj2jHrLsmbMqtUWI3qF 4KwagOhDedhPB8Ff3jBfUgGWtywdgTqhCU7NF+DEC0G/30AAwgiNIQuXz976U0UwFBDE t40Q== X-Gm-Message-State: AOAM533xUgAwEKzhSCXYzmUm7Uka0+b/+hTTR+wFaGWpRA4amcgox9zQ yG4WehJTwseh0m2umkXnoYcbQ8UnN5J+7g== X-Google-Smtp-Source: ABdhPJz+4X8tWCqELlQUI+WtqR11r7cI8m9HLgHTd3jfP5eI+qWgVmM6gT9Qt9DZuwg4pDYReKGIVA== X-Received: by 2002:a1c:63d6:: with SMTP id x205mr5594407wmb.42.1626084138394; Mon, 12 Jul 2021 03:02:18 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:3395:5e50:10bb:f8fd]) by smtp.gmail.com with ESMTPSA id b16sm14249941wrs.51.2021.07.12.03.02.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:02:17 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Jul 2021 11:02:05 +0100 Message-Id: <20210712100209.447893-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712100209.447893-1-naush@raspberrypi.com> References: <20210712100209.447893-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 4/8] ipa: raspberrypi: Add frame_length to DeviceStatus X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Store the frame length into the DeviceStatus struct. The value is extracted from embedded data when available, or calculated from the VBLANK value passed from DelayedControls otherwise. Update imx477 and imx219 CamHelper classes to extract the frame length from the embedded data buffer. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/cam_helper.cpp | 1 + src/ipa/raspberrypi/cam_helper_imx219.cpp | 6 +++++- src/ipa/raspberrypi/cam_helper_imx477.cpp | 6 +++++- src/ipa/raspberrypi/controller/device_status.cpp | 1 + src/ipa/raspberrypi/controller/device_status.h | 7 +++++-- src/ipa/raspberrypi/raspberrypi.cpp | 2 ++ 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp index 1ec3f03e1aa3..3c6afce7572b 100644 --- a/src/ipa/raspberrypi/cam_helper.cpp +++ b/src/ipa/raspberrypi/cam_helper.cpp @@ -187,6 +187,7 @@ void CamHelper::parseEmbeddedData(Span buffer, deviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed; deviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain; + deviceStatus.frame_length = parsedDeviceStatus.frame_length; LOG(IPARPI, Debug) << "Metadata updated - " << deviceStatus; diff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp b/src/ipa/raspberrypi/cam_helper_imx219.cpp index 4d68e01fce71..a3caab714602 100644 --- a/src/ipa/raspberrypi/cam_helper_imx219.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp @@ -30,7 +30,10 @@ using namespace RPiController; constexpr uint32_t gainReg = 0x157; constexpr uint32_t expHiReg = 0x15a; constexpr uint32_t expLoReg = 0x15b; -constexpr std::initializer_list registerList [[maybe_unused]] = { expHiReg, expLoReg, gainReg }; +constexpr uint32_t frameLengthHiReg = 0x160; +constexpr uint32_t frameLengthLoReg = 0x161; +constexpr std::initializer_list registerList [[maybe_unused]] + = { expHiReg, expLoReg, gainReg, frameLengthHiReg, frameLengthLoReg }; class CamHelperImx219 : public CamHelper { @@ -93,6 +96,7 @@ void CamHelperImx219::PopulateMetadata(const MdParser::RegisterMap ®isters, deviceStatus.shutter_speed = Exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg)); deviceStatus.analogue_gain = Gain(registers.at(gainReg)); + deviceStatus.frame_length = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg); metadata.Set("device.status", deviceStatus); } diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp index efd1a5893db8..91d05d9226ff 100644 --- a/src/ipa/raspberrypi/cam_helper_imx477.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp @@ -23,7 +23,10 @@ constexpr uint32_t expHiReg = 0x0202; constexpr uint32_t expLoReg = 0x0203; constexpr uint32_t gainHiReg = 0x0204; constexpr uint32_t gainLoReg = 0x0205; -constexpr std::initializer_list registerList = { expHiReg, expLoReg, gainHiReg, gainLoReg }; +constexpr uint32_t frameLengthHiReg = 0x0340; +constexpr uint32_t frameLengthLoReg = 0x0341; +constexpr std::initializer_list registerList = + { expHiReg, expLoReg, gainHiReg, gainLoReg, frameLengthHiReg, frameLengthLoReg }; class CamHelperImx477 : public CamHelper { @@ -81,6 +84,7 @@ void CamHelperImx477::PopulateMetadata(const MdParser::RegisterMap ®isters, deviceStatus.shutter_speed = Exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg)); deviceStatus.analogue_gain = Gain(registers.at(gainHiReg) * 256 + registers.at(gainLoReg)); + deviceStatus.frame_length = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg); metadata.Set("device.status", deviceStatus); } diff --git a/src/ipa/raspberrypi/controller/device_status.cpp b/src/ipa/raspberrypi/controller/device_status.cpp index 7b8218ca67d5..f052ea8b7bed 100644 --- a/src/ipa/raspberrypi/controller/device_status.cpp +++ b/src/ipa/raspberrypi/controller/device_status.cpp @@ -11,6 +11,7 @@ using namespace libcamera; /* for the Duration operator<< overload */ std::ostream &operator<<(std::ostream &out, const DeviceStatus &d) { out << "Exposure: " << d.shutter_speed + << " Frame length: " << d.frame_length << " Gain: " << d.analogue_gain << " Aperture: " << d.aperture << " Lens: " << d.lens_position diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h index ec4bbe738b35..c4a5d9c8e8c7 100644 --- a/src/ipa/raspberrypi/controller/device_status.h +++ b/src/ipa/raspberrypi/controller/device_status.h @@ -17,8 +17,9 @@ struct DeviceStatus { DeviceStatus() - : shutter_speed(std::chrono::seconds(0)), analogue_gain(0.0), - lens_position(0.0), aperture(0.0), flash_intensity(0.0) + : shutter_speed(std::chrono::seconds(0)), frame_length(0), + analogue_gain(0.0), lens_position(0.0), aperture(0.0), + flash_intensity(0.0) { } @@ -26,6 +27,8 @@ struct DeviceStatus { /* time shutter is open */ libcamera::utils::Duration shutter_speed; + /* frame length given in number of lines */ + uint32_t frame_length; double analogue_gain; /* 1.0/distance-in-metres, or 0 if unknown */ double lens_position; diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index f51c970befb5..db103a885b7a 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -1015,9 +1015,11 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls) int32_t exposureLines = sensorControls.get(V4L2_CID_EXPOSURE).get(); int32_t gainCode = sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get(); + int32_t vblank = sensorControls.get(V4L2_CID_VBLANK).get(); deviceStatus.shutter_speed = helper_->Exposure(exposureLines); deviceStatus.analogue_gain = helper_->Gain(gainCode); + deviceStatus.frame_length = mode_.height + vblank; LOG(IPARPI, Debug) << "Metadata - " << deviceStatus; From patchwork Mon Jul 12 10:02:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12906 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 1FF3EC3226 for ; Mon, 12 Jul 2021 10:02:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B62186853F; Mon, 12 Jul 2021 12:02:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="IO/MTVbh"; dkim-atps=neutral Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A7B8F68526 for ; Mon, 12 Jul 2021 12:02:19 +0200 (CEST) Received: by mail-wm1-x32c.google.com with SMTP id y21-20020a7bc1950000b02902161fccabf1so10822265wmi.2 for ; Mon, 12 Jul 2021 03:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T6NinYvBUiWUrlkwJs5toZ8muaDrPBUvu8EVpeJf3Is=; b=IO/MTVbhv+b8k2FmCl39X5k0ZEmdT3ZzB9Z6sEyu753CMONwnI1nkP0GkjRVL99d51 NyZxbQVUsxPXTLzpmisVjgYE4l9XusEPlIfIQcvN1M0lrjFpABHiHN0iKERlBXA+8fh+ e4+2RWHTviWMogdzsSfV8Zg7LbQB4VkOLBD4+QM2e5t5dzVj0eicVpZPMoaSaihnKDS3 Nk3J2A3SjL3BliVBLy2KG7x7OJzEgmhPM5rBEN47WXCj0Qz+Kqz2SbNxKfk1vv7wKKim n2sUhDy6qYO8hZ0m1O6VHoB6thWZhchnw5HFvigee5zgoRxdPEcppz//XXjmOO9rAxtA 6bOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T6NinYvBUiWUrlkwJs5toZ8muaDrPBUvu8EVpeJf3Is=; b=m6X8O0qqiQ0fwv3OvFb5i0FP/nE7zn/rd0KbLl3bu+zraEakA0KNZMl9U0nt/x/sJ2 R00WG1s+R5tEv+saHMDzdIX99BsEh2N0EFD2MCLbHWu/M0Ee7YGhKVuEb9xm/bAWMPnr hzUsqlqCoRDmViTtwswCe62KcJRrWWtQgZVAqgHLd7Y+Uo4EPT4lMatwY+lD2H1fpN9i bXltIsijZunUi2ZejZZpDgHCmtn0aiKI2f1szmrIiv7b06dApwI0XKbXnXUfDU96Ly5Q 71GOa8P00ZViz8YRge+x6NjiTRSbxCKu0UtLcdKvYTPEaFRyfsMdADSXwt3CxaM9TUCV dUOg== X-Gm-Message-State: AOAM530aKqeFDV7tixj0vCqONf5Matf3ywwlSilaYFC0y8aAMi+42sQV qv0sm8OO1xEUkpbfiAZngxXQbS2uKyldJw== X-Google-Smtp-Source: ABdhPJzGPK2MQZfBj8D12gQa3CPolXbDb85+lh2AV2FO6+t98BJP6Art2S9WnqZKRBYw4AzrJ6gUCw== X-Received: by 2002:a05:600c:20b:: with SMTP id 11mr13989626wmi.112.1626084139147; Mon, 12 Jul 2021 03:02:19 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:3395:5e50:10bb:f8fd]) by smtp.gmail.com with ESMTPSA id b16sm14249941wrs.51.2021.07.12.03.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:02:18 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Jul 2021 11:02:06 +0100 Message-Id: <20210712100209.447893-6-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712100209.447893-1-naush@raspberrypi.com> References: <20210712100209.447893-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 5/8] ipa: raspberrypi: Allow long exposure modes for imx477. X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Update the imx477 CamHelper to use long exposure modes if needed. This is done by overloading the CamHelper::GetVBlanking function to return a frame length (and vblank value) computed using a scaling factor when the value would be larger than what the sensor register could otherwise hold. CamHelperImx477::Prepare is also overloaded to ensure that the "device.status" metadata returns the right value if the long exposure scaling factor is used. The scaling factor is unfortunately not returned back in metadata. With the current imx477 driver, we can achieve a maximum exposure time of approx 127 seconds since the HBLANK control is read-only. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/cam_helper_imx477.cpp | 86 +++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp index 91d05d9226ff..338fdc0c416a 100644 --- a/src/ipa/raspberrypi/cam_helper_imx477.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp @@ -6,14 +6,23 @@ */ #include +#include #include #include #include +#include + #include "cam_helper.hpp" #include "md_parser.hpp" using namespace RPiController; +using namespace libcamera; +using libcamera::utils::Duration; + +namespace libcamera { +LOG_DECLARE_CATEGORY(IPARPI) +} /* * We care about two gain registers and a pair of exposure registers. Their @@ -34,6 +43,9 @@ public: CamHelperImx477(); uint32_t GainCode(double gain) const override; double Gain(uint32_t gain_code) const override; + void Prepare(libcamera::Span buffer, Metadata &metadata) override; + uint32_t GetVBlanking(Duration &exposure, Duration minFrameDuration, + Duration maxFrameDuration) const override; void GetDelays(int &exposure_delay, int &gain_delay, int &vblank_delay) const override; bool SensorEmbeddedDataPresent() const override; @@ -44,6 +56,10 @@ private: * in units of lines. */ static constexpr int frameIntegrationDiff = 22; + /* Maximum frame length allowable for long exposure calculations. */ + static constexpr int frameLengthMax = 0xffdc; + /* Largest long exposure scale factor given as a left shift on the frame length. */ + static constexpr int longExposureShiftMax = 7; void PopulateMetadata(const MdParser::RegisterMap ®isters, Metadata &metadata) const override; @@ -64,6 +80,76 @@ double CamHelperImx477::Gain(uint32_t gain_code) const return 1024.0 / (1024 - gain_code); } +void CamHelperImx477::Prepare(libcamera::Span buffer, Metadata &metadata) +{ + MdParser::RegisterMap registers; + DeviceStatus deviceStatus; + + if (metadata.Get("device.status", deviceStatus)) { + LOG(IPARPI, Error) << "DeviceStatus not found from DelayedControls"; + return; + } + + parseEmbeddedData(buffer, metadata); + + /* + * The DeviceStatus struct is first populated with values obtained from + * DelayedControls. If this reports frame length is > frameLengthMax, + * it means we are using a long exposure mode. Since the long exposure + * scale factor is not returned back through embedded data, we must rely + * on the existing exposure lines and frame length values returned by + * DelayedControls. + * + * Otherwise, all values are updated with what is reported in the + * embedded data. + */ + if (deviceStatus.frame_length > frameLengthMax) { + DeviceStatus parsedDeviceStatus; + + metadata.Get("device.status", parsedDeviceStatus); + parsedDeviceStatus.shutter_speed = deviceStatus.shutter_speed; + parsedDeviceStatus.frame_length = deviceStatus.frame_length; + metadata.Set("device.status", parsedDeviceStatus); + + LOG(IPARPI, Debug) << "Metadata updated for long exposure: " + << parsedDeviceStatus; + } +} + +uint32_t CamHelperImx477::GetVBlanking(Duration &exposure, + Duration minFrameDuration, + Duration maxFrameDuration) const +{ + uint32_t frameLength, exposureLines; + unsigned int shift = 0; + + frameLength = mode_.height + CamHelper::GetVBlanking(exposure, minFrameDuration, + maxFrameDuration); + /* + * Check if the frame length calculated needs to be setup for long + * exposure mode. This will require us to use a long exposure scale + * factor provided by a shift operation in the sensor. + */ + while (frameLength > frameLengthMax) { + if (++shift > longExposureShiftMax) { + shift = longExposureShiftMax; + frameLength = frameLengthMax; + break; + } + frameLength >>= 1; + } + + if (shift) { + /* Account for any rounding in the scaled frame length value. */ + frameLength <<= shift; + exposureLines = ExposureLines(exposure); + exposureLines = std::min(exposureLines, frameLength - frameIntegrationDiff); + exposure = Exposure(exposureLines); + } + + return frameLength - mode_.height; +} + void CamHelperImx477::GetDelays(int &exposure_delay, int &gain_delay, int &vblank_delay) const { From patchwork Mon Jul 12 10:02:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12907 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8710BC3228 for ; Mon, 12 Jul 2021 10:02:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 10BAA68541; Mon, 12 Jul 2021 12:02:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="VGEbvU7E"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BF2A268513 for ; Mon, 12 Jul 2021 12:02:20 +0200 (CEST) Received: by mail-wm1-x32e.google.com with SMTP id g8-20020a1c9d080000b02901f13dd1672aso9486432wme.0 for ; Mon, 12 Jul 2021 03:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9yRgYhw3UKh19+/uNBMvathD7mePEk0qnePq4Nd1t/0=; b=VGEbvU7E5boc9nZ/cLbhVItqXts35gUcPxHpnWGbOSuLMjStnynl51TFuzbtzjeMDm 7DZ/bvMpL6d0i3Fw7L4pBwa2b1kQwzpKJrgb1OIbex+e1P+7T3IszPy2KFlkRyk1arrr Qe2lHM/9TGZ7TfNbNeBC272yFf00hGBPl4o6jBFxSZ62TX8mWL/E1v6umnU/ldIa//Js 2u2Nn+orSG3ts83WhP/Lqv1c4hVjaJIvHKx9d9J3pXo3u+1qsKHGxNkJ+rLhQWYpCElR aiHwEXP3gXUGSQcp6lNaZhAKbSvndr01H8JnpfqN3EKNKIJg+RTFrFxHVT3apdUJwdOm hJXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9yRgYhw3UKh19+/uNBMvathD7mePEk0qnePq4Nd1t/0=; b=RShdYGZsGRIg99eh8U2/eObvHI69rV+rVk4S9QoCteWswnQGxXDnUzsXFVVTeTO9Fp OzYLaVpuZfd+fm+814mGnbunNwr2WovJfHcFC45Z3o0OF33/hj+XEk+2zTneWgb7ZizB OBZe4xX2HnCjZ8vPleM+kUZ/EAPR60dfqL00r6+v97B0AkgGrl7nUBuqePZTRnBNs1PS NwLktKhaggrOiVEkW94bfe91mH/1t0Eeul9LVJS4e60nAsOLL0YUME/R7E1Qe6Yu5X6C Q0Cr13UkWcfP7PyAhPds33dfYvFynHVI3gN9bLS45AqNZ7Mbx67V/2lMN/q0aWlHwqp1 sgsw== X-Gm-Message-State: AOAM530ZDkgwAS1ogDLLnEwXH9j5cRTfHMiSCWjd+3CZgcE/BqcLXCRZ ZKsRsjLi9WkGq/BXooV3ZjhLvlPHoD+gZQ== X-Google-Smtp-Source: ABdhPJwUXfOdEIXNuOQFrlK2b+wEoajCXCBWmTqnYA+8J0yg4qMSiEQZTgVW8k9cI2/vnuRe60RNMw== X-Received: by 2002:a7b:c92b:: with SMTP id h11mr11130194wml.182.1626084140109; Mon, 12 Jul 2021 03:02:20 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:3395:5e50:10bb:f8fd]) by smtp.gmail.com with ESMTPSA id b16sm14249941wrs.51.2021.07.12.03.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:02:19 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Jul 2021 11:02:07 +0100 Message-Id: <20210712100209.447893-7-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712100209.447893-1-naush@raspberrypi.com> References: <20210712100209.447893-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 6/8] pipeline: raspberrypi: Use priority write for vblank when writing sensor ctrls X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When directly writing controls to the sensor device, ensure that VBLANK is written ahead of and before the EXPOSURE control. This is the same priority write mechanism used in DelayedControls. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- .../pipeline/raspberrypi/raspberrypi.cpp | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 082eb1ee1c23..c09352809c01 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -154,6 +154,7 @@ public: void embeddedComplete(uint32_t bufferId); void setIspControls(const ControlList &controls); void setDelayedControls(const ControlList &controls); + void setSensorControls(ControlList &controls); /* bufferComplete signal handlers. */ void unicamBufferDequeue(FrameBuffer *buffer); @@ -828,7 +829,7 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls) /* Apply any gain/exposure settings that the IPA may have passed back. */ if (!startConfig.controls.empty()) - data->unicam_[Unicam::Image].dev()->setControls(&startConfig.controls); + data->setSensorControls(startConfig.controls); /* Configure the number of dropped frames required on startup. */ data->dropFrameCount_ = startConfig.dropFrameCount; @@ -1075,7 +1076,7 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator) ControlList ctrls(dev->controls()); ctrls.set(V4L2_CID_HFLIP, 0); ctrls.set(V4L2_CID_VFLIP, 0); - dev->setControls(&ctrls); + data->setSensorControls(ctrls); } /* Look for a valid Bayer format. */ @@ -1294,22 +1295,20 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config) return -EPIPE; } - if (!controls.empty()) - unicam_[Unicam::Image].dev()->setControls(&controls); - /* * Configure the H/V flip controls based on the combination of * the sensor and user transform. */ if (supportsFlips_) { - ControlList ctrls(unicam_[Unicam::Image].dev()->controls()); - ctrls.set(V4L2_CID_HFLIP, - static_cast(!!(rpiConfig->combinedTransform_ & Transform::HFlip))); - ctrls.set(V4L2_CID_VFLIP, - static_cast(!!(rpiConfig->combinedTransform_ & Transform::VFlip))); - unicam_[Unicam::Image].dev()->setControls(&ctrls); + controls.set(V4L2_CID_HFLIP, + static_cast(!!(rpiConfig->combinedTransform_ & Transform::HFlip))); + controls.set(V4L2_CID_VFLIP, + static_cast(!!(rpiConfig->combinedTransform_ & Transform::VFlip))); } + if (!controls.empty()) + setSensorControls(controls); + return 0; } @@ -1379,6 +1378,28 @@ void RPiCameraData::setDelayedControls(const ControlList &controls) handleState(); } +void RPiCameraData::setSensorControls(ControlList &controls) +{ + /* + * We need to ensure that if both VBLANK and EXPOSURE are present, the + * former must be written ahead of, and separately from EXPOSURE to avoid + * V4L2 rejecting the latter. This is identical to what DelayedControls + * does with the priority write flag. + * + * As a consequence of the below logic, VBLANK gets set twice, and we + * rely on the v4l2 framework to not pass the second control set to the + * driver as the actual control value has not changed. + */ + if (controls.contains(V4L2_CID_EXPOSURE) && controls.contains(V4L2_CID_VBLANK)) { + ControlList vblank_ctrl; + + vblank_ctrl.set(V4L2_CID_VBLANK, controls.get(V4L2_CID_VBLANK)); + unicam_[Unicam::Image].dev()->setControls(&vblank_ctrl); + } + + unicam_[Unicam::Image].dev()->setControls(&controls); +} + void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer) { RPi::Stream *stream = nullptr; From patchwork Mon Jul 12 10:02:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12908 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 13E8FC3224 for ; Mon, 12 Jul 2021 10:02:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A720568513; Mon, 12 Jul 2021 12:02:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="EFsEi0/s"; dkim-atps=neutral Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 33FBE6852A for ; Mon, 12 Jul 2021 12:02:21 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id n4so591177wms.1 for ; Mon, 12 Jul 2021 03:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GrEvIR8KQD1por475K+vZexNkbD1WHVM35KkcSjFiHw=; b=EFsEi0/sCc1W71BQgoVj2LuveenGDUDKCpUkw5OeSw5wHLLNLP4zZLWPy1LPrupnrd U6KwGGLzG7AVqp0e0LDbqyQBu+foxBm7f0DDTKquRkDosQnef1DPwimq3v6zmXXj5YFV PCI+yYw7CxaUkT/GlVM0w0s8z48Sx4bW80/KoOuz2Ty/Ags3B/Nutf6QHH4rLOSSQ7oJ ezw7eI4DPiZNfhdqYKS3nZo+rzLX4EbSsA/1+JeBRL+eAsPg4fwMYUABqIvpFMVAAaMn cGFPcKWetHcCtm9EBGMyY60gKRkqEbSqOOguVlCyS+TOKkaIC7VXxTi8oIgRToQfzznm ZHlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GrEvIR8KQD1por475K+vZexNkbD1WHVM35KkcSjFiHw=; b=BM/JK4CaJHFYe7Ff+BeZZtphaFe4viMeSaJUSFr9325VGZ3GXEkXqGS5pMGT5uWkyc HQ1djmQwg+GpkZ2edJ90+k5BuepfO7JTG36JtrjAMX9xPsk0FGpoXhS5aQQJhYch0+iP 9aIJSgH64WiVm5kKQ02HCnOoxImP6SlyutCFgPsiM1TzsDh6es2JUXN6S4K43kz/3oA0 uOCKkleeO6dfRW63FvUaLfbF7dPdlp4eJevZCTuqY0rg9AEAfjv8J/rn/bCKJwfrgKI4 f2PbZjpkq+fqxjoVQKG8+X8jKM2wJfqiXESBgW+M9fIiJkvnXEsbutp1gmc7cR5IG4y0 LABA== X-Gm-Message-State: AOAM530hL2vBT1RQh/9+0qvnA1WMV7BZmPJ6uAOy/HAJIQms9dIfAr8x 45x+pLGj7SIyXPxPKM/Lu3Lt7OQhm1qzcw== X-Google-Smtp-Source: ABdhPJy9OekzKej97ih5GzWv/6gTcRU5pZzaQbLC8n/n0e1LxZxqO+GCAgI1Pmw9Dwg1WPex/6jQiw== X-Received: by 2002:a1c:730d:: with SMTP id d13mr14030835wmb.129.1626084140772; Mon, 12 Jul 2021 03:02:20 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:3395:5e50:10bb:f8fd]) by smtp.gmail.com with ESMTPSA id b16sm14249941wrs.51.2021.07.12.03.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:02:20 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Jul 2021 11:02:08 +0100 Message-Id: <20210712100209.447893-8-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712100209.447893-1-naush@raspberrypi.com> References: <20210712100209.447893-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 7/8] ipa: raspberrypi: Increase the default max frame duration to 250s X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" With the recent change to allow long exposures on the imx477, the existing 100s limit was not adequate. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- src/ipa/raspberrypi/raspberrypi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index db103a885b7a..8fb98a49da63 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -62,7 +62,7 @@ using utils::Duration; constexpr double DefaultAnalogueGain = 1.0; constexpr Duration DefaultExposureTime = 20.0ms; constexpr Duration defaultMinFrameDuration = 1.0s / 30.0; -constexpr Duration defaultMaxFrameDuration = 100.0s; +constexpr Duration defaultMaxFrameDuration = 250.0s; /* * Determine the minimum allowable inter-frame duration to run the controller From patchwork Mon Jul 12 10:02:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12909 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 65065C3226 for ; Mon, 12 Jul 2021 10:02:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1EB4D68524; Mon, 12 Jul 2021 12:02:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="RNbX5AmQ"; dkim-atps=neutral Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D914E68537 for ; Mon, 12 Jul 2021 12:02:21 +0200 (CEST) Received: by mail-wm1-x330.google.com with SMTP id k32so7791495wms.4 for ; Mon, 12 Jul 2021 03:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JfVlZgifnrAPHzprhAfOgQPbEe41tKFlQcQqQlEMu0M=; b=RNbX5AmQ+a8w6fYoLVsQbAeMBsrJqSk4KGIglmpM7j0KAeKVEjYIX5kuMq0UOq1+p0 yZhP2JzxlSam76LGOG9O4rC/wAdQuILtn06p+0Qlcj5P2goeqmyu1TeRUWJ8j6LLiTz3 xRwZv0G9n7il1oV8wR0xCYSfjRFpgM9HjvwKRNGrHiruIctPbpePfZoXmzMzwQtGMgy0 YA8FxBDRQn7XqXOqHJ4sdvnD3SEDY+QZqfLwAgPn4KN0RIQxgHxUg8i/xvkxKBUY2swo FvEv1vcl30d8sjjiVSSwavx23ck0/8N7pvfcWHdt2XBJfokJ86olxUMskDZf/dXwq5UV /Zkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JfVlZgifnrAPHzprhAfOgQPbEe41tKFlQcQqQlEMu0M=; b=MZ9fam+Ozfed792Nxt18fW0KyayA5W7EHIBIQNYT6C0Y5yMgsrxxJqbMQl+2Bx+J0s gY3aY2qXc+jOAJSZBbrPbhtsRSR8rfVB172VoYA/KvOmrecYItLwKnjYyhaC+g7Pow2c TtfOJUpyzYEB349PB0vgFNSEltYzDrpLvf4a3nv1lYyjRhptV/FEx9zCOCx8XQjMxIQe LEGpGWkWq15O8apgt2JYOgnPuuymdAN3wLH4OPuHwNUtsiq0GyzmLCXH+uDMAR7/v7IM 0aZIt1dUAmqHfGgordZbcDggLhvgJhwp+WKXyHU5WM6M/jghlgchQRRwwhfUA6NXSP3A CZDg== X-Gm-Message-State: AOAM5332E7aEkD0UJB5jP7BR3n5F9EgJ69N7iPZm0tBXR4yNd+FRWgRQ leDDQv9Uveek0fqrJfvq+KSh0O/nzEI/iw== X-Google-Smtp-Source: ABdhPJzm9wIfhdSwtW/PXbUlWj8e+fGRilbgHUAhqPsPLyU6eA+RciCRAdDynFYPHNkmHiHxBA0DnQ== X-Received: by 2002:a1c:1d8e:: with SMTP id d136mr36956864wmd.52.1626084141450; Mon, 12 Jul 2021 03:02:21 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:3395:5e50:10bb:f8fd]) by smtp.gmail.com with ESMTPSA id b16sm14249941wrs.51.2021.07.12.03.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:02:20 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Jul 2021 11:02:09 +0100 Message-Id: <20210712100209.447893-9-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712100209.447893-1-naush@raspberrypi.com> References: <20210712100209.447893-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 8/8] ipa: raspberrypi: Make variable names consistent X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" s/DefaultAnalogueGain/defaultAnalogueGain/ s/DefaultExposureTime/defaultExposureTime/ Change these for consistency with the other static const variables. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- src/ipa/raspberrypi/raspberrypi.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 8fb98a49da63..1dd7fd68c3e9 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -59,8 +59,8 @@ using namespace std::literals::chrono_literals; using utils::Duration; /* Configure the sensor with these values initially. */ -constexpr double DefaultAnalogueGain = 1.0; -constexpr Duration DefaultExposureTime = 20.0ms; +constexpr double defaultAnalogueGain = 1.0; +constexpr Duration defaultExposureTime = 20.0ms; constexpr Duration defaultMinFrameDuration = 1.0s / 30.0; constexpr Duration defaultMaxFrameDuration = 250.0s; @@ -390,8 +390,8 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo, /* Supply initial values for gain and exposure. */ ControlList ctrls(sensorCtrls_); AgcStatus agcStatus; - agcStatus.shutter_time = DefaultExposureTime; - agcStatus.analogue_gain = DefaultAnalogueGain; + agcStatus.shutter_time = defaultExposureTime; + agcStatus.analogue_gain = defaultAnalogueGain; applyAGC(&agcStatus, ctrls); ASSERT(controls);