From patchwork Sat Nov 13 08:49:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 14603 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 B673AC324F for ; Sat, 13 Nov 2021 08:50:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5A56B6036C; Sat, 13 Nov 2021 09:50:04 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rEIr/ugD"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 866AF60394 for ; Sat, 13 Nov 2021 09:49:53 +0100 (CET) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:4d35:9445:6881:4ffd]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3D28A55C; Sat, 13 Nov 2021 09:49:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1636793393; bh=QWekOye9ZV8IwyJ1PCC5qBnXNK+YkUVkIconh9+UD1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rEIr/ugDOj7KgDSdG+0U1YLyvuXteoMo4LmZj7aISfw75d3Rr+8GtufrzXbB2jAFy wVcnQ+Jv4U0sKl3/bjYGqa80eDXlfJVYqF5U2UUzMu9H+j4+cdfu1Ls3YDnyO3HzxR cAV42wYeUiHm71pFU9LX9BsoXeuNL8BFJ3lBqGgw= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Sat, 13 Nov 2021 09:49:46 +0100 Message-Id: <20211113084947.21892-14-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211113084947.21892-1-jeanmichel.hautbois@ideasonboard.com> References: <20211113084947.21892-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 13/14] ipa: ipu3: Move ExposureTime to IPA 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" Now that we have the exposure time calculated, report it in the controls::ExposureTime and don't use the pipeline handler for it anymore. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain Reviewed-by: Paul Elder --- src/ipa/ipu3/ipu3.cpp | 2 ++ src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +--------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index f1597f78..dc6f2ced 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -630,6 +630,8 @@ void IPAIPU3::parseStatistics(unsigned int frame, ctrls.set(controls::ColourTemperature, context_.frameContext.awb.temperatureK); + ctrls.set(controls::ExposureTime, context_.frameContext.sensor.exposure * lineDuration_.get()); + /* * \todo The Metadata provides a path to getting extended data * out to the application. Further data such as a simplifed Histogram diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index c984ed12..319bb1a3 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -47,7 +47,7 @@ class IPU3CameraData : public Camera::Private { public: IPU3CameraData(PipelineHandler *pipe) - : Camera::Private(pipe), exposureTime_(0), supportsFlips_(false) + : Camera::Private(pipe), supportsFlips_(false) { } @@ -67,7 +67,6 @@ public: Stream vfStream_; Stream rawStream_; - uint32_t exposureTime_; Rectangle cropRegion_; bool supportsFlips_; Transform rotationTransform_; @@ -1045,17 +1044,6 @@ int PipelineHandlerIPU3::updateControls(IPU3CameraData *data) controls[&controls::ScalerCrop] = ControlInfo(minCrop, maxCrop, maxCrop); - /* - * \todo Report the actual exposure time, use the default for the - * moment. - */ - const auto exposureInfo = data->ipaControls_.find(&controls::ExposureTime); - if (exposureInfo == data->ipaControls_.end()) { - LOG(IPU3, Error) << "Exposure control not initialized by the IPA"; - return -EINVAL; - } - data->exposureTime_ = exposureInfo->second.def().get(); - /* Add the IPA registered controls to list of camera controls. */ for (const auto &ipaControl : data->ipaControls_) controls[ipaControl.first] = ipaControl.second; @@ -1317,8 +1305,6 @@ void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer) pipe()->completeBuffer(request, buffer); request->metadata().set(controls::draft::PipelineDepth, 3); - /* \todo Move the ExposureTime control to the IPA. */ - request->metadata().set(controls::ExposureTime, exposureTime_); /* \todo Actually apply the scaler crop region to the ImgU. */ if (request->controls().contains(controls::ScalerCrop)) cropRegion_ = request->controls().get(controls::ScalerCrop);