From patchwork Tue Mar 16 15:40:22 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: 11590 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 08211C32E1 for ; Tue, 16 Mar 2021 15:40:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EF53968D52; Tue, 16 Mar 2021 16:40:27 +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="PQAg46VE"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9EBD968D49 for ; Tue, 16 Mar 2021 16:40:26 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:169:7140:f840:1816:ba68:a009]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 405AA8CF; Tue, 16 Mar 2021 16:40:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615909226; bh=Y/mNKW4QNcLn6DK4Eq31wtC7K7Os4Fna3HhH89XJYNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PQAg46VENXSsQ/jfpuUuo6eGzleWRD/JNU9GIMiWZbELEyDeFcthN8PR/odSdtfFe uJA/wommT6mprzw0ImhHsi4QEQJWiETIenVPVbixey1xLY2KH0qFlnOA1kVwTMX9Xh T0eE7zsWv2BTw6A4y+eQl6LOLz7ZMfvWWf/WZM3g= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Tue, 16 Mar 2021 16:40:22 +0100 Message-Id: <20210316154023.46033-2-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210316154023.46033-1-jeanmichel.hautbois@ideasonboard.com> References: <20210316154023.46033-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 1/2] libcamera: ipu3: Move ipa configuration from start() to configure() 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" IPA was configured after all the pipeline devices were started, including IPA itself... Move it at the end of configure() call. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/ipu3.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 2ea13ec9..bb61ef4a 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -633,6 +633,10 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) return ret; } + std::map entityControls; + entityControls.emplace(0, data->cio2_.sensor()->controls()); + data->ipa_->configure(entityControls); + return 0; } @@ -717,7 +721,6 @@ int PipelineHandlerIPU3::freeBuffers(Camera *camera) int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlList *controls) { - std::map entityControls; IPU3CameraData *data = cameraData(camera); CIO2Device *cio2 = &data->cio2_; ImgUDevice *imgu = data->imgu_; @@ -744,9 +747,6 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis if (ret) goto error; - entityControls.emplace(0, data->cio2_.sensor()->controls()); - data->ipa_->configure(entityControls); - return 0; error: From patchwork Tue Mar 16 15:40:23 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: 11591 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 CF780C32E1 for ; Tue, 16 Mar 2021 15:40:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4FF6A68D54; Tue, 16 Mar 2021 16:40:28 +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="fOJN5iHs"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 48B1F68D49 for ; Tue, 16 Mar 2021 16:40:27 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:169:7140:f840:1816:ba68:a009]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E77068F7; Tue, 16 Mar 2021 16:40:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615909227; bh=ciD+j3GB5O29Bs9wqtSwYTHeGrR1vGG65741+aPl4LY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fOJN5iHsuJDCeMsJC3f6GEBoOj1Dh3EgLOIssAwSbUIVaU0JHNGOnDqCwW+cyyoUW i1trgKQyc5uwiZbDcKO5iRvpo/Wpqm5UJms1I49sjs9M18m1O96/egEGtgd5Jnm0cy /Nm2ieAKvKVlz1+3DKrS7NgvE1O/WJQ5zNhgs2IU= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Tue, 16 Mar 2021 16:40:23 +0100 Message-Id: <20210316154023.46033-3-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210316154023.46033-1-jeanmichel.hautbois@ideasonboard.com> References: <20210316154023.46033-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 2/2] libcamera: ipu3: Pass the BDS rectangle at IPA configure call 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 IPU3 IPA will need the BDS configuration when the AWB/AGC algorithm will be integrated. In order to do that, the configure() interface needs to be modified. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- v4: - get back to pipeConfig_ beeing private v3: - pass bds size to ipa->configure() v2: - rename bds => bdsOutputSize - use a libcamera::Size instead of libcamera::Rectangle --- include/libcamera/ipa/ipu3.mojom | 2 +- src/ipa/ipu3/ipu3.cpp | 7 +++++-- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom index 6ee11333..5d13e7ea 100644 --- a/include/libcamera/ipa/ipu3.mojom +++ b/include/libcamera/ipa/ipu3.mojom @@ -30,7 +30,7 @@ interface IPAIPU3Interface { start() => (int32 ret); stop(); - configure(map entityControls) => (); + configure(map entityControls, Size bdsOutputSize) => (); mapBuffers(array buffers); unmapBuffers(array ids); diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index b63e58be..be73a225 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -35,7 +35,9 @@ public: int start() override { return 0; } void stop() override {} - void configure(const std::map &entityControls) override; + void configure( + const std::map &entityControls, + const Size &bdsOutputSize) override; void mapBuffers(const std::vector &buffers) override; void unmapBuffers(const std::vector &ids) override; @@ -62,7 +64,8 @@ private: uint32_t maxGain_; }; -void IPAIPU3::configure(const std::map &entityControls) +void IPAIPU3::configure(const std::map &entityControls, + [[maybe_unused]] const Size &bdsOutputSize) { if (entityControls.empty()) return; diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index bb61ef4a..c9e3c5ef 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -635,7 +635,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) std::map entityControls; entityControls.emplace(0, data->cio2_.sensor()->controls()); - data->ipa_->configure(entityControls); + data->ipa_->configure(entityControls, config->imguConfig().bds); return 0; }