{"id":14541,"url":"https://patchwork.libcamera.org/api/1.1/patches/14541/?format=json","web_url":"https://patchwork.libcamera.org/patch/14541/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20211110195901.85597-14-jeanmichel.hautbois@ideasonboard.com>","date":"2021-11-10T19:59:00","name":"[libcamera-devel,v2,13/14] ipa: ipu3: Move ExposureTime to IPA","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"1ac7504193de2a08a808927a54b7aa7a0f574ac4","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/1.1/people/75/?format=json","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14541/mbox/","series":[{"id":2708,"url":"https://patchwork.libcamera.org/api/1.1/series/2708/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2708","date":"2021-11-10T19:58:47","name":"IPA: IPU3: Introduce per-frame controls","version":2,"mbox":"https://patchwork.libcamera.org/series/2708/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14541/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14541/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 7987FC3250\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Nov 2021 19:59:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3321B603D9;\n\tWed, 10 Nov 2021 20:59:20 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9BC156038A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Nov 2021 20:59:08 +0100 (CET)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:7713:3465:89e6:c5cd])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5654E1203;\n\tWed, 10 Nov 2021 20:59:08 +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=\"ex2DiTAp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1636574348;\n\tbh=2A3NQGgjUtHDOYwChd++zg1d2BLD0Pz9tz26tsWIFZA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ex2DiTApmjrTnTUROA4F2G38WlmQ0MQ5VkzjNoUVgwscq0vt6ILHVM+ycopCmkfsH\n\tM2UbflEJJd/gMCSJs+++0ZPratu/gnNgxRpgls3t0cD/OFW26i3rtLt2aDWlP1f8e5\n\tq9iKTxM08yd+e3mKqhEb1NX7bUfAYci/hhfJR2ks=","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 10 Nov 2021 20:59:00 +0100","Message-Id":"<20211110195901.85597-14-jeanmichel.hautbois@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20211110195901.85597-1-jeanmichel.hautbois@ideasonboard.com>","References":"<20211110195901.85597-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 13/14] ipa: ipu3: Move ExposureTime to\n\tIPA","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":"Now that we have the exposure time calculated, pass it to the\ncontrols::ExposureTime and don't use the pipeline handler for it\nanymore. While at it, use the same line duration value for ExposureTime\nand FrameDuration.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\n src/ipa/ipu3/ipu3.cpp                |  6 ++++--\n src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +---------------\n 2 files changed, 5 insertions(+), 17 deletions(-)","diff":"diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 68a97e8e..9220fea5 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -629,12 +629,14 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n \tsetControls(frame);\n \n \t/* \\todo Use VBlank value calculated from each frame exposure. */\n-\tint64_t frameDuration = sensorInfo_.lineLength * (defVBlank_ + sensorInfo_.outputSize.height) /\n-\t\t\t\t(sensorInfo_.pixelRate / 1e6);\n+\tint64_t frameDuration = (defVBlank_ + sensorInfo_.outputSize.height)\n+\t\t\t      * lineDuration_.count();\n \tctrls.set(controls::FrameDuration, frameDuration);\n \n \tctrls.set(controls::ColourTemperature, context_.frameContext.awb.temperatureK);\n \n+\tctrls.set(controls::ExposureTime, context_.frameContext.agc.exposure * lineDuration_.count());\n+\n \t/*\n \t * \\todo We should be able to add 'anything' (with a Control) in here to\n \t * get information to say.\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 3fcfa777..fe37e9c7 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -47,7 +47,7 @@ class IPU3CameraData : public Camera::Private\n {\n public:\n \tIPU3CameraData(PipelineHandler *pipe)\n-\t\t: Camera::Private(pipe), exposureTime_(0), supportsFlips_(false)\n+\t\t: Camera::Private(pipe), supportsFlips_(false)\n \t{\n \t}\n \n@@ -67,7 +67,6 @@ public:\n \tStream vfStream_;\n \tStream rawStream_;\n \n-\tuint32_t exposureTime_;\n \tRectangle cropRegion_;\n \tbool supportsFlips_;\n \tTransform rotationTransform_;\n@@ -1049,17 +1048,6 @@ int PipelineHandlerIPU3::updateControls(IPU3CameraData *data)\n \n \tcontrols[&controls::ScalerCrop] = ControlInfo(minCrop, maxCrop, maxCrop);\n \n-\t/*\n-\t * \\todo Report the actual exposure time, use the default for the\n-\t * moment.\n-\t */\n-\tconst auto exposureInfo = data->ipaControls_.find(&controls::ExposureTime);\n-\tif (exposureInfo == data->ipaControls_.end()) {\n-\t\tLOG(IPU3, Error) << \"Exposure control not initialized by the IPA\";\n-\t\treturn -EINVAL;\n-\t}\n-\tdata->exposureTime_ = exposureInfo->second.def().get<int32_t>();\n-\n \t/* Add the IPA registered controls to list of camera controls. */\n \tfor (const auto &ipaControl : data->ipaControls_)\n \t\tcontrols[ipaControl.first] = ipaControl.second;\n@@ -1321,8 +1309,6 @@ void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer)\n \tpipe()->completeBuffer(request, buffer);\n \n \trequest->metadata().set(controls::draft::PipelineDepth, 3);\n-\t/* \\todo Move the ExposureTime control to the IPA. */\n-\trequest->metadata().set(controls::ExposureTime, exposureTime_);\n \t/* \\todo Actually apply the scaler crop region to the ImgU. */\n \tif (request->controls().contains(controls::ScalerCrop))\n \t\tcropRegion_ = request->controls().get(controls::ScalerCrop);\n","prefixes":["libcamera-devel","v2","13/14"]}